diff --git a/CHANGELOG.md b/CHANGELOG.md index 974b5d43..295c7678 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## v0.23.8 + +- Fixed Model->Record and Model->Collection hook events sync for nested and/or inner-hook transactions ([#6122](https://github.com/pocketbase/pocketbase/discussions/6122)). + +- Other minor improvements (updated Go and npm deps, added extra escaping for the default mail record params in case the emails are stored as html files, fixed code comment typos, etc.). + + ## v0.23.7 - Fixed JSVM exception -> Go error unwrapping when throwing errors from non-request hooks ([#6102](https://github.com/pocketbase/pocketbase/discussions/6102)). diff --git a/core/collection_query.go b/core/collection_query.go index a7318938..04743596 100644 --- a/core/collection_query.go +++ b/core/collection_query.go @@ -75,16 +75,16 @@ func (app *BaseApp) FindCollectionByNameOrId(nameOrId string) (*Collection, erro return m, nil } -// FindCachedCollectionByNameOrId is similar to [App.FindCollectionByNameOrId] +// FindCachedCollectionByNameOrId is similar to [BaseApp.FindCollectionByNameOrId] // but retrieves the Collection from the app cache instead of making a db call. // // NB! This method is suitable for read-only Collection operations. // // Returns [sql.ErrNoRows] if no Collection is found for consistency -// with the [App.FindCollectionByNameOrId] method. +// with the [BaseApp.FindCollectionByNameOrId] method. // // If you plan making changes to the returned Collection model, -// use [App.FindCollectionByNameOrId] instead. +// use [BaseApp.FindCollectionByNameOrId] instead. // // Caveats: // @@ -94,7 +94,7 @@ func (app *BaseApp) FindCollectionByNameOrId(nameOrId string) (*Collection, erro // - If you are updating a Collection in a transaction and then call this method before commit, // it'll return the cached Collection state and not the one from the uncommitted transaction. // - The cache is automatically updated on collections db change (create/update/delete). -// To manually reload the cache you can call [App.ReloadCachedCollections()] +// To manually reload the cache you can call [BaseApp.ReloadCachedCollections] func (app *BaseApp) FindCachedCollectionByNameOrId(nameOrId string) (*Collection, error) { collections, _ := app.Store().Get(StoreKeyCachedCollections).([]*Collection) if collections == nil { diff --git a/go.mod b/go.mod index 095f9cbf..c1467faa 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,7 @@ require ( github.com/spf13/cast v1.7.0 github.com/spf13/cobra v1.8.1 gocloud.dev v0.40.0 - golang.org/x/crypto v0.30.0 + golang.org/x/crypto v0.31.0 golang.org/x/net v0.32.0 golang.org/x/oauth2 v0.24.0 golang.org/x/sync v0.10.0 @@ -66,7 +66,7 @@ require ( github.com/spf13/pflag v1.0.5 // indirect github.com/stretchr/testify v1.8.2 // indirect go.opencensus.io v0.24.0 // indirect - golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect + golang.org/x/exp v0.0.0-20241215155358-4a5509556b9e // indirect golang.org/x/image v0.23.0 // indirect golang.org/x/mod v0.22.0 // indirect golang.org/x/sys v0.28.0 // indirect @@ -76,9 +76,9 @@ require ( golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect google.golang.org/api v0.211.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576 // indirect - google.golang.org/grpc v1.68.1 // indirect + google.golang.org/grpc v1.69.0 // indirect google.golang.org/protobuf v1.35.2 // indirect - modernc.org/gc/v3 v3.0.0-20241004144649-1aea3fae8852 // indirect + modernc.org/gc/v3 v3.0.0-20241213165251-3bc300f6d0c9 // indirect modernc.org/libc v1.61.4 // indirect modernc.org/mathutil v1.6.0 // indirect modernc.org/memory v1.8.0 // indirect diff --git a/go.sum b/go.sum index 046c5235..8497b18d 100644 --- a/go.sum +++ b/go.sum @@ -214,22 +214,26 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.5 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0/go.mod h1:B9yO6b04uB80CzjedvewuqDhxJxi11s7/GtiGa8bAjI= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 h1:TT4fX+nBOA/+LUkobKGW1ydGcn+G3vRw9+g5HwCphpk= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0/go.mod h1:L7UH0GbB0p47T4Rri3uHjbpCFYrVrwc1I25QhNPiGK8= -go.opentelemetry.io/otel v1.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= -go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= -go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= -go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= -go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= -go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= +go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= +go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= +go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= +go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= +go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk= +go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0= +go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc= +go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8= +go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= +go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= gocloud.dev v0.40.0 h1:f8LgP+4WDqOG/RXoUcyLpeIAGOcAbZrZbDQCUee10ng= gocloud.dev v0.40.0/go.mod h1:drz+VyYNBvrMTW0KZiBAYEdl8lbNZx+OQ7oQvdrFmSQ= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.30.0 h1:RwoQn3GkWiMkzlX562cLB7OxWvjH1L8xutO2WoJcRoY= -golang.org/x/crypto v0.30.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= +golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= +golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= -golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= +golang.org/x/exp v0.0.0-20241215155358-4a5509556b9e h1:4qufH0hlUYs6AO6XmZC3GqfDPGSXHVXUFR6OND+iJX4= +golang.org/x/exp v0.0.0-20241215155358-4a5509556b9e/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/image v0.23.0 h1:HseQ7c2OpPKTPVzNjG5fwJsOTCiiwS4QdsYi5XU6H68= golang.org/x/image v0.23.0/go.mod h1:wJJBTdLfCCf3tiHa1fNxpZmUI4mmoZvwMCPP0ddoNKY= @@ -318,8 +322,8 @@ google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.68.1 h1:oI5oTa11+ng8r8XMMN7jAOmWfPZWbYpCFaMUTACxkM0= -google.golang.org/grpc v1.68.1/go.mod h1:+q1XYFJjShcqn0QZHvCyeR4CXPA+llXIeUIfIe00waw= +google.golang.org/grpc v1.69.0 h1:quSiOM1GJPmPH5XtU+BCoVXcDVJJAzNcoyfC2cCjGkI= +google.golang.org/grpc v1.69.0/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -348,8 +352,8 @@ modernc.org/fileutil v1.3.0 h1:gQ5SIzK3H9kdfai/5x41oQiKValumqNTDXMvKo62HvE= modernc.org/fileutil v1.3.0/go.mod h1:XatxS8fZi3pS8/hKG2GH/ArUogfxjpEKs3Ku3aK4JyQ= modernc.org/gc/v2 v2.5.0 h1:bJ9ChznK1L1mUtAQtxi0wi5AtAs5jQuw4PrPHO5pb6M= modernc.org/gc/v2 v2.5.0/go.mod h1:wzN5dK1AzVGoH6XOzc3YZ+ey/jPgYHLuVckd62P0GYU= -modernc.org/gc/v3 v3.0.0-20241004144649-1aea3fae8852 h1:IYXPPTTjjoSHvUClZIYexDiO7g+4x+XveKT4gCIAwiY= -modernc.org/gc/v3 v3.0.0-20241004144649-1aea3fae8852/go.mod h1:Qz0X07sNOR1jWYCrJMEnbW/X55x206Q7Vt4mz6/wHp4= +modernc.org/gc/v3 v3.0.0-20241213165251-3bc300f6d0c9 h1:ovz6yUKX71igz2yvk4NpiCL5fvdjZAI+DhuDEGx1xyU= +modernc.org/gc/v3 v3.0.0-20241213165251-3bc300f6d0c9/go.mod h1:Qz0X07sNOR1jWYCrJMEnbW/X55x206Q7Vt4mz6/wHp4= modernc.org/libc v1.61.4 h1:wVyqEx6tlltte9lPTjq0kDAdtdM9c4JH8rU6M1ZVawA= modernc.org/libc v1.61.4/go.mod h1:VfXVuM/Shh5XsMNrh3C6OkfL78G3loa4ZC/Ljv9k7xc= modernc.org/mathutil v1.6.0 h1:fRe9+AmYlaej+64JsEEhoWuAYBkOtQiMEU7n/XgfYi4= diff --git a/ui/.env b/ui/.env index 85bbf6c5..890720f0 100644 --- a/ui/.env +++ b/ui/.env @@ -9,4 +9,4 @@ PB_DOCS_URL = "https://pocketbase.io/docs/" PB_JS_SDK_URL = "https://github.com/pocketbase/js-sdk" PB_DART_SDK_URL = "https://github.com/pocketbase/dart-sdk" PB_RELEASES = "https://github.com/pocketbase/pocketbase/releases" -PB_VERSION = "v0.23.7" +PB_VERSION = "v0.23.8" diff --git a/ui/dist/assets/AuthMethodsDocs-DA2FbqWG.js b/ui/dist/assets/AuthMethodsDocs-LOcNuTNq.js similarity index 97% rename from ui/dist/assets/AuthMethodsDocs-DA2FbqWG.js rename to ui/dist/assets/AuthMethodsDocs-LOcNuTNq.js index ddc9058a..9dd8fec6 100644 --- a/ui/dist/assets/AuthMethodsDocs-DA2FbqWG.js +++ b/ui/dist/assets/AuthMethodsDocs-LOcNuTNq.js @@ -1,4 +1,4 @@ -import{S as Be,i as Ce,s as Te,V as Le,X as J,h as c,z as w,j as k,c as ae,k as h,n as d,o as a,m as ne,H as Q,Y as $e,Z as Se,E as je,_ as qe,G as Ee,t as z,a as I,v as u,d as ie,p as oe,J as He,l as N,q as Re,W as Ue}from"./index-rWxFAXsK.js";import{F as De}from"./FieldsQueryParam-DmBOgcIi.js";function we(n,s,l){const o=n.slice();return o[8]=s[l],o}function Me(n,s,l){const o=n.slice();return o[8]=s[l],o}function Ae(n,s){let l,o=s[8].code+"",p,b,i,f;function m(){return s[6](s[8])}return{key:n,first:null,c(){l=c("button"),p=w(o),b=k(),h(l,"class","tab-item"),N(l,"active",s[1]===s[8].code),this.first=l},m(v,y){d(v,l,y),a(l,p),a(l,b),i||(f=Re(l,"click",m),i=!0)},p(v,y){s=v,y&4&&o!==(o=s[8].code+"")&&Q(p,o),y&6&&N(l,"active",s[1]===s[8].code)},d(v){v&&u(l),i=!1,f()}}}function Pe(n,s){let l,o,p,b;return o=new Ue({props:{content:s[8].body}}),{key:n,first:null,c(){l=c("div"),ae(o.$$.fragment),p=k(),h(l,"class","tab-item"),N(l,"active",s[1]===s[8].code),this.first=l},m(i,f){d(i,l,f),ne(o,l,null),a(l,p),b=!0},p(i,f){s=i;const m={};f&4&&(m.content=s[8].body),o.$set(m),(!b||f&6)&&N(l,"active",s[1]===s[8].code)},i(i){b||(z(o.$$.fragment,i),b=!0)},o(i){I(o.$$.fragment,i),b=!1},d(i){i&&u(l),ie(o)}}}function Fe(n){var ke,ge;let s,l,o=n[0].name+"",p,b,i,f,m,v,y,g=n[0].name+"",O,ce,V,M,W,L,X,A,U,re,D,S,de,Y,F=n[0].name+"",Z,ue,K,j,x,P,ee,fe,te,T,le,q,se,B,E,$=[],me=new Map,pe,H,_=[],be=new Map,C;M=new Le({props:{js:` +import{S as Be,i as Ce,s as Te,V as Le,X as J,h as c,z as w,j as k,c as ae,k as h,n as d,o as a,m as ne,H as Q,Y as $e,Z as Se,E as je,_ as qe,G as Ee,t as z,a as I,v as u,d as ie,p as oe,J as He,l as N,q as Re,W as Ue}from"./index-C58oTbH7.js";import{F as De}from"./FieldsQueryParam-B-V1imBW.js";function we(n,s,l){const o=n.slice();return o[8]=s[l],o}function Me(n,s,l){const o=n.slice();return o[8]=s[l],o}function Ae(n,s){let l,o=s[8].code+"",p,b,i,f;function m(){return s[6](s[8])}return{key:n,first:null,c(){l=c("button"),p=w(o),b=k(),h(l,"class","tab-item"),N(l,"active",s[1]===s[8].code),this.first=l},m(v,y){d(v,l,y),a(l,p),a(l,b),i||(f=Re(l,"click",m),i=!0)},p(v,y){s=v,y&4&&o!==(o=s[8].code+"")&&Q(p,o),y&6&&N(l,"active",s[1]===s[8].code)},d(v){v&&u(l),i=!1,f()}}}function Pe(n,s){let l,o,p,b;return o=new Ue({props:{content:s[8].body}}),{key:n,first:null,c(){l=c("div"),ae(o.$$.fragment),p=k(),h(l,"class","tab-item"),N(l,"active",s[1]===s[8].code),this.first=l},m(i,f){d(i,l,f),ne(o,l,null),a(l,p),b=!0},p(i,f){s=i;const m={};f&4&&(m.content=s[8].body),o.$set(m),(!b||f&6)&&N(l,"active",s[1]===s[8].code)},i(i){b||(z(o.$$.fragment,i),b=!0)},o(i){I(o.$$.fragment,i),b=!1},d(i){i&&u(l),ie(o)}}}function Fe(n){var ke,ge;let s,l,o=n[0].name+"",p,b,i,f,m,v,y,g=n[0].name+"",O,ce,V,M,W,L,X,A,U,re,D,S,de,Y,F=n[0].name+"",Z,ue,K,j,x,P,ee,fe,te,T,le,q,se,B,E,$=[],me=new Map,pe,H,_=[],be=new Map,C;M=new Le({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${n[3]}'); diff --git a/ui/dist/assets/AuthRefreshDocs-C-YzpWeh.js b/ui/dist/assets/AuthRefreshDocs-tAKBTotE.js similarity index 98% rename from ui/dist/assets/AuthRefreshDocs-C-YzpWeh.js rename to ui/dist/assets/AuthRefreshDocs-tAKBTotE.js index b32aa283..feb85eb3 100644 --- a/ui/dist/assets/AuthRefreshDocs-C-YzpWeh.js +++ b/ui/dist/assets/AuthRefreshDocs-tAKBTotE.js @@ -1,4 +1,4 @@ -import{S as Ue,i as xe,s as Ke,V as Qe,W as Ne,X as K,h as s,z as k,j as p,c as Q,k as b,n as d,o,m as W,H as de,Y as Le,Z as We,E as Ge,_ as Ie,G as Xe,t as V,a as z,v as u,d as G,J as Oe,p as Ye,l as I,q as Ze}from"./index-rWxFAXsK.js";import{F as et}from"./FieldsQueryParam-DmBOgcIi.js";function Ve(r,a,l){const n=r.slice();return n[5]=a[l],n}function ze(r,a,l){const n=r.slice();return n[5]=a[l],n}function je(r,a){let l,n=a[5].code+"",m,_,i,h;function g(){return a[4](a[5])}return{key:r,first:null,c(){l=s("button"),m=k(n),_=p(),b(l,"class","tab-item"),I(l,"active",a[1]===a[5].code),this.first=l},m(v,w){d(v,l,w),o(l,m),o(l,_),i||(h=Ze(l,"click",g),i=!0)},p(v,w){a=v,w&4&&n!==(n=a[5].code+"")&&de(m,n),w&6&&I(l,"active",a[1]===a[5].code)},d(v){v&&u(l),i=!1,h()}}}function Je(r,a){let l,n,m,_;return n=new Ne({props:{content:a[5].body}}),{key:r,first:null,c(){l=s("div"),Q(n.$$.fragment),m=p(),b(l,"class","tab-item"),I(l,"active",a[1]===a[5].code),this.first=l},m(i,h){d(i,l,h),W(n,l,null),o(l,m),_=!0},p(i,h){a=i;const g={};h&4&&(g.content=a[5].body),n.$set(g),(!_||h&6)&&I(l,"active",a[1]===a[5].code)},i(i){_||(V(n.$$.fragment,i),_=!0)},o(i){z(n.$$.fragment,i),_=!1},d(i){i&&u(l),G(n)}}}function tt(r){var De,Fe;let a,l,n=r[0].name+"",m,_,i,h,g,v,w,B,X,S,j,ue,J,M,pe,Y,N=r[0].name+"",Z,he,fe,U,ee,D,te,T,oe,be,F,C,ae,me,le,_e,f,ke,P,ge,ve,$e,se,ye,ne,Se,we,Te,re,Ce,Re,q,ie,H,ce,R,E,y=[],Pe=new Map,qe,L,$=[],Ae=new Map,A;v=new Qe({props:{js:` +import{S as Ue,i as xe,s as Ke,V as Qe,W as Ne,X as K,h as s,z as k,j as p,c as Q,k as b,n as d,o,m as W,H as de,Y as Le,Z as We,E as Ge,_ as Ie,G as Xe,t as V,a as z,v as u,d as G,J as Oe,p as Ye,l as I,q as Ze}from"./index-C58oTbH7.js";import{F as et}from"./FieldsQueryParam-B-V1imBW.js";function Ve(r,a,l){const n=r.slice();return n[5]=a[l],n}function ze(r,a,l){const n=r.slice();return n[5]=a[l],n}function je(r,a){let l,n=a[5].code+"",m,_,i,h;function g(){return a[4](a[5])}return{key:r,first:null,c(){l=s("button"),m=k(n),_=p(),b(l,"class","tab-item"),I(l,"active",a[1]===a[5].code),this.first=l},m(v,w){d(v,l,w),o(l,m),o(l,_),i||(h=Ze(l,"click",g),i=!0)},p(v,w){a=v,w&4&&n!==(n=a[5].code+"")&&de(m,n),w&6&&I(l,"active",a[1]===a[5].code)},d(v){v&&u(l),i=!1,h()}}}function Je(r,a){let l,n,m,_;return n=new Ne({props:{content:a[5].body}}),{key:r,first:null,c(){l=s("div"),Q(n.$$.fragment),m=p(),b(l,"class","tab-item"),I(l,"active",a[1]===a[5].code),this.first=l},m(i,h){d(i,l,h),W(n,l,null),o(l,m),_=!0},p(i,h){a=i;const g={};h&4&&(g.content=a[5].body),n.$set(g),(!_||h&6)&&I(l,"active",a[1]===a[5].code)},i(i){_||(V(n.$$.fragment,i),_=!0)},o(i){z(n.$$.fragment,i),_=!1},d(i){i&&u(l),G(n)}}}function tt(r){var De,Fe;let a,l,n=r[0].name+"",m,_,i,h,g,v,w,B,X,S,j,ue,J,M,pe,Y,N=r[0].name+"",Z,he,fe,U,ee,D,te,T,oe,be,F,C,ae,me,le,_e,f,ke,P,ge,ve,$e,se,ye,ne,Se,we,Te,re,Ce,Re,q,ie,H,ce,R,E,y=[],Pe=new Map,qe,L,$=[],Ae=new Map,A;v=new Qe({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${r[3]}'); diff --git a/ui/dist/assets/AuthWithOAuth2Docs-B4NAwTzv.js b/ui/dist/assets/AuthWithOAuth2Docs-Bjy57_lX.js similarity index 98% rename from ui/dist/assets/AuthWithOAuth2Docs-B4NAwTzv.js rename to ui/dist/assets/AuthWithOAuth2Docs-Bjy57_lX.js index 28666603..30a2a3fd 100644 --- a/ui/dist/assets/AuthWithOAuth2Docs-B4NAwTzv.js +++ b/ui/dist/assets/AuthWithOAuth2Docs-Bjy57_lX.js @@ -1,4 +1,4 @@ -import{S as Ee,i as Je,s as xe,V as ze,W as Ve,X as Q,h as o,z as _,j as h,c as G,k as p,n as r,o as a,m as I,H as pe,Y as Ue,Z as Ne,E as Qe,_ as Ge,G as Ie,t as V,a as E,v as c,d as K,J as Be,p as Ke,l as X,q as Xe}from"./index-rWxFAXsK.js";import{F as Ye}from"./FieldsQueryParam-DmBOgcIi.js";function Fe(s,l,n){const i=s.slice();return i[5]=l[n],i}function He(s,l,n){const i=s.slice();return i[5]=l[n],i}function Le(s,l){let n,i=l[5].code+"",f,g,d,b;function k(){return l[4](l[5])}return{key:s,first:null,c(){n=o("button"),f=_(i),g=h(),p(n,"class","tab-item"),X(n,"active",l[1]===l[5].code),this.first=n},m(v,O){r(v,n,O),a(n,f),a(n,g),d||(b=Xe(n,"click",k),d=!0)},p(v,O){l=v,O&4&&i!==(i=l[5].code+"")&&pe(f,i),O&6&&X(n,"active",l[1]===l[5].code)},d(v){v&&c(n),d=!1,b()}}}function je(s,l){let n,i,f,g;return i=new Ve({props:{content:l[5].body}}),{key:s,first:null,c(){n=o("div"),G(i.$$.fragment),f=h(),p(n,"class","tab-item"),X(n,"active",l[1]===l[5].code),this.first=n},m(d,b){r(d,n,b),I(i,n,null),a(n,f),g=!0},p(d,b){l=d;const k={};b&4&&(k.content=l[5].body),i.$set(k),(!g||b&6)&&X(n,"active",l[1]===l[5].code)},i(d){g||(V(i.$$.fragment,d),g=!0)},o(d){E(i.$$.fragment,d),g=!1},d(d){d&&c(n),K(i)}}}function Ze(s){let l,n,i=s[0].name+"",f,g,d,b,k,v,O,D,Y,A,J,be,x,P,me,Z,z=s[0].name+"",ee,fe,te,M,ae,W,le,U,ne,y,oe,ge,B,S,se,_e,ie,ke,m,ve,C,we,$e,Oe,re,Ae,ce,ye,Se,Te,de,Ce,qe,q,ue,F,he,T,H,$=[],Re=new Map,De,L,w=[],Pe=new Map,R;v=new ze({props:{js:` +import{S as Ee,i as Je,s as xe,V as ze,W as Ve,X as Q,h as o,z as _,j as h,c as G,k as p,n as r,o as a,m as I,H as pe,Y as Ue,Z as Ne,E as Qe,_ as Ge,G as Ie,t as V,a as E,v as c,d as K,J as Be,p as Ke,l as X,q as Xe}from"./index-C58oTbH7.js";import{F as Ye}from"./FieldsQueryParam-B-V1imBW.js";function Fe(s,l,n){const i=s.slice();return i[5]=l[n],i}function He(s,l,n){const i=s.slice();return i[5]=l[n],i}function Le(s,l){let n,i=l[5].code+"",f,g,d,b;function k(){return l[4](l[5])}return{key:s,first:null,c(){n=o("button"),f=_(i),g=h(),p(n,"class","tab-item"),X(n,"active",l[1]===l[5].code),this.first=n},m(v,O){r(v,n,O),a(n,f),a(n,g),d||(b=Xe(n,"click",k),d=!0)},p(v,O){l=v,O&4&&i!==(i=l[5].code+"")&&pe(f,i),O&6&&X(n,"active",l[1]===l[5].code)},d(v){v&&c(n),d=!1,b()}}}function je(s,l){let n,i,f,g;return i=new Ve({props:{content:l[5].body}}),{key:s,first:null,c(){n=o("div"),G(i.$$.fragment),f=h(),p(n,"class","tab-item"),X(n,"active",l[1]===l[5].code),this.first=n},m(d,b){r(d,n,b),I(i,n,null),a(n,f),g=!0},p(d,b){l=d;const k={};b&4&&(k.content=l[5].body),i.$set(k),(!g||b&6)&&X(n,"active",l[1]===l[5].code)},i(d){g||(V(i.$$.fragment,d),g=!0)},o(d){E(i.$$.fragment,d),g=!1},d(d){d&&c(n),K(i)}}}function Ze(s){let l,n,i=s[0].name+"",f,g,d,b,k,v,O,D,Y,A,J,be,x,P,me,Z,z=s[0].name+"",ee,fe,te,M,ae,W,le,U,ne,y,oe,ge,B,S,se,_e,ie,ke,m,ve,C,we,$e,Oe,re,Ae,ce,ye,Se,Te,de,Ce,qe,q,ue,F,he,T,H,$=[],Re=new Map,De,L,w=[],Pe=new Map,R;v=new ze({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${s[3]}'); diff --git a/ui/dist/assets/AuthWithOtpDocs-DxxNDAWv.js b/ui/dist/assets/AuthWithOtpDocs-qA-H_yTO.js similarity index 99% rename from ui/dist/assets/AuthWithOtpDocs-DxxNDAWv.js rename to ui/dist/assets/AuthWithOtpDocs-qA-H_yTO.js index ca06092c..1f540466 100644 --- a/ui/dist/assets/AuthWithOtpDocs-DxxNDAWv.js +++ b/ui/dist/assets/AuthWithOtpDocs-qA-H_yTO.js @@ -1,4 +1,4 @@ -import{S as ee,i as te,s as le,X as U,h as p,j as S,z as H,k as g,n as b,o as h,H as X,Y as Z,Z as ge,E as Q,_ as ke,G as x,t as J,a as L,v as _,J as oe,l as Y,q as ae,W as we,c as F,m as G,d as K,V as $e,$ as se,p as Te,a0 as ne}from"./index-rWxFAXsK.js";function ie(s,t,e){const a=s.slice();return a[4]=t[e],a}function ce(s,t,e){const a=s.slice();return a[4]=t[e],a}function re(s,t){let e,a=t[4].code+"",d,c,r,n;function u(){return t[3](t[4])}return{key:s,first:null,c(){e=p("button"),d=H(a),c=S(),g(e,"class","tab-item"),Y(e,"active",t[1]===t[4].code),this.first=e},m(m,y){b(m,e,y),h(e,d),h(e,c),r||(n=ae(e,"click",u),r=!0)},p(m,y){t=m,y&4&&a!==(a=t[4].code+"")&&X(d,a),y&6&&Y(e,"active",t[1]===t[4].code)},d(m){m&&_(e),r=!1,n()}}}function de(s,t){let e,a,d,c;return a=new we({props:{content:t[4].body}}),{key:s,first:null,c(){e=p("div"),F(a.$$.fragment),d=S(),g(e,"class","tab-item"),Y(e,"active",t[1]===t[4].code),this.first=e},m(r,n){b(r,e,n),G(a,e,null),h(e,d),c=!0},p(r,n){t=r;const u={};n&4&&(u.content=t[4].body),a.$set(u),(!c||n&6)&&Y(e,"active",t[1]===t[4].code)},i(r){c||(J(a.$$.fragment,r),c=!0)},o(r){L(a.$$.fragment,r),c=!1},d(r){r&&_(e),K(a)}}}function Pe(s){let t,e,a,d,c,r,n,u=s[0].name+"",m,y,M,C,B,A,V,R,W,q,P,w=[],$=new Map,E,D,k=[],N=new Map,I,i=U(s[2]);const v=l=>l[4].code;for(let l=0;ll[4].code;for(let l=0;lParam Type Description
Required otpId
String The id of the OTP request.
Required password
String The one-time password.',V=S(),R=p("div"),R.textContent="Responses",W=S(),q=p("div"),P=p("div");for(let l=0;le(1,d=n.code);return s.$$set=n=>{"collection"in n&&e(0,a=n.collection)},s.$$.update=()=>{s.$$.dirty&1&&e(2,c=[{code:200,body:JSON.stringify({token:"JWT_TOKEN",record:oe.dummyCollectionRecord(a)},null,2)},{code:400,body:` +import{S as ee,i as te,s as le,X as U,h as p,j as S,z as H,k as g,n as b,o as h,H as X,Y as Z,Z as ge,E as Q,_ as ke,G as x,t as J,a as L,v as _,J as oe,l as Y,q as ae,W as we,c as F,m as G,d as K,V as $e,$ as se,p as Te,a0 as ne}from"./index-C58oTbH7.js";function ie(s,t,e){const a=s.slice();return a[4]=t[e],a}function ce(s,t,e){const a=s.slice();return a[4]=t[e],a}function re(s,t){let e,a=t[4].code+"",d,c,r,n;function u(){return t[3](t[4])}return{key:s,first:null,c(){e=p("button"),d=H(a),c=S(),g(e,"class","tab-item"),Y(e,"active",t[1]===t[4].code),this.first=e},m(m,y){b(m,e,y),h(e,d),h(e,c),r||(n=ae(e,"click",u),r=!0)},p(m,y){t=m,y&4&&a!==(a=t[4].code+"")&&X(d,a),y&6&&Y(e,"active",t[1]===t[4].code)},d(m){m&&_(e),r=!1,n()}}}function de(s,t){let e,a,d,c;return a=new we({props:{content:t[4].body}}),{key:s,first:null,c(){e=p("div"),F(a.$$.fragment),d=S(),g(e,"class","tab-item"),Y(e,"active",t[1]===t[4].code),this.first=e},m(r,n){b(r,e,n),G(a,e,null),h(e,d),c=!0},p(r,n){t=r;const u={};n&4&&(u.content=t[4].body),a.$set(u),(!c||n&6)&&Y(e,"active",t[1]===t[4].code)},i(r){c||(J(a.$$.fragment,r),c=!0)},o(r){L(a.$$.fragment,r),c=!1},d(r){r&&_(e),K(a)}}}function Pe(s){let t,e,a,d,c,r,n,u=s[0].name+"",m,y,M,C,B,A,V,R,W,q,P,w=[],$=new Map,E,D,k=[],N=new Map,I,i=U(s[2]);const v=l=>l[4].code;for(let l=0;ll[4].code;for(let l=0;lParam Type Description
Required otpId
String The id of the OTP request.
Required password
String The one-time password.',V=S(),R=p("div"),R.textContent="Responses",W=S(),q=p("div"),P=p("div");for(let l=0;le(1,d=n.code);return s.$$set=n=>{"collection"in n&&e(0,a=n.collection)},s.$$.update=()=>{s.$$.dirty&1&&e(2,c=[{code:200,body:JSON.stringify({token:"JWT_TOKEN",record:oe.dummyCollectionRecord(a)},null,2)},{code:400,body:` { "code": 400, "message": "Failed to authenticate.", diff --git a/ui/dist/assets/AuthWithPasswordDocs-B5NyrXaF.js b/ui/dist/assets/AuthWithPasswordDocs-p2UV8l8M.js similarity index 98% rename from ui/dist/assets/AuthWithPasswordDocs-B5NyrXaF.js rename to ui/dist/assets/AuthWithPasswordDocs-p2UV8l8M.js index f7fa0b80..cafb8adf 100644 --- a/ui/dist/assets/AuthWithPasswordDocs-B5NyrXaF.js +++ b/ui/dist/assets/AuthWithPasswordDocs-p2UV8l8M.js @@ -1,4 +1,4 @@ -import{S as kt,i as gt,s as vt,V as St,X as B,W as _t,h as s,z as f,j as u,c as ae,k,n as c,o as t,m as oe,H as X,Y as ct,Z as wt,E as yt,_ as $t,G as Pt,t as G,a as K,v as d,d as se,$ as Rt,J as dt,p as Ct,l as ne,q as Ot}from"./index-rWxFAXsK.js";import{F as Tt}from"./FieldsQueryParam-DmBOgcIi.js";function pt(i,o,a){const n=i.slice();return n[7]=o[a],n}function ut(i,o,a){const n=i.slice();return n[7]=o[a],n}function ht(i,o,a){const n=i.slice();return n[12]=o[a],n[14]=a,n}function At(i){let o;return{c(){o=f("or")},m(a,n){c(a,o,n)},d(a){a&&d(o)}}}function bt(i){let o,a,n=i[12]+"",m,b=i[14]>0&&At();return{c(){b&&b.c(),o=u(),a=s("strong"),m=f(n)},m(r,h){b&&b.m(r,h),c(r,o,h),c(r,a,h),t(a,m)},p(r,h){h&2&&n!==(n=r[12]+"")&&X(m,n)},d(r){r&&(d(o),d(a)),b&&b.d(r)}}}function ft(i,o){let a,n=o[7].code+"",m,b,r,h;function g(){return o[6](o[7])}return{key:i,first:null,c(){a=s("button"),m=f(n),b=u(),k(a,"class","tab-item"),ne(a,"active",o[2]===o[7].code),this.first=a},m($,_){c($,a,_),t(a,m),t(a,b),r||(h=Ot(a,"click",g),r=!0)},p($,_){o=$,_&8&&n!==(n=o[7].code+"")&&X(m,n),_&12&&ne(a,"active",o[2]===o[7].code)},d($){$&&d(a),r=!1,h()}}}function mt(i,o){let a,n,m,b;return n=new _t({props:{content:o[7].body}}),{key:i,first:null,c(){a=s("div"),ae(n.$$.fragment),m=u(),k(a,"class","tab-item"),ne(a,"active",o[2]===o[7].code),this.first=a},m(r,h){c(r,a,h),oe(n,a,null),t(a,m),b=!0},p(r,h){o=r;const g={};h&8&&(g.content=o[7].body),n.$set(g),(!b||h&12)&&ne(a,"active",o[2]===o[7].code)},i(r){b||(G(n.$$.fragment,r),b=!0)},o(r){K(n.$$.fragment,r),b=!1},d(r){r&&d(a),se(n)}}}function Dt(i){var ot,st;let o,a,n=i[0].name+"",m,b,r,h,g,$,_,Z=i[1].join("/")+"",ie,De,re,We,ce,R,de,H,pe,C,x,Fe,ee,L,Me,ue,te=i[0].name+"",he,Ue,be,j,fe,O,me,qe,Y,T,_e,Be,ke,He,E,ge,Le,ve,Se,V,we,A,ye,je,N,D,$e,Ye,Pe,Ee,v,Ve,M,Ne,Je,Ie,Re,Qe,Ce,ze,Ge,Ke,Oe,Xe,Ze,U,Te,J,Ae,W,I,P=[],xe=new Map,et,Q,w=[],tt=new Map,F;R=new St({props:{js:` +import{S as kt,i as gt,s as vt,V as St,X as B,W as _t,h as s,z as f,j as u,c as ae,k,n as c,o as t,m as oe,H as X,Y as ct,Z as wt,E as yt,_ as $t,G as Pt,t as G,a as K,v as d,d as se,$ as Rt,J as dt,p as Ct,l as ne,q as Ot}from"./index-C58oTbH7.js";import{F as Tt}from"./FieldsQueryParam-B-V1imBW.js";function pt(i,o,a){const n=i.slice();return n[7]=o[a],n}function ut(i,o,a){const n=i.slice();return n[7]=o[a],n}function ht(i,o,a){const n=i.slice();return n[12]=o[a],n[14]=a,n}function At(i){let o;return{c(){o=f("or")},m(a,n){c(a,o,n)},d(a){a&&d(o)}}}function bt(i){let o,a,n=i[12]+"",m,b=i[14]>0&&At();return{c(){b&&b.c(),o=u(),a=s("strong"),m=f(n)},m(r,h){b&&b.m(r,h),c(r,o,h),c(r,a,h),t(a,m)},p(r,h){h&2&&n!==(n=r[12]+"")&&X(m,n)},d(r){r&&(d(o),d(a)),b&&b.d(r)}}}function ft(i,o){let a,n=o[7].code+"",m,b,r,h;function g(){return o[6](o[7])}return{key:i,first:null,c(){a=s("button"),m=f(n),b=u(),k(a,"class","tab-item"),ne(a,"active",o[2]===o[7].code),this.first=a},m($,_){c($,a,_),t(a,m),t(a,b),r||(h=Ot(a,"click",g),r=!0)},p($,_){o=$,_&8&&n!==(n=o[7].code+"")&&X(m,n),_&12&&ne(a,"active",o[2]===o[7].code)},d($){$&&d(a),r=!1,h()}}}function mt(i,o){let a,n,m,b;return n=new _t({props:{content:o[7].body}}),{key:i,first:null,c(){a=s("div"),ae(n.$$.fragment),m=u(),k(a,"class","tab-item"),ne(a,"active",o[2]===o[7].code),this.first=a},m(r,h){c(r,a,h),oe(n,a,null),t(a,m),b=!0},p(r,h){o=r;const g={};h&8&&(g.content=o[7].body),n.$set(g),(!b||h&12)&&ne(a,"active",o[2]===o[7].code)},i(r){b||(G(n.$$.fragment,r),b=!0)},o(r){K(n.$$.fragment,r),b=!1},d(r){r&&d(a),se(n)}}}function Dt(i){var ot,st;let o,a,n=i[0].name+"",m,b,r,h,g,$,_,Z=i[1].join("/")+"",ie,De,re,We,ce,R,de,H,pe,C,x,Fe,ee,L,Me,ue,te=i[0].name+"",he,Ue,be,j,fe,O,me,qe,Y,T,_e,Be,ke,He,E,ge,Le,ve,Se,V,we,A,ye,je,N,D,$e,Ye,Pe,Ee,v,Ve,M,Ne,Je,Ie,Re,Qe,Ce,ze,Ge,Ke,Oe,Xe,Ze,U,Te,J,Ae,W,I,P=[],xe=new Map,et,Q,w=[],tt=new Map,F;R=new St({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${i[5]}'); diff --git a/ui/dist/assets/BatchApiDocs-DLDzErZQ.js b/ui/dist/assets/BatchApiDocs-D2OLD1A6.js similarity index 99% rename from ui/dist/assets/BatchApiDocs-DLDzErZQ.js rename to ui/dist/assets/BatchApiDocs-D2OLD1A6.js index 08874d1e..141d6c0d 100644 --- a/ui/dist/assets/BatchApiDocs-DLDzErZQ.js +++ b/ui/dist/assets/BatchApiDocs-D2OLD1A6.js @@ -1,4 +1,4 @@ -import{S as St,i as Lt,s as jt,V as At,W as It,X as Z,h as o,z as _,j as i,c as Re,k as b,n as d,o as t,m as Te,C as Mt,D as Nt,H as Ut,Y as Pt,Z as zt,E as Jt,_ as Wt,G as Gt,t as Q,a as x,v as u,d as Pe,J as Ft,p as Kt,l as ee,q as Vt}from"./index-rWxFAXsK.js";function Bt(a,s,n){const c=a.slice();return c[6]=s[n],c}function Et(a,s,n){const c=a.slice();return c[6]=s[n],c}function Ot(a,s){let n,c,y;function f(){return s[5](s[6])}return{key:a,first:null,c(){n=o("button"),n.textContent=`${s[6].code} `,b(n,"class","tab-item"),ee(n,"active",s[1]===s[6].code),this.first=n},m(r,h){d(r,n,h),c||(y=Vt(n,"click",f),c=!0)},p(r,h){s=r,h&10&&ee(n,"active",s[1]===s[6].code)},d(r){r&&u(n),c=!1,y()}}}function Ht(a,s){let n,c,y,f;return c=new It({props:{content:s[6].body}}),{key:a,first:null,c(){n=o("div"),Re(c.$$.fragment),y=i(),b(n,"class","tab-item"),ee(n,"active",s[1]===s[6].code),this.first=n},m(r,h){d(r,n,h),Te(c,n,null),t(n,y),f=!0},p(r,h){s=r,(!f||h&10)&&ee(n,"active",s[1]===s[6].code)},i(r){f||(Q(c.$$.fragment,r),f=!0)},o(r){x(c.$$.fragment,r),f=!1},d(r){r&&u(n),Pe(c)}}}function Xt(a){var pt,mt,bt,ht,ft,_t,yt,kt;let s,n,c=a[0].name+"",y,f,r,h,F,g,U,Fe,P,B,Be,E,Ee,Oe,te,le,q,oe,O,ae,H,se,I,ne,z,ie,w,ce,He,re,S,J,Ie,k,W,Se,de,Le,C,G,je,ue,Ae,K,Me,pe,Ne,D,Ue,me,ze,Je,We,V,Ge,X,Ke,be,Ve,he,Xe,fe,Ye,p,_e,Ze,ye,Qe,ke,xe,$e,et,ge,tt,ve,lt,ot,at,Ce,st,R,De,L,qe,T,j,v=[],nt=new Map,it,A,$=[],ct=new Map,M,we,rt;q=new At({props:{js:` +import{S as St,i as Lt,s as jt,V as At,W as It,X as Z,h as o,z as _,j as i,c as Re,k as b,n as d,o as t,m as Te,C as Mt,D as Nt,H as Ut,Y as Pt,Z as zt,E as Jt,_ as Wt,G as Gt,t as Q,a as x,v as u,d as Pe,J as Ft,p as Kt,l as ee,q as Vt}from"./index-C58oTbH7.js";function Bt(a,s,n){const c=a.slice();return c[6]=s[n],c}function Et(a,s,n){const c=a.slice();return c[6]=s[n],c}function Ot(a,s){let n,c,y;function f(){return s[5](s[6])}return{key:a,first:null,c(){n=o("button"),n.textContent=`${s[6].code} `,b(n,"class","tab-item"),ee(n,"active",s[1]===s[6].code),this.first=n},m(r,h){d(r,n,h),c||(y=Vt(n,"click",f),c=!0)},p(r,h){s=r,h&10&&ee(n,"active",s[1]===s[6].code)},d(r){r&&u(n),c=!1,y()}}}function Ht(a,s){let n,c,y,f;return c=new It({props:{content:s[6].body}}),{key:a,first:null,c(){n=o("div"),Re(c.$$.fragment),y=i(),b(n,"class","tab-item"),ee(n,"active",s[1]===s[6].code),this.first=n},m(r,h){d(r,n,h),Te(c,n,null),t(n,y),f=!0},p(r,h){s=r,(!f||h&10)&&ee(n,"active",s[1]===s[6].code)},i(r){f||(Q(c.$$.fragment,r),f=!0)},o(r){x(c.$$.fragment,r),f=!1},d(r){r&&u(n),Pe(c)}}}function Xt(a){var pt,mt,bt,ht,ft,_t,yt,kt;let s,n,c=a[0].name+"",y,f,r,h,F,g,U,Fe,P,B,Be,E,Ee,Oe,te,le,q,oe,O,ae,H,se,I,ne,z,ie,w,ce,He,re,S,J,Ie,k,W,Se,de,Le,C,G,je,ue,Ae,K,Me,pe,Ne,D,Ue,me,ze,Je,We,V,Ge,X,Ke,be,Ve,he,Xe,fe,Ye,p,_e,Ze,ye,Qe,ke,xe,$e,et,ge,tt,ve,lt,ot,at,Ce,st,R,De,L,qe,T,j,v=[],nt=new Map,it,A,$=[],ct=new Map,M,we,rt;q=new At({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${a[2]}'); diff --git a/ui/dist/assets/CodeEditor-B_VWhJeL.js b/ui/dist/assets/CodeEditor-B_VWhJeL.js new file mode 100644 index 00000000..91635520 --- /dev/null +++ b/ui/dist/assets/CodeEditor-B_VWhJeL.js @@ -0,0 +1,14 @@ +import{S as wt,i as Tt,s as vt,h as qt,k as Rt,a1 as OO,n as _t,I as IO,v as jt,O as Yt,T as Vt,U as Wt,Q as Ut,J as Gt,y as zt}from"./index-C58oTbH7.js";import{P as Ct,N as Et,w as At,D as Mt,x as jO,T as tO,I as YO,y as I,z as n,A as Lt,L as D,B as J,F as Y,G as K,H as VO,J as F,v as z,K as _e,M as Bt,O as Nt,Q as je,R as Ye,U as Ve,E as j,V as We,W as g,X as It,Y as Dt,b as C,e as Jt,f as Kt,g as Ft,i as Ht,j as Oa,k as ea,u as ta,l as aa,m as ra,r as ia,n as sa,o as la,c as na,d as oa,s as Qa,h as ca,a as pa,p as ha,q as DO,C as eO}from"./index-CH-gyH77.js";var JO={};class sO{constructor(O,t,a,r,s,i,l,o,c,h=0,Q){this.p=O,this.stack=t,this.state=a,this.reducePos=r,this.pos=s,this.score=i,this.buffer=l,this.bufferBase=o,this.curContext=c,this.lookAhead=h,this.parent=Q}toString(){return`[${this.stack.filter((O,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(O,t,a=0){let r=O.parser.context;return new sO(O,[],t,a,a,0,[],0,r?new KO(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(O,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=O}reduce(O){var t;let a=O>>19,r=O&65535,{parser:s}=this.p,i=this.reducePos=2e3&&!(!((t=this.p.parser.nodeSet.types[r])===null||t===void 0)&&t.isAnonymous)&&(c==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=h):this.p.lastBigReductionSizeo;)this.stack.pop();this.reduceContext(r,c)}storeNode(O,t,a,r=4,s=!1){if(O==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&i.buffer[l-4]==0&&i.buffer[l-1]>-1){if(t==a)return;if(i.buffer[l-2]>=t){i.buffer[l-2]=a;return}}}if(!s||this.pos==a)this.buffer.push(O,t,a,r);else{let i=this.buffer.length;if(i>0&&this.buffer[i-4]!=0){let l=!1;for(let o=i;o>0&&this.buffer[o-2]>a;o-=4)if(this.buffer[o-1]>=0){l=!0;break}if(l)for(;i>0&&this.buffer[i-2]>a;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4)}this.buffer[i]=O,this.buffer[i+1]=t,this.buffer[i+2]=a,this.buffer[i+3]=r}}shift(O,t,a,r){if(O&131072)this.pushState(O&65535,this.pos);else if(O&262144)this.pos=r,this.shiftContext(t,a),t<=this.p.parser.maxNode&&this.buffer.push(t,a,r,4);else{let s=O,{parser:i}=this.p;(r>this.pos||t<=i.maxNode)&&(this.pos=r,i.stateFlag(s,1)||(this.reducePos=r)),this.pushState(s,a),this.shiftContext(t,a),t<=i.maxNode&&this.buffer.push(t,a,r,4)}}apply(O,t,a,r){O&65536?this.reduce(O):this.shift(O,t,a,r)}useNode(O,t){let a=this.p.reused.length-1;(a<0||this.p.reused[a]!=O)&&(this.p.reused.push(O),a++);let r=this.pos;this.reducePos=this.pos=r+O.length,this.pushState(t,r),this.buffer.push(a,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,O,this,this.p.stream.reset(this.pos-O.length)))}split(){let O=this,t=O.buffer.length;for(;t>0&&O.buffer[t-2]>O.reducePos;)t-=4;let a=O.buffer.slice(t),r=O.bufferBase+t;for(;O&&r==O.bufferBase;)O=O.parent;return new sO(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,a,r,this.curContext,this.lookAhead,O)}recoverByDelete(O,t){let a=O<=this.p.parser.maxNode;a&&this.storeNode(O,this.pos,t,4),this.storeNode(0,this.pos,t,a?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(O){for(let t=new ua(this);;){let a=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,O);if(a==0)return!1;if(!(a&65536))return!0;t.reduce(a)}}recoverByInsert(O){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let r=[];for(let s=0,i;so&1&&l==i)||r.push(t[s],i)}t=r}let a=[];for(let r=0;r>19,r=t&65535,s=this.stack.length-a*3;if(s<0||O.getGoto(this.stack[s],r,!1)<0){let i=this.findForcedReduction();if(i==null)return!1;t=i}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:O}=this.p,t=[],a=(r,s)=>{if(!t.includes(r))return t.push(r),O.allActions(r,i=>{if(!(i&393216))if(i&65536){let l=(i>>19)-s;if(l>1){let o=i&65535,c=this.stack.length-l*3;if(c>=0&&O.getGoto(this.stack[c],o,!1)>=0)return l<<19|65536|o}}else{let l=a(i,s+1);if(l!=null)return l}})};return a(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:O}=this.p;return O.data[O.stateSlot(this.state,1)]==65535&&!O.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(O){if(this.state!=O.state||this.stack.length!=O.stack.length)return!1;for(let t=0;tthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=O)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class KO{constructor(O,t){this.tracker=O,this.context=t,this.hash=O.strict?O.hash(t):0}}class ua{constructor(O){this.start=O,this.state=O.state,this.stack=O.stack,this.base=this.stack.length}reduce(O){let t=O&65535,a=O>>19;a==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(a-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}}class lO{constructor(O,t,a){this.stack=O,this.pos=t,this.index=a,this.buffer=O.buffer,this.index==0&&this.maybeNext()}static create(O,t=O.bufferBase+O.buffer.length){return new lO(O,t,t-O.bufferBase)}maybeNext(){let O=this.stack.parent;O!=null&&(this.index=this.stack.bufferBase-O.bufferBase,this.stack=O,this.buffer=O.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new lO(this.stack,this.pos,this.index)}}function M(e,O=Uint16Array){if(typeof e!="string")return e;let t=null;for(let a=0,r=0;a=92&&i--,i>=34&&i--;let o=i-32;if(o>=46&&(o-=46,l=!0),s+=o,l)break;s*=46}t?t[r++]=s:t=new O(s)}return t}class aO{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const FO=new aO;class da{constructor(O,t){this.input=O,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=FO,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(O,t){let a=this.range,r=this.rangeIndex,s=this.pos+O;for(;sa.to:s>=a.to;){if(r==this.ranges.length-1)return null;let i=this.ranges[++r];s+=i.from-a.to,a=i}return s}clipPos(O){if(O>=this.range.from&&OO)return Math.max(O,t.from);return this.end}peek(O){let t=this.chunkOff+O,a,r;if(t>=0&&t=this.chunk2Pos&&al.to&&(this.chunk2=this.chunk2.slice(0,l.to-a)),r=this.chunk2.charCodeAt(0)}}return a>=this.token.lookAhead&&(this.token.lookAhead=a+1),r}acceptToken(O,t=0){let a=t?this.resolveOffset(t,-1):this.pos;if(a==null||a=this.chunk2Pos&&this.posthis.range.to?O.slice(0,this.range.to-this.pos):O,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(O=1){for(this.chunkOff+=O;this.pos+O>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();O-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=O,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(O,t){if(t?(this.token=t,t.start=O,t.lookAhead=O+1,t.value=t.extended=-1):this.token=FO,this.pos!=O){if(this.pos=O,O==this.end)return this.setDone(),this;for(;O=this.range.to;)this.range=this.ranges[++this.rangeIndex];O>=this.chunkPos&&O=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(O-this.chunkPos,t-this.chunkPos);if(O>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(O-this.chunk2Pos,t-this.chunk2Pos);if(O>=this.range.from&&t<=this.range.to)return this.input.read(O,t);let a="";for(let r of this.ranges){if(r.from>=t)break;r.to>O&&(a+=this.input.read(Math.max(r.from,O),Math.min(r.to,t)))}return a}}class W{constructor(O,t){this.data=O,this.id=t}token(O,t){let{parser:a}=t.p;Ue(this.data,O,t,this.id,a.data,a.tokenPrecTable)}}W.prototype.contextual=W.prototype.fallback=W.prototype.extend=!1;class nO{constructor(O,t,a){this.precTable=t,this.elseToken=a,this.data=typeof O=="string"?M(O):O}token(O,t){let a=O.pos,r=0;for(;;){let s=O.next<0,i=O.resolveOffset(1,1);if(Ue(this.data,O,t,0,this.data,this.precTable),O.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,i==null)break;O.reset(i,O.token)}r&&(O.reset(a,O.token),O.acceptToken(this.elseToken,r))}}nO.prototype.contextual=W.prototype.fallback=W.prototype.extend=!1;class x{constructor(O,t={}){this.token=O,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function Ue(e,O,t,a,r,s){let i=0,l=1<0){let d=e[p];if(o.allows(d)&&(O.token.value==-1||O.token.value==d||fa(d,O.token.value,r,s))){O.acceptToken(d);break}}let h=O.next,Q=0,f=e[i+2];if(O.next<0&&f>Q&&e[c+f*3-3]==65535){i=e[c+f*3-1];continue O}for(;Q>1,d=c+p+(p<<1),P=e[d],S=e[d+1]||65536;if(h=S)Q=p+1;else{i=e[d+2],O.advance();continue O}}break}}function HO(e,O,t){for(let a=O,r;(r=e[a])!=65535;a++)if(r==t)return a-O;return-1}function fa(e,O,t,a){let r=HO(t,a,O);return r<0||HO(t,a,e)O)&&!a.type.isError)return t<0?Math.max(0,Math.min(a.to-1,O-25)):Math.min(e.length,Math.max(a.from+1,O+25));if(t<0?a.prevSibling():a.nextSibling())break;if(!a.parent())return t<0?0:e.length}}class $a{constructor(O,t){this.fragments=O,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let O=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(O){for(this.safeFrom=O.openStart?Oe(O.tree,O.from+O.offset,1)-O.offset:O.from,this.safeTo=O.openEnd?Oe(O.tree,O.to+O.offset,-1)-O.offset:O.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(O.tree),this.start.push(-O.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(O){if(OO)return this.nextStart=i,null;if(s instanceof tO){if(i==O){if(i=Math.max(this.safeFrom,O)&&(this.trees.push(s),this.start.push(i),this.index.push(0))}else this.index[t]++,this.nextStart=i+s.length}}}class Pa{constructor(O,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=O.tokenizers.map(a=>new aO)}getActions(O){let t=0,a=null,{parser:r}=O.p,{tokenizers:s}=r,i=r.stateSlot(O.state,3),l=O.curContext?O.curContext.hash:0,o=0;for(let c=0;cQ.end+25&&(o=Math.max(Q.lookAhead,o)),Q.value!=0)){let f=t;if(Q.extended>-1&&(t=this.addActions(O,Q.extended,Q.end,t)),t=this.addActions(O,Q.value,Q.end,t),!h.extend&&(a=Q,t>f))break}}for(;this.actions.length>t;)this.actions.pop();return o&&O.setLookAhead(o),!a&&O.pos==this.stream.end&&(a=new aO,a.value=O.p.parser.eofTerm,a.start=a.end=O.pos,t=this.addActions(O,a.value,a.end,t)),this.mainToken=a,this.actions}getMainToken(O){if(this.mainToken)return this.mainToken;let t=new aO,{pos:a,p:r}=O;return t.start=a,t.end=Math.min(a+1,r.stream.end),t.value=a==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(O,t,a){let r=this.stream.clipPos(a.pos);if(t.token(this.stream.reset(r,O),a),O.value>-1){let{parser:s}=a.p;for(let i=0;i=0&&a.p.parser.dialect.allows(l>>1)){l&1?O.extended=l>>1:O.value=l>>1;break}}}else O.value=0,O.end=this.stream.clipPos(r+1)}putAction(O,t,a,r){for(let s=0;sO.bufferLength*4?new $a(a,O.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let O=this.stacks,t=this.minStackPos,a=this.stacks=[],r,s;if(this.bigReductionCount>300&&O.length==1){let[i]=O;for(;i.forceReduce()&&i.stack.length&&i.stack[i.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let i=0;it)a.push(l);else{if(this.advanceStack(l,a,O))continue;{r||(r=[],s=[]),r.push(l);let o=this.tokens.getMainToken(l);s.push(o.value,o.end)}}break}}if(!a.length){let i=r&&ga(r);if(i)return Z&&console.log("Finish with "+this.stackID(i)),this.stackToTree(i);if(this.parser.strict)throw Z&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&r){let i=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,a);if(i)return Z&&console.log("Force-finish "+this.stackID(i)),this.stackToTree(i.forceAll())}if(this.recovering){let i=this.recovering==1?1:this.recovering*3;if(a.length>i)for(a.sort((l,o)=>o.score-l.score);a.length>i;)a.pop();a.some(l=>l.reducePos>t)&&this.recovering--}else if(a.length>1){O:for(let i=0;i500&&c.buffer.length>500)if((l.score-c.score||l.buffer.length-c.buffer.length)>0)a.splice(o--,1);else{a.splice(i--,1);continue O}}}a.length>12&&a.splice(12,a.length-12)}this.minStackPos=a[0].pos;for(let i=1;i ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return O.forceReduce()?O:null;if(this.fragments){let c=O.curContext&&O.curContext.tracker.strict,h=c?O.curContext.hash:0;for(let Q=this.fragments.nodeAt(r);Q;){let f=this.parser.nodeSet.types[Q.type.id]==Q.type?s.getGoto(O.state,Q.type.id):-1;if(f>-1&&Q.length&&(!c||(Q.prop(jO.contextHash)||0)==h))return O.useNode(Q,f),Z&&console.log(i+this.stackID(O)+` (via reuse of ${s.getName(Q.type.id)})`),!0;if(!(Q instanceof tO)||Q.children.length==0||Q.positions[0]>0)break;let p=Q.children[0];if(p instanceof tO&&Q.positions[0]==0)Q=p;else break}}let l=s.stateSlot(O.state,4);if(l>0)return O.reduce(l),Z&&console.log(i+this.stackID(O)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(O.stack.length>=8400)for(;O.stack.length>6e3&&O.forceReduce(););let o=this.tokens.getActions(O);for(let c=0;cr?t.push(d):a.push(d)}return!1}advanceFully(O,t){let a=O.pos;for(;;){if(!this.advanceStack(O,null,null))return!1;if(O.pos>a)return ee(O,t),!0}}runRecovery(O,t,a){let r=null,s=!1;for(let i=0;i ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),Z&&console.log(h+this.stackID(l)+" (restarted)"),this.advanceFully(l,a))))continue;let Q=l.split(),f=h;for(let p=0;Q.forceReduce()&&p<10&&(Z&&console.log(f+this.stackID(Q)+" (via force-reduce)"),!this.advanceFully(Q,a));p++)Z&&(f=this.stackID(Q)+" -> ");for(let p of l.recoverByInsert(o))Z&&console.log(h+this.stackID(p)+" (via recover-insert)"),this.advanceFully(p,a);this.stream.end>l.pos?(c==l.pos&&(c++,o=0),l.recoverByDelete(o,c),Z&&console.log(h+this.stackID(l)+` (via recover-delete ${this.parser.getName(o)})`),ee(l,a)):(!r||r.scoree;class Ge{constructor(O){this.start=O.start,this.shift=O.shift||dO,this.reduce=O.reduce||dO,this.reuse=O.reuse||dO,this.hash=O.hash||(()=>0),this.strict=O.strict!==!1}}class q extends Ct{constructor(O){if(super(),this.wrappers=[],O.version!=14)throw new RangeError(`Parser version (${O.version}) doesn't match runtime version (14)`);let t=O.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let l=0;lO.topRules[l][1]),r=[];for(let l=0;l=0)s(h,o,l[c++]);else{let Q=l[c+-h];for(let f=-h;f>0;f--)s(l[c++],o,Q);c++}}}this.nodeSet=new Et(t.map((l,o)=>At.define({name:o>=this.minRepeatTerm?void 0:l,id:o,props:r[o],top:a.indexOf(o)>-1,error:o==0,skipped:O.skippedNodes&&O.skippedNodes.indexOf(o)>-1}))),O.propSources&&(this.nodeSet=this.nodeSet.extend(...O.propSources)),this.strict=!1,this.bufferLength=Mt;let i=M(O.tokenData);this.context=O.context,this.specializerSpecs=O.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l=="number"?new W(i,l):l),this.topRules=O.topRules,this.dialects=O.dialects||{},this.dynamicPrecedences=O.dynamicPrecedences||null,this.tokenPrecTable=O.tokenPrec,this.termNames=O.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(O,t,a){let r=new Sa(this,O,t,a);for(let s of this.wrappers)r=s(r,O,t,a);return r}getGoto(O,t,a=!1){let r=this.goto;if(t>=r[0])return-1;for(let s=r[t+1];;){let i=r[s++],l=i&1,o=r[s++];if(l&&a)return o;for(let c=s+(i>>1);s0}validAction(O,t){return!!this.allActions(O,a=>a==t?!0:null)}allActions(O,t){let a=this.stateSlot(O,4),r=a?t(a):void 0;for(let s=this.stateSlot(O,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=T(this.data,s+2);else break;r=t(T(this.data,s+1))}return r}nextStates(O){let t=[];for(let a=this.stateSlot(O,1);;a+=3){if(this.data[a]==65535)if(this.data[a+1]==1)a=T(this.data,a+2);else break;if(!(this.data[a+2]&1)){let r=this.data[a+1];t.some((s,i)=>i&1&&s==r)||t.push(this.data[a],r)}}return t}configure(O){let t=Object.assign(Object.create(q.prototype),this);if(O.props&&(t.nodeSet=this.nodeSet.extend(...O.props)),O.top){let a=this.topRules[O.top];if(!a)throw new RangeError(`Invalid top rule name ${O.top}`);t.top=a}return O.tokenizers&&(t.tokenizers=this.tokenizers.map(a=>{let r=O.tokenizers.find(s=>s.from==a);return r?r.to:a})),O.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((a,r)=>{let s=O.specializers.find(l=>l.from==a.external);if(!s)return a;let i=Object.assign(Object.assign({},a),{external:s.to});return t.specializers[r]=te(i),i})),O.contextTracker&&(t.context=O.contextTracker),O.dialect&&(t.dialect=this.parseDialect(O.dialect)),O.strict!=null&&(t.strict=O.strict),O.wrap&&(t.wrappers=t.wrappers.concat(O.wrap)),O.bufferLength!=null&&(t.bufferLength=O.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(O){return this.termNames?this.termNames[O]:String(O<=this.maxNode&&this.nodeSet.types[O].name||O)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(O){let t=this.dynamicPrecedences;return t==null?0:t[O]||0}parseDialect(O){let t=Object.keys(this.dialects),a=t.map(()=>!1);if(O)for(let s of O.split(" ")){let i=t.indexOf(s);i>=0&&(a[i]=!0)}let r=null;for(let s=0;sa)&&t.p.parser.stateFlag(t.state,2)&&(!O||O.scoree.external(t,a)<<1|O}return e.get}const Za=54,ba=1,xa=55,ka=2,Xa=56,ya=3,ae=4,wa=5,oO=6,ze=7,Ce=8,Ee=9,Ae=10,Ta=11,va=12,qa=13,fO=57,Ra=14,re=58,Me=20,_a=22,Le=23,ja=24,XO=26,Be=27,Ya=28,Va=31,Wa=34,Ua=36,Ga=37,za=0,Ca=1,Ea={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},Aa={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},ie={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function Ma(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}function Ne(e){return e==9||e==10||e==13||e==32}let se=null,le=null,ne=0;function yO(e,O){let t=e.pos+O;if(ne==t&&le==e)return se;let a=e.peek(O);for(;Ne(a);)a=e.peek(++O);let r="";for(;Ma(a);)r+=String.fromCharCode(a),a=e.peek(++O);return le=e,ne=t,se=r?r.toLowerCase():a==La||a==Ba?void 0:null}const Ie=60,QO=62,WO=47,La=63,Ba=33,Na=45;function oe(e,O){this.name=e,this.parent=O}const Ia=[oO,Ae,ze,Ce,Ee],Da=new Ge({start:null,shift(e,O,t,a){return Ia.indexOf(O)>-1?new oe(yO(a,1)||"",e):e},reduce(e,O){return O==Me&&e?e.parent:e},reuse(e,O,t,a){let r=O.type.id;return r==oO||r==Ua?new oe(yO(a,1)||"",e):e},strict:!1}),Ja=new x((e,O)=>{if(e.next!=Ie){e.next<0&&O.context&&e.acceptToken(fO);return}e.advance();let t=e.next==WO;t&&e.advance();let a=yO(e,0);if(a===void 0)return;if(!a)return e.acceptToken(t?Ra:oO);let r=O.context?O.context.name:null;if(t){if(a==r)return e.acceptToken(Ta);if(r&&Aa[r])return e.acceptToken(fO,-2);if(O.dialectEnabled(za))return e.acceptToken(va);for(let s=O.context;s;s=s.parent)if(s.name==a)return;e.acceptToken(qa)}else{if(a=="script")return e.acceptToken(ze);if(a=="style")return e.acceptToken(Ce);if(a=="textarea")return e.acceptToken(Ee);if(Ea.hasOwnProperty(a))return e.acceptToken(Ae);r&&ie[r]&&ie[r][a]?e.acceptToken(fO,-1):e.acceptToken(oO)}},{contextual:!0}),Ka=new x(e=>{for(let O=0,t=0;;t++){if(e.next<0){t&&e.acceptToken(re);break}if(e.next==Na)O++;else if(e.next==QO&&O>=2){t>=3&&e.acceptToken(re,-2);break}else O=0;e.advance()}});function Fa(e){for(;e;e=e.parent)if(e.name=="svg"||e.name=="math")return!0;return!1}const Ha=new x((e,O)=>{if(e.next==WO&&e.peek(1)==QO){let t=O.dialectEnabled(Ca)||Fa(O.context);e.acceptToken(t?wa:ae,2)}else e.next==QO&&e.acceptToken(ae,1)});function UO(e,O,t){let a=2+e.length;return new x(r=>{for(let s=0,i=0,l=0;;l++){if(r.next<0){l&&r.acceptToken(O);break}if(s==0&&r.next==Ie||s==1&&r.next==WO||s>=2&&si?r.acceptToken(O,-i):r.acceptToken(t,-(i-2));break}else if((r.next==10||r.next==13)&&l){r.acceptToken(O,1);break}else s=i=0;r.advance()}})}const Or=UO("script",Za,ba),er=UO("style",xa,ka),tr=UO("textarea",Xa,ya),ar=I({"Text RawText":n.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":n.angleBracket,TagName:n.tagName,"MismatchedCloseTag/TagName":[n.tagName,n.invalid],AttributeName:n.attributeName,"AttributeValue UnquotedAttributeValue":n.attributeValue,Is:n.definitionOperator,"EntityReference CharacterReference":n.character,Comment:n.blockComment,ProcessingInst:n.processingInstruction,DoctypeDecl:n.documentMeta}),rr=q.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%ZQ&rO,59fO%fQ&rO,59iO%qQ&rO,59lO%|Q&rO,59nOOOa'#D^'#D^O&XOaO'#CxO&dOaO,59[OOOb'#D_'#D_O&lObO'#C{O&wObO,59[OOOd'#D`'#D`O'POdO'#DOO'[OdO,59[OOO`'#Da'#DaO'dO!rO,59[O'kQ#tO'#DROOO`,59[,59[OOOp'#Db'#DbO'pO$fO,59oOOO`,59o,59oO'xQ#|O,59qO'}Q#|O,59rOOO`-E7W-E7WO(SQ&rO'#CsOOQW'#DZ'#DZO(bQ&rO1G.wOOOa1G.w1G.wOOO`1G/Y1G/YO(mQ&rO1G/QOOOb1G/Q1G/QO(xQ&rO1G/TOOOd1G/T1G/TO)TQ&rO1G/WOOO`1G/W1G/WO)`Q&rO1G/YOOOa-E7[-E7[O)kQ#tO'#CyOOO`1G.v1G.vOOOb-E7]-E7]O)pQ#tO'#C|OOOd-E7^-E7^O)uQ#tO'#DPOOO`-E7_-E7_O)zQ#|O,59mOOOp-E7`-E7`OOO`1G/Z1G/ZOOO`1G/]1G/]OOO`1G/^1G/^O*PQ,UO,59_OOQW-E7X-E7XOOOa7+$c7+$cOOO`7+$t7+$tOOOb7+$l7+$lOOOd7+$o7+$oOOO`7+$r7+$rO*[Q#|O,59eO*aQ#|O,59hO*fQ#|O,59kOOO`1G/X1G/XO*kO7[O'#CvO*|OMhO'#CvOOQW1G.y1G.yOOO`1G/P1G/POOO`1G/S1G/SOOO`1G/V1G/VOOOO'#D['#D[O+_O7[O,59bOOQW,59b,59bOOOO'#D]'#D]O+pOMhO,59bOOOO-E7Y-E7YOOQW1G.|1G.|OOOO-E7Z-E7Z",stateData:",]~O!^OS~OUSOVPOWQOXROYTO[]O][O^^O`^Oa^Ob^Oc^Ox^O{_O!dZO~OfaO~OfbO~OfcO~OfdO~OfeO~O!WfOPlP!ZlP~O!XiOQoP!ZoP~O!YlORrP!ZrP~OUSOVPOWQOXROYTOZqO[]O][O^^O`^Oa^Ob^Oc^Ox^O!dZO~O!ZrO~P#dO![sO!euO~OfvO~OfwO~OS|OT}OhyO~OS!POT}OhyO~OS!ROT}OhyO~OS!TOT}OhyO~OS}OT}OhyO~O!WfOPlX!ZlX~OP!WO!Z!XO~O!XiOQoX!ZoX~OQ!ZO!Z!XO~O!YlORrX!ZrX~OR!]O!Z!XO~O!Z!XO~P#dOf!_O~O![sO!e!aO~OS!bO~OS!cO~Oi!dOSgXTgXhgX~OS!fOT!gOhyO~OS!hOT!gOhyO~OS!iOT!gOhyO~OS!jOT!gOhyO~OS!gOT!gOhyO~Of!kO~Of!lO~Of!mO~OS!nO~Ok!qO!`!oO!b!pO~OS!rO~OS!sO~OS!tO~Oa!uOb!uOc!uO!`!wO!a!uO~Oa!xOb!xOc!xO!b!wO!c!xO~Oa!uOb!uOc!uO!`!{O!a!uO~Oa!xOb!xOc!xO!b!{O!c!xO~OT~bac!dx{!d~",goto:"%p!`PPPPPPPPPPPPPPPPPPPP!a!gP!mPP!yP!|#P#S#Y#]#`#f#i#l#r#x!aP!a!aP$O$U$l$r$x%O%U%[%bPPPPPPPP%hX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:67,context:Da,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,21,30,33,36,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,29,32,35,37,"OpenTag"],["group",-9,14,17,18,19,20,39,40,41,42,"Entity",16,"Entity TextContent",-3,28,31,34,"TextContent Entity"],["isolate",-11,21,29,30,32,33,35,36,37,38,41,42,"ltr",-3,26,27,39,""]],propSources:[ar],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zbkWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOa!R!R7tP;=`<%l7S!Z8OYkWa!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{ihSkWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbhSkWa!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXhSa!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TakWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOb!R!RAwP;=`<%lAY!ZBRYkWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbhSkWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbhSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXhSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!bx`P!a`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYlhS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_khS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_X`P!a`!cp!eQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZhSfQ`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!a`!cpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!a`!cp!dPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!a`!cpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!a`!cpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!a`!cpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!a`!cpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!a`!cpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!a`!cpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!a`!cpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!cpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO{PP!-nP;=`<%l!-Sq!-xS!cp{POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!a`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!a`{POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!a`!cp{POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!a`!cpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!a`!cpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!a`!cpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!a`!cpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!a`!cpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!a`!cpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!cpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOxPP!7TP;=`<%l!6Vq!7]V!cpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!cpxPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!a`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!a`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!a`xPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!a`!cpxPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let c=l.type.id;if(c==Ya)return $O(l,o,t);if(c==Va)return $O(l,o,a);if(c==Wa)return $O(l,o,r);if(c==Me&&s.length){let h=l.node,Q=h.firstChild,f=Q&&Qe(Q,o),p;if(f){for(let d of s)if(d.tag==f&&(!d.attrs||d.attrs(p||(p=De(Q,o))))){let P=h.lastChild,S=P.type.id==Ga?P.from:h.to;if(S>Q.to)return{parser:d.parser,overlay:[{from:Q.to,to:S}]}}}}if(i&&c==Le){let h=l.node,Q;if(Q=h.firstChild){let f=i[o.read(Q.from,Q.to)];if(f)for(let p of f){if(p.tagName&&p.tagName!=Qe(h.parent,o))continue;let d=h.lastChild;if(d.type.id==XO){let P=d.from+1,S=d.lastChild,k=d.to-(S&&S.isError?0:1);if(k>P)return{parser:p.parser,overlay:[{from:P,to:k}]}}else if(d.type.id==Be)return{parser:p.parser,overlay:[{from:d.from,to:d.to}]}}}}return null})}const ir=99,ce=1,sr=100,lr=101,pe=2,Ke=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],nr=58,or=40,Fe=95,Qr=91,rO=45,cr=46,pr=35,hr=37,ur=38,dr=92,fr=10;function L(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function He(e){return e>=48&&e<=57}const $r=new x((e,O)=>{for(let t=!1,a=0,r=0;;r++){let{next:s}=e;if(L(s)||s==rO||s==Fe||t&&He(s))!t&&(s!=rO||r>0)&&(t=!0),a===r&&s==rO&&a++,e.advance();else if(s==dr&&e.peek(1)!=fr)e.advance(),e.next>-1&&e.advance(),t=!0;else{t&&e.acceptToken(s==or?sr:a==2&&O.canShift(pe)?pe:lr);break}}}),Pr=new x(e=>{if(Ke.includes(e.peek(-1))){let{next:O}=e;(L(O)||O==Fe||O==pr||O==cr||O==Qr||O==nr&&L(e.peek(1))||O==rO||O==ur)&&e.acceptToken(ir)}}),Sr=new x(e=>{if(!Ke.includes(e.peek(-1))){let{next:O}=e;if(O==hr&&(e.advance(),e.acceptToken(ce)),L(O)){do e.advance();while(L(e.next)||He(e.next));e.acceptToken(ce)}}}),mr=I({"AtKeyword import charset namespace keyframes media supports":n.definitionKeyword,"from to selector":n.keyword,NamespaceName:n.namespace,KeyframeName:n.labelName,KeyframeRangeName:n.operatorKeyword,TagName:n.tagName,ClassName:n.className,PseudoClassName:n.constant(n.className),IdName:n.labelName,"FeatureName PropertyName":n.propertyName,AttributeName:n.attributeName,NumberLiteral:n.number,KeywordQuery:n.keyword,UnaryQueryOp:n.operatorKeyword,"CallTag ValueName":n.atom,VariableName:n.variableName,Callee:n.operatorKeyword,Unit:n.unit,"UniversalSelector NestingSelector":n.definitionOperator,MatchOp:n.compareOperator,"ChildOp SiblingOp, LogicOp":n.logicOperator,BinOp:n.arithmeticOperator,Important:n.modifier,Comment:n.blockComment,ColorLiteral:n.color,"ParenthesizedContent StringLiteral":n.string,":":n.punctuation,"PseudoOp #":n.derefOperator,"; ,":n.separator,"( )":n.paren,"[ ]":n.squareBracket,"{ }":n.brace}),gr={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,"nth-last-of-type":32,dir:32,"host-context":32,url:60,"url-prefix":60,domain:60,regexp:60,selector:138},Zr={__proto__:null,"@import":118,"@media":142,"@charset":146,"@namespace":150,"@keyframes":156,"@supports":168},br={__proto__:null,not:132,only:132},xr=q.deserialize({version:14,states:":jQYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$_QXO'#CaO$fQ[O'#ChO$qQ[O'#DTO$vQ[O'#DWOOQP'#Em'#EmO${QdO'#DgO%jQ[O'#DtO${QdO'#DvO%{Q[O'#DxO&WQ[O'#D{O&`Q[O'#ERO&nQ[O'#ETOOQS'#El'#ElOOQS'#EW'#EWQYQ[OOO&uQXO'#CdO'jQWO'#DcO'oQWO'#EsO'zQ[O'#EsQOQWOOP(UO#tO'#C_POOO)C@[)C@[OOQP'#Cg'#CgOOQP,59Q,59QO#kQ[O,59QO(aQ[O'#E[O({QWO,58{O)TQ[O,59SO$qQ[O,59oO$vQ[O,59rO(aQ[O,59uO(aQ[O,59wO(aQ[O,59xO)`Q[O'#DbOOQS,58{,58{OOQP'#Ck'#CkOOQO'#DR'#DROOQP,59S,59SO)gQWO,59SO)lQWO,59SOOQP'#DV'#DVOOQP,59o,59oOOQO'#DX'#DXO)qQ`O,59rOOQS'#Cp'#CpO${QdO'#CqO)yQvO'#CsO+ZQtO,5:ROOQO'#Cx'#CxO)lQWO'#CwO+oQWO'#CyO+tQ[O'#DOOOQS'#Ep'#EpOOQO'#Dj'#DjO+|Q[O'#DqO,[QWO'#EtO&`Q[O'#DoO,jQWO'#DrOOQO'#Eu'#EuO)OQWO,5:`O,oQpO,5:bOOQS'#Dz'#DzO,wQWO,5:dO,|Q[O,5:dOOQO'#D}'#D}O-UQWO,5:gO-ZQWO,5:mO-cQWO,5:oOOQS-E8U-E8UO-kQdO,59}O-{Q[O'#E^O.YQWO,5;_O.YQWO,5;_POOO'#EV'#EVP.eO#tO,58yPOOO,58y,58yOOQP1G.l1G.lO/[QXO,5:vOOQO-E8Y-E8YOOQS1G.g1G.gOOQP1G.n1G.nO)gQWO1G.nO)lQWO1G.nOOQP1G/Z1G/ZO/iQ`O1G/^O0SQXO1G/aO0jQXO1G/cO1QQXO1G/dO1hQWO,59|O1mQ[O'#DSO1tQdO'#CoOOQP1G/^1G/^O${QdO1G/^O1{QpO,59]OOQS,59_,59_O${QdO,59aO2TQWO1G/mOOQS,59c,59cO2YQ!bO,59eOOQS'#DP'#DPOOQS'#EY'#EYO2eQ[O,59jOOQS,59j,59jO2mQWO'#DjO2xQWO,5:VO2}QWO,5:]O&`Q[O,5:XO&`Q[O'#E_O3VQWO,5;`O3bQWO,5:ZO(aQ[O,5:^OOQS1G/z1G/zOOQS1G/|1G/|OOQS1G0O1G0OO3sQWO1G0OO3xQdO'#EOOOQS1G0R1G0ROOQS1G0X1G0XOOQS1G0Z1G0ZO4TQtO1G/iOOQO1G/i1G/iOOQO,5:x,5:xO4kQ[O,5:xOOQO-E8[-E8[O4xQWO1G0yPOOO-E8T-E8TPOOO1G.e1G.eOOQP7+$Y7+$YOOQP7+$x7+$xO${QdO7+$xOOQS1G/h1G/hO5TQXO'#ErO5[QWO,59nO5aQtO'#EXO6XQdO'#EoO6cQWO,59ZO6hQpO7+$xOOQS1G.w1G.wOOQS1G.{1G.{OOQS7+%X7+%XOOQS1G/P1G/PO6pQWO1G/POOQS-E8W-E8WOOQS1G/U1G/UO${QdO1G/qOOQO1G/w1G/wOOQO1G/s1G/sO6uQWO,5:yOOQO-E8]-E8]O7TQXO1G/xOOQS7+%j7+%jO7[QYO'#CsOOQO'#EQ'#EQO7gQ`O'#EPOOQO'#EP'#EPO7rQWO'#E`O7zQdO,5:jOOQS,5:j,5:jO8VQtO'#E]O${QdO'#E]O9WQdO7+%TOOQO7+%T7+%TOOQO1G0d1G0dO9kQpO<OAN>OO;]QdO,5:uOOQO-E8X-E8XOOQO<T![;'S%^;'S;=`%o<%lO%^l;TUo`Oy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^l;nYo`#e[Oy%^z!Q%^!Q![;g![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^l[[o`#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^n?VSt^Oy%^z;'S%^;'S;=`%o<%lO%^l?hWjWOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^n@VU#bQOy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^~@nTjWOy%^z{@}{;'S%^;'S;=`%o<%lO%^~AUSo`#[~Oy%^z;'S%^;'S;=`%o<%lO%^lAg[#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^bBbU]QOy%^z![%^![!]Bt!];'S%^;'S;=`%o<%lO%^bB{S^Qo`Oy%^z;'S%^;'S;=`%o<%lO%^nC^S!Y^Oy%^z;'S%^;'S;=`%o<%lO%^dCoS|SOy%^z;'S%^;'S;=`%o<%lO%^bDQU!OQOy%^z!`%^!`!aDd!a;'S%^;'S;=`%o<%lO%^bDkS!OQo`Oy%^z;'S%^;'S;=`%o<%lO%^bDzWOy%^z!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bEk[![Qo`Oy%^z}%^}!OEd!O!Q%^!Q![Ed![!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^nFfSq^Oy%^z;'S%^;'S;=`%o<%lO%^nFwSp^Oy%^z;'S%^;'S;=`%o<%lO%^bGWUOy%^z#b%^#b#cGj#c;'S%^;'S;=`%o<%lO%^bGoUo`Oy%^z#W%^#W#XHR#X;'S%^;'S;=`%o<%lO%^bHYS!bQo`Oy%^z;'S%^;'S;=`%o<%lO%^bHiUOy%^z#f%^#f#gHR#g;'S%^;'S;=`%o<%lO%^fIQS!TUOy%^z;'S%^;'S;=`%o<%lO%^nIcS!S^Oy%^z;'S%^;'S;=`%o<%lO%^fItU!RQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`JZP;=`<%l$}",tokenizers:[Pr,Sr,$r,1,2,3,4,new nO("m~RRYZ[z{a~~g~aO#^~~dP!P!Qg~lO#_~~",28,105)],topRules:{StyleSheet:[0,4],Styles:[1,86]},specialized:[{term:100,get:e=>gr[e]||-1},{term:58,get:e=>Zr[e]||-1},{term:101,get:e=>br[e]||-1}],tokenPrec:1219});let PO=null;function SO(){if(!PO&&typeof document=="object"&&document.body){let{style:e}=document.body,O=[],t=new Set;for(let a in e)a!="cssText"&&a!="cssFloat"&&typeof e[a]=="string"&&(/[A-Z]/.test(a)&&(a=a.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),t.has(a)||(O.push(a),t.add(a)));PO=O.sort().map(a=>({type:"property",label:a,apply:a+": "}))}return PO||[]}const he=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(e=>({type:"class",label:e})),ue=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(e=>({type:"keyword",label:e})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(e=>({type:"constant",label:e}))),kr=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(e=>({type:"type",label:e})),Xr=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(e=>({type:"keyword",label:e})),w=/^(\w[\w-]*|-\w[\w-]*|)$/,yr=/^-(-[\w-]*)?$/;function wr(e,O){var t;if((e.name=="("||e.type.isError)&&(e=e.parent||e),e.name!="ArgList")return!1;let a=(t=e.parent)===null||t===void 0?void 0:t.firstChild;return(a==null?void 0:a.name)!="Callee"?!1:O.sliceString(a.from,a.to)=="var"}const de=new _e,Tr=["Declaration"];function vr(e){for(let O=e;;){if(O.type.isTop)return O;if(!(O=O.parent))return e}}function Ot(e,O,t){if(O.to-O.from>4096){let a=de.get(O);if(a)return a;let r=[],s=new Set,i=O.cursor(YO.IncludeAnonymous);if(i.firstChild())do for(let l of Ot(e,i.node,t))s.has(l.label)||(s.add(l.label),r.push(l));while(i.nextSibling());return de.set(O,r),r}else{let a=[],r=new Set;return O.cursor().iterate(s=>{var i;if(t(s)&&s.matchContext(Tr)&&((i=s.node.nextSibling)===null||i===void 0?void 0:i.name)==":"){let l=e.sliceString(s.from,s.to);r.has(l)||(r.add(l),a.push({label:l,type:"variable"}))}}),a}}const qr=e=>O=>{let{state:t,pos:a}=O,r=z(t).resolveInner(a,-1),s=r.type.isError&&r.from==r.to-1&&t.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:SO(),validFor:w};if(r.name=="ValueName")return{from:r.from,options:ue,validFor:w};if(r.name=="PseudoClassName")return{from:r.from,options:he,validFor:w};if(e(r)||(O.explicit||s)&&wr(r,t.doc))return{from:e(r)||s?r.from:a,options:Ot(t.doc,vr(r),e),validFor:yr};if(r.name=="TagName"){for(let{parent:o}=r;o;o=o.parent)if(o.name=="Block")return{from:r.from,options:SO(),validFor:w};return{from:r.from,options:kr,validFor:w}}if(r.name=="AtKeyword")return{from:r.from,options:Xr,validFor:w};if(!O.explicit)return null;let i=r.resolve(a),l=i.childBefore(a);return l&&l.name==":"&&i.name=="PseudoClassSelector"?{from:a,options:he,validFor:w}:l&&l.name==":"&&i.name=="Declaration"||i.name=="ArgList"?{from:a,options:ue,validFor:w}:i.name=="Block"||i.name=="Styles"?{from:a,options:SO(),validFor:w}:null},Rr=qr(e=>e.name=="VariableName"),cO=D.define({name:"css",parser:xr.configure({props:[J.add({Declaration:Y()}),K.add({"Block KeyframeList":VO})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function _r(){return new F(cO,cO.data.of({autocomplete:Rr}))}const jr=314,Yr=315,fe=1,Vr=2,Wr=3,Ur=4,Gr=316,zr=318,Cr=319,Er=5,Ar=6,Mr=0,wO=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],et=125,Lr=59,TO=47,Br=42,Nr=43,Ir=45,Dr=60,Jr=44,Kr=63,Fr=46,Hr=91,Oi=new Ge({start:!1,shift(e,O){return O==Er||O==Ar||O==zr?e:O==Cr},strict:!1}),ei=new x((e,O)=>{let{next:t}=e;(t==et||t==-1||O.context)&&e.acceptToken(Gr)},{contextual:!0,fallback:!0}),ti=new x((e,O)=>{let{next:t}=e,a;wO.indexOf(t)>-1||t==TO&&((a=e.peek(1))==TO||a==Br)||t!=et&&t!=Lr&&t!=-1&&!O.context&&e.acceptToken(jr)},{contextual:!0}),ai=new x((e,O)=>{e.next==Hr&&!O.context&&e.acceptToken(Yr)},{contextual:!0}),ri=new x((e,O)=>{let{next:t}=e;if(t==Nr||t==Ir){if(e.advance(),t==e.next){e.advance();let a=!O.context&&O.canShift(fe);e.acceptToken(a?fe:Vr)}}else t==Kr&&e.peek(1)==Fr&&(e.advance(),e.advance(),(e.next<48||e.next>57)&&e.acceptToken(Wr))},{contextual:!0});function mO(e,O){return e>=65&&e<=90||e>=97&&e<=122||e==95||e>=192||!O&&e>=48&&e<=57}const ii=new x((e,O)=>{if(e.next!=Dr||!O.dialectEnabled(Mr)||(e.advance(),e.next==TO))return;let t=0;for(;wO.indexOf(e.next)>-1;)e.advance(),t++;if(mO(e.next,!0)){for(e.advance(),t++;mO(e.next,!1);)e.advance(),t++;for(;wO.indexOf(e.next)>-1;)e.advance(),t++;if(e.next==Jr)return;for(let a=0;;a++){if(a==7){if(!mO(e.next,!0))return;break}if(e.next!="extends".charCodeAt(a))break;e.advance(),t++}}e.acceptToken(Ur,-t)}),si=I({"get set async static":n.modifier,"for while do if else switch try catch finally return throw break continue default case":n.controlKeyword,"in of await yield void typeof delete instanceof":n.operatorKeyword,"let var const using function class extends":n.definitionKeyword,"import export from":n.moduleKeyword,"with debugger as new":n.keyword,TemplateString:n.special(n.string),super:n.atom,BooleanLiteral:n.bool,this:n.self,null:n.null,Star:n.modifier,VariableName:n.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":n.function(n.variableName),VariableDefinition:n.definition(n.variableName),Label:n.labelName,PropertyName:n.propertyName,PrivatePropertyName:n.special(n.propertyName),"CallExpression/MemberExpression/PropertyName":n.function(n.propertyName),"FunctionDeclaration/VariableDefinition":n.function(n.definition(n.variableName)),"ClassDeclaration/VariableDefinition":n.definition(n.className),"NewExpression/VariableName":n.className,PropertyDefinition:n.definition(n.propertyName),PrivatePropertyDefinition:n.definition(n.special(n.propertyName)),UpdateOp:n.updateOperator,"LineComment Hashbang":n.lineComment,BlockComment:n.blockComment,Number:n.number,String:n.string,Escape:n.escape,ArithOp:n.arithmeticOperator,LogicOp:n.logicOperator,BitOp:n.bitwiseOperator,CompareOp:n.compareOperator,RegExp:n.regexp,Equals:n.definitionOperator,Arrow:n.function(n.punctuation),": Spread":n.punctuation,"( )":n.paren,"[ ]":n.squareBracket,"{ }":n.brace,"InterpolationStart InterpolationEnd":n.special(n.brace),".":n.derefOperator,", ;":n.separator,"@":n.meta,TypeName:n.typeName,TypeDefinition:n.definition(n.typeName),"type enum interface implements namespace module declare":n.definitionKeyword,"abstract global Privacy readonly override":n.modifier,"is keyof unique infer asserts":n.operatorKeyword,JSXAttributeValue:n.attributeValue,JSXText:n.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":n.angleBracket,"JSXIdentifier JSXNameSpacedName":n.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":n.attributeName,"JSXBuiltin/JSXIdentifier":n.standard(n.tagName)}),li={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,const:52,extends:56,this:60,true:68,false:68,null:80,void:84,typeof:88,super:104,new:138,delete:150,yield:159,await:163,class:168,public:231,private:231,protected:231,readonly:233,instanceof:252,satisfies:255,in:256,import:290,keyof:347,unique:351,infer:357,asserts:393,is:395,abstract:415,implements:417,type:419,let:422,var:424,using:427,interface:433,enum:437,namespace:443,module:445,declare:449,global:453,for:472,of:481,while:484,with:488,do:492,if:496,else:498,switch:502,case:508,try:514,catch:518,finally:522,return:526,throw:530,break:534,continue:538,debugger:542},ni={__proto__:null,async:125,get:127,set:129,declare:191,public:193,private:193,protected:193,static:195,abstract:197,override:199,readonly:205,accessor:207,new:399},oi={__proto__:null,"<":189},Qi=q.deserialize({version:14,states:"$EOQ%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#D_O.QQlO'#DeO.bQlO'#DpO%[QlO'#DxO0fQlO'#EQOOQ!0Lf'#EY'#EYO1PQ`O'#EVOOQO'#En'#EnOOQO'#Ij'#IjO1XQ`O'#GrO1dQ`O'#EmO1iQ`O'#EmO3hQ!0MxO'#JpO6[Q!0MxO'#JqO6uQ`O'#F[O6zQ,UO'#FsOOQ!0Lf'#Fe'#FeO7VO7dO'#FeO7eQMhO'#F{O9UQ`O'#FzOOQ!0Lf'#Jq'#JqOOQ!0Lb'#Jp'#JpO9ZQ`O'#GvOOQ['#K]'#K]O9fQ`O'#IWO9kQ!0LrO'#IXOOQ['#J^'#J^OOQ['#I]'#I]Q`QlOOQ`QlOOO9sQ!L^O'#DtO9zQlO'#D|O:RQlO'#EOO9aQ`O'#GrO:YQMhO'#CoO:hQ`O'#ElO:sQ`O'#EwO:xQMhO'#FdO;gQ`O'#GrOOQO'#K^'#K^O;lQ`O'#K^O;zQ`O'#GzO;zQ`O'#G{O;zQ`O'#G}O9aQ`O'#HQOYQ`O'#CeO>jQ`O'#HaO>rQ`O'#HgO>rQ`O'#HiO`QlO'#HkO>rQ`O'#HmO>rQ`O'#HpO>wQ`O'#HvO>|Q!0LsO'#H|O%[QlO'#IOO?XQ!0LsO'#IQO?dQ!0LsO'#ISO9kQ!0LrO'#IUO?oQ!0MxO'#CiO@qQpO'#DjQOQ`OOO%[QlO'#EOOAXQ`O'#ERO:YQMhO'#ElOAdQ`O'#ElOAoQ!bO'#FdOOQ['#Cg'#CgOOQ!0Lb'#Do'#DoOOQ!0Lb'#Jt'#JtO%[QlO'#JtOOQO'#Jw'#JwOOQO'#If'#IfOBoQpO'#EeOOQ!0Lb'#Ed'#EdOOQ!0Lb'#J{'#J{OCkQ!0MSO'#EeOCuQpO'#EUOOQO'#Jv'#JvODZQpO'#JwOEhQpO'#EUOCuQpO'#EePEuO&2DjO'#CbPOOO)CD{)CD{OOOO'#I^'#I^OFQO#tO,59UOOQ!0Lh,59U,59UOOOO'#I_'#I_OF`O&jO,59UOFnQ!L^O'#DaOOOO'#Ia'#IaOFuO#@ItO,59yOOQ!0Lf,59y,59yOGTQlO'#IbOGhQ`O'#JrOIgQ!fO'#JrO+}QlO'#JrOInQ`O,5:POJUQ`O'#EnOJcQ`O'#KROJnQ`O'#KQOJnQ`O'#KQOJvQ`O,5;[OJ{Q`O'#KPOOQ!0Ln,5:[,5:[OKSQlO,5:[OMQQ!0MxO,5:dOMqQ`O,5:lON[Q!0LrO'#KOONcQ`O'#J}O9ZQ`O'#J}ONwQ`O'#J}O! PQ`O,5;ZO! UQ`O'#J}O!#ZQ!fO'#JqOOQ!0Lh'#Ci'#CiO%[QlO'#EQO!#yQ!fO,5:qOOQS'#Jx'#JxOOQO-ErOOQ['#Jf'#JfOOQ[,5>s,5>sOOQ[-EbQ!0MxO,5:hO%[QlO,5:hO!@xQ!0MxO,5:jOOQO,5@x,5@xO!AiQMhO,5=^O!AwQ!0LrO'#JgO9UQ`O'#JgO!BYQ!0LrO,59ZO!BeQpO,59ZO!BmQMhO,59ZO:YQMhO,59ZO!BxQ`O,5;XO!CQQ`O'#H`O!CfQ`O'#KbO%[QlO,5;|O!9lQpO,5wQ`O'#HVO9aQ`O'#HXO!D}Q`O'#HXO:YQMhO'#HZO!ESQ`O'#HZOOQ[,5=o,5=oO!EXQ`O'#H[O!EjQ`O'#CoO!EoQ`O,59PO!EyQ`O,59PO!HOQlO,59POOQ[,59P,59PO!H`Q!0LrO,59PO%[QlO,59PO!JkQlO'#HcOOQ['#Hd'#HdOOQ['#He'#HeO`QlO,5={O!KRQ`O,5={O`QlO,5>RO`QlO,5>TO!KWQ`O,5>VO`QlO,5>XO!K]Q`O,5>[O!KbQlO,5>bOOQ[,5>h,5>hO%[QlO,5>hO9kQ!0LrO,5>jOOQ[,5>l,5>lO# lQ`O,5>lOOQ[,5>n,5>nO# lQ`O,5>nOOQ[,5>p,5>pO#!YQpO'#D]O%[QlO'#JtO#!{QpO'#JtO##VQpO'#DkO##hQpO'#DkO#%yQlO'#DkO#&QQ`O'#JsO#&YQ`O,5:UO#&_Q`O'#ErO#&mQ`O'#KSO#&uQ`O,5;]O#&zQpO'#DkO#'XQpO'#ETOOQ!0Lf,5:m,5:mO%[QlO,5:mO#'`Q`O,5:mO>wQ`O,5;WO!BeQpO,5;WO!BmQMhO,5;WO:YQMhO,5;WO#'hQ`O,5@`O#'mQ07dO,5:qOOQO-E|O+}QlO,5>|OOQO,5?S,5?SO#*uQlO'#IbOOQO-E<`-E<`O#+SQ`O,5@^O#+[Q!fO,5@^O#+cQ`O,5@lOOQ!0Lf1G/k1G/kO%[QlO,5@mO#+kQ`O'#IhOOQO-ErQ`O1G3qO$4rQlO1G3sO$8vQlO'#HrOOQ[1G3v1G3vO$9TQ`O'#HxO>wQ`O'#HzOOQ[1G3|1G3|O$9]QlO1G3|O9kQ!0LrO1G4SOOQ[1G4U1G4UOOQ!0Lb'#G^'#G^O9kQ!0LrO1G4WO9kQ!0LrO1G4YO$=dQ`O,5@`O!(yQlO,5;^O9ZQ`O,5;^O>wQ`O,5:VO!(yQlO,5:VO!BeQpO,5:VO$=iQ?MtO,5:VOOQO,5;^,5;^O$=sQpO'#IcO$>ZQ`O,5@_OOQ!0Lf1G/p1G/pO$>cQpO'#IiO$>mQ`O,5@nOOQ!0Lb1G0w1G0wO##hQpO,5:VOOQO'#Ie'#IeO$>uQpO,5:oOOQ!0Ln,5:o,5:oO#'cQ`O1G0XOOQ!0Lf1G0X1G0XO%[QlO1G0XOOQ!0Lf1G0r1G0rO>wQ`O1G0rO!BeQpO1G0rO!BmQMhO1G0rOOQ!0Lb1G5z1G5zO!BYQ!0LrO1G0[OOQO1G0k1G0kO%[QlO1G0kO$>|Q!0LrO1G0kO$?XQ!0LrO1G0kO!BeQpO1G0[OCuQpO1G0[O$?gQ!0LrO1G0kOOQO1G0[1G0[O$?{Q!0MxO1G0kPOOO-E|O$@iQ`O1G5xO$@qQ`O1G6WO$@yQ!fO1G6XO9ZQ`O,5?SO$ATQ!0MxO1G6UO%[QlO1G6UO$AeQ!0LrO1G6UO$AvQ`O1G6TO$AvQ`O1G6TO9ZQ`O1G6TO$BOQ`O,5?VO9ZQ`O,5?VOOQO,5?V,5?VO$BdQ`O,5?VO$)iQ`O,5?VOOQO-E^OOQ[,5>^,5>^O%[QlO'#HsO%=zQ`O'#HuOOQ[,5>d,5>dO9ZQ`O,5>dOOQ[,5>f,5>fOOQ[7+)h7+)hOOQ[7+)n7+)nOOQ[7+)r7+)rOOQ[7+)t7+)tO%>PQpO1G5zO%>kQ?MtO1G0xO%>uQ`O1G0xOOQO1G/q1G/qO%?QQ?MtO1G/qO>wQ`O1G/qO!(yQlO'#DkOOQO,5>},5>}OOQO-EwQ`O7+&^O!BeQpO7+&^OOQO7+%v7+%vO$?{Q!0MxO7+&VOOQO7+&V7+&VO%[QlO7+&VO%?[Q!0LrO7+&VO!BYQ!0LrO7+%vO!BeQpO7+%vO%?gQ!0LrO7+&VO%?uQ!0MxO7++pO%[QlO7++pO%@VQ`O7++oO%@VQ`O7++oOOQO1G4q1G4qO9ZQ`O1G4qO%@_Q`O1G4qOOQS7+%{7+%{O#'cQ`O<_OOQ[,5>a,5>aO&=aQ`O1G4OO9ZQ`O7+&dO!(yQlO7+&dOOQO7+%]7+%]O&=fQ?MtO1G6XO>wQ`O7+%]OOQ!0Lf<wQ`O<]Q`O<= ZOOQO7+*]7+*]O9ZQ`O7+*]OOQ[ANAjANAjO&>eQ!fOANAjO!&iQMhOANAjO#'cQ`OANAjO4UQ!fOANAjO&>lQ`OANAjO%[QlOANAjO&>tQ!0MzO7+'yO&AVQ!0MzO,5?_O&CbQ!0MzO,5?aO&EmQ!0MzO7+'{O&HOQ!fO1G4jO&HYQ?MtO7+&_O&J^Q?MvO,5=WO&LeQ?MvO,5=YO&LuQ?MvO,5=WO&MVQ?MvO,5=YO&MgQ?MvO,59sO' mQ?MvO,5wQ`O7+)jO'-]Q`O<|AN>|O%[QlOAN?]OOQO<PPPP!>XHwPPPPPPPPPP!AhP!BuPPHw!DWPHwPHwHwHwHwHwPHw!EjP!HtP!KzP!LO!LY!L^!L^P!HqP!Lb!LbP# hP# lHwPHw# r#$wCV@yP@yP@y@yP#&U@y@y#(h@y#+`@y#-l@y@y#.[#0p#0p#0u#1O#0p#1ZPP#0pP@y#1s@y#5r@y@y6aPPP#9wPPP#:b#:bP#:bP#:x#:bPP#;OP#:uP#:u#;c#:u#;}#R#>X#>c#>i#>s#>y#?Z#?a#@R#@e#@k#@q#AP#Af#CZ#Ci#Cp#E[#Ej#G[#Gj#Gp#Gv#G|#HW#H^#Hd#Hn#IQ#IWPPPPPPPPPPP#I^PPPPPPP#JR#MY#Nr#Ny$ RPPP$&mP$&v$)o$0Y$0]$0`$1_$1b$1i$1qP$1w$1zP$2h$2l$3d$4r$4w$5_PP$5d$5j$5n$5q$5u$5y$6u$7^$7u$7y$7|$8P$8V$8Y$8^$8bR!|RoqOXst!Z#d%l&p&r&s&u,n,s2S2VY!vQ'^-`1g5qQ%svQ%{yQ&S|Q&h!VS'U!e-WQ'd!iS'j!r!yU*h$|*X*lQ+l%|Q+y&UQ,_&bQ-^']Q-h'eQ-p'kQ0U*nQ1q,`R < TypeParamList const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:378,context:Oi,nodeProps:[["isolate",-8,5,6,14,35,37,49,51,53,""],["group",-26,9,17,19,66,206,210,214,215,217,220,223,233,235,241,243,245,247,250,256,262,264,266,268,270,272,273,"Statement",-34,13,14,30,33,34,40,49,52,53,55,60,68,70,74,78,80,82,83,108,109,118,119,135,138,140,141,142,143,144,146,147,166,168,170,"Expression",-23,29,31,35,39,41,43,172,174,176,177,179,180,181,183,184,185,187,188,189,200,202,204,205,"Type",-3,86,101,107,"ClassItem"],["openedBy",23,"<",36,"InterpolationStart",54,"[",58,"{",71,"(",159,"JSXStartCloseTag"],["closedBy",-2,24,167,">",38,"InterpolationEnd",48,"]",59,"}",72,")",164,"JSXEndTag"]],propSources:[si],skippedNodes:[0,5,6,276],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$h&j(X!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(X!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$h&j(UpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(UpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Up(X!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$h&j(Up(X!b'z0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(V#S$h&j'{0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$h&j(Up(X!b'{0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$h&j!n),Q(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#u(Ch$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#u(Ch$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(T':f$h&j(X!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$h&j(X!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$h&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$c`$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$c``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$c`$h&j(X!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(X!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$c`(X!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$h&j(Up(X!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$h&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(X!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$h&j(UpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(UpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Up(X!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l^!Q^$h&j!V7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!V7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!V7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c^!Ezl$h&j(X!b!V7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(X!b!V7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(X!b!V7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(X!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$h&j(X!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!^!LYP;=`<%l!KS>^!L`P;=`<%l!_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$h&j(Up(X!bq'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$h&j(Up(X!bq'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$h&j(Up(X!bq'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$h&j(Up(X!bq'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!e$b$h&j#})Lv(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#P-v$?V_![(CdtBr$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z?O$@a_!o7`$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$Aq|$h&j(Up(X!b'z0/l$[#t(R,2j(c$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$h&j(Up(X!b'{0/l$[#t(R,2j(c$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[ti,ai,ri,ii,2,3,4,5,6,7,8,9,10,11,12,13,14,ei,new nO("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOv~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!S~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(a~~",141,338),new nO("j~RQYZXz{^~^O(O~~aP!P!Qd~iO(P~~",25,321)],topRules:{Script:[0,7],SingleExpression:[1,274],SingleClassItem:[2,275]},dialects:{jsx:0,ts:15091},dynamicPrecedences:{78:1,80:1,92:1,168:1,198:1},specialized:[{term:325,get:e=>li[e]||-1},{term:341,get:e=>ni[e]||-1},{term:93,get:e=>oi[e]||-1}],tokenPrec:15116}),tt=[g("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),g("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),g("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),g("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),g("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),g(`try { + \${} +} catch (\${error}) { + \${} +}`,{label:"try",detail:"/ catch block",type:"keyword"}),g("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),g(`if (\${}) { + \${} +} else { + \${} +}`,{label:"if",detail:"/ else block",type:"keyword"}),g(`class \${name} { + constructor(\${params}) { + \${} + } +}`,{label:"class",detail:"definition",type:"keyword"}),g('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),g('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],ci=tt.concat([g("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),g("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),g("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),$e=new _e,at=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function E(e){return(O,t)=>{let a=O.node.getChild("VariableDefinition");return a&&t(a,e),!0}}const pi=["FunctionDeclaration"],hi={FunctionDeclaration:E("function"),ClassDeclaration:E("class"),ClassExpression:()=>!0,EnumDeclaration:E("constant"),TypeAliasDeclaration:E("type"),NamespaceDeclaration:E("namespace"),VariableDefinition(e,O){e.matchContext(pi)||O(e,"variable")},TypeDefinition(e,O){O(e,"type")},__proto__:null};function rt(e,O){let t=$e.get(O);if(t)return t;let a=[],r=!0;function s(i,l){let o=e.sliceString(i.from,i.to);a.push({label:o,type:l})}return O.cursor(YO.IncludeAnonymous).iterate(i=>{if(r)r=!1;else if(i.name){let l=hi[i.name];if(l&&l(i,s)||at.has(i.name))return!1}else if(i.to-i.from>8192){for(let l of rt(e,i.node))a.push(l);return!1}}),$e.set(O,a),a}const Pe=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,it=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName",".","?."];function ui(e){let O=z(e.state).resolveInner(e.pos,-1);if(it.indexOf(O.name)>-1)return null;let t=O.name=="VariableName"||O.to-O.from<20&&Pe.test(e.state.sliceDoc(O.from,O.to));if(!t&&!e.explicit)return null;let a=[];for(let r=O;r;r=r.parent)at.has(r.name)&&(a=a.concat(rt(e.state.doc,r)));return{options:a,from:t?O.from:e.pos,validFor:Pe}}const y=D.define({name:"javascript",parser:Qi.configure({props:[J.add({IfStatement:Y({except:/^\s*({|else\b)/}),TryStatement:Y({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:Bt,SwitchBody:e=>{let O=e.textAfter,t=/^\s*\}/.test(O),a=/^\s*(case|default)\b/.test(O);return e.baseIndent+(t?0:a?1:2)*e.unit},Block:Nt({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":Y({except:/^{/}),JSXElement(e){let O=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(O?0:e.unit)},JSXEscape(e){let O=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(O?0:e.unit)},"JSXOpenTag JSXSelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),K.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":VO,BlockComment(e){return{from:e.from+2,to:e.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),st={test:e=>/^JSX/.test(e.name),facet:It({commentTokens:{block:{open:"{/*",close:"*/}"}}})},lt=y.configure({dialect:"ts"},"typescript"),nt=y.configure({dialect:"jsx",props:[je.add(e=>e.isTop?[st]:void 0)]}),ot=y.configure({dialect:"jsx ts",props:[je.add(e=>e.isTop?[st]:void 0)]},"typescript");let Qt=e=>({label:e,type:"keyword"});const ct="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(Qt),di=ct.concat(["declare","implements","private","protected","public"].map(Qt));function pt(e={}){let O=e.jsx?e.typescript?ot:nt:e.typescript?lt:y,t=e.typescript?ci.concat(di):tt.concat(ct);return new F(O,[y.data.of({autocomplete:Ye(it,Ve(t))}),y.data.of({autocomplete:ui}),e.jsx?Pi:[]])}function fi(e){for(;;){if(e.name=="JSXOpenTag"||e.name=="JSXSelfClosingTag"||e.name=="JSXFragmentTag")return e;if(e.name=="JSXEscape"||!e.parent)return null;e=e.parent}}function Se(e,O,t=e.length){for(let a=O==null?void 0:O.firstChild;a;a=a.nextSibling)if(a.name=="JSXIdentifier"||a.name=="JSXBuiltin"||a.name=="JSXNamespacedName"||a.name=="JSXMemberExpression")return e.sliceString(a.from,Math.min(a.to,t));return""}const $i=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Pi=j.inputHandler.of((e,O,t,a,r)=>{if(($i?e.composing:e.compositionStarted)||e.state.readOnly||O!=t||a!=">"&&a!="/"||!y.isActiveAt(e.state,O,-1))return!1;let s=r(),{state:i}=s,l=i.changeByRange(o=>{var c;let{head:h}=o,Q=z(i).resolveInner(h-1,-1),f;if(Q.name=="JSXStartTag"&&(Q=Q.parent),!(i.doc.sliceString(h-1,h)!=a||Q.name=="JSXAttributeValue"&&Q.to>h)){if(a==">"&&Q.name=="JSXFragmentTag")return{range:o,changes:{from:h,insert:""}};if(a=="/"&&Q.name=="JSXStartCloseTag"){let p=Q.parent,d=p.parent;if(d&&p.from==h-2&&((f=Se(i.doc,d.firstChild,h))||((c=d.firstChild)===null||c===void 0?void 0:c.name)=="JSXFragmentTag")){let P=`${f}>`;return{range:We.cursor(h+P.length,-1),changes:{from:h,insert:P}}}}else if(a==">"){let p=fi(Q);if(p&&p.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(i.doc.sliceString(h,h+2))&&(f=Se(i.doc,p,h)))return{range:o,changes:{from:h,insert:``}}}}return{range:o}});return l.changes.empty?!1:(e.dispatch([s,i.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),A=["_blank","_self","_top","_parent"],gO=["ascii","utf-8","utf-16","latin1","latin1"],ZO=["get","post","put","delete"],bO=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],b=["true","false"],u={},Si={a:{attrs:{href:null,ping:null,type:null,media:null,target:A,hreflang:null}},abbr:u,address:u,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:u,aside:u,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:u,base:{attrs:{href:null,target:A}},bdi:u,bdo:u,blockquote:{attrs:{cite:null}},body:u,br:u,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:bO,formmethod:ZO,formnovalidate:["novalidate"],formtarget:A,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:u,center:u,cite:u,code:u,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:u,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:u,div:u,dl:u,dt:u,em:u,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:u,figure:u,footer:u,form:{attrs:{action:null,name:null,"accept-charset":gO,autocomplete:["on","off"],enctype:bO,method:ZO,novalidate:["novalidate"],target:A}},h1:u,h2:u,h3:u,h4:u,h5:u,h6:u,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:u,hgroup:u,hr:u,html:{attrs:{manifest:null}},i:u,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:bO,formmethod:ZO,formnovalidate:["novalidate"],formtarget:A,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:u,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:u,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:u,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:gO,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:u,noscript:u,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:u,param:{attrs:{name:null,value:null}},pre:u,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:u,rt:u,ruby:u,samp:u,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:gO}},section:u,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:u,source:{attrs:{src:null,type:null,media:null}},span:u,strong:u,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:u,summary:u,sup:u,table:u,tbody:u,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:u,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:u,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:u,time:{attrs:{datetime:null}},title:u,tr:u,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:u,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:u},ht={accesskey:null,class:null,contenteditable:b,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:b,autocorrect:b,autocapitalize:b,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":b,"aria-autocomplete":["inline","list","both","none"],"aria-busy":b,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":b,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":b,"aria-hidden":b,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":b,"aria-multiselectable":b,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":b,"aria-relevant":null,"aria-required":b,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},ut="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(e=>"on"+e);for(let e of ut)ht[e]=null;class pO{constructor(O,t){this.tags=Object.assign(Object.assign({},Si),O),this.globalAttrs=Object.assign(Object.assign({},ht),t),this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}pO.default=new pO;function U(e,O,t=e.length){if(!O)return"";let a=O.firstChild,r=a&&a.getChild("TagName");return r?e.sliceString(r.from,Math.min(r.to,t)):""}function G(e,O=!1){for(;e;e=e.parent)if(e.name=="Element")if(O)O=!1;else return e;return null}function dt(e,O,t){let a=t.tags[U(e,G(O))];return(a==null?void 0:a.children)||t.allTags}function GO(e,O){let t=[];for(let a=G(O);a&&!a.type.isTop;a=G(a.parent)){let r=U(e,a);if(r&&a.lastChild.name=="CloseTag")break;r&&t.indexOf(r)<0&&(O.name=="EndTag"||O.from>=a.firstChild.to)&&t.push(r)}return t}const ft=/^[:\-\.\w\u00b7-\uffff]*$/;function me(e,O,t,a,r){let s=/\s*>/.test(e.sliceDoc(r,r+5))?"":">",i=G(t,!0);return{from:a,to:r,options:dt(e.doc,i,O).map(l=>({label:l,type:"type"})).concat(GO(e.doc,t).map((l,o)=>({label:"/"+l,apply:"/"+l+s,type:"type",boost:99-o}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function ge(e,O,t,a){let r=/\s*>/.test(e.sliceDoc(a,a+5))?"":">";return{from:t,to:a,options:GO(e.doc,O).map((s,i)=>({label:s,apply:s+r,type:"type",boost:99-i})),validFor:ft}}function mi(e,O,t,a){let r=[],s=0;for(let i of dt(e.doc,t,O))r.push({label:"<"+i,type:"type"});for(let i of GO(e.doc,t))r.push({label:"",type:"type",boost:99-s++});return{from:a,to:a,options:r,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function gi(e,O,t,a,r){let s=G(t),i=s?O.tags[U(e.doc,s)]:null,l=i&&i.attrs?Object.keys(i.attrs):[],o=i&&i.globalAttrs===!1?l:l.length?l.concat(O.globalAttrNames):O.globalAttrNames;return{from:a,to:r,options:o.map(c=>({label:c,type:"property"})),validFor:ft}}function Zi(e,O,t,a,r){var s;let i=(s=t.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),l=[],o;if(i){let c=e.sliceDoc(i.from,i.to),h=O.globalAttrs[c];if(!h){let Q=G(t),f=Q?O.tags[U(e.doc,Q)]:null;h=(f==null?void 0:f.attrs)&&f.attrs[c]}if(h){let Q=e.sliceDoc(a,r).toLowerCase(),f='"',p='"';/^['"]/.test(Q)?(o=Q[0]=='"'?/^[^"]*$/:/^[^']*$/,f="",p=e.sliceDoc(r,r+1)==Q[0]?"":Q[0],Q=Q.slice(1),a++):o=/^[^\s<>='"]*$/;for(let d of h)l.push({label:d,apply:f+d+p,type:"constant"})}}return{from:a,to:r,options:l,validFor:o}}function bi(e,O){let{state:t,pos:a}=O,r=z(t).resolveInner(a,-1),s=r.resolve(a);for(let i=a,l;s==r&&(l=r.childBefore(i));){let o=l.lastChild;if(!o||!o.type.isError||o.frombi(a,r)}const ki=y.parser.configure({top:"SingleExpression"}),$t=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:lt.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:nt.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:ot.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:ki},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:y.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:cO.parser}],Pt=[{name:"style",parser:cO.parser.configure({top:"Styles"})}].concat(ut.map(e=>({name:e,parser:y.parser}))),St=D.define({name:"html",parser:rr.configure({props:[J.add({Element(e){let O=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+O[0].length?e.continue():e.lineIndent(e.node.from)+(O[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].lengthe.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-._"}}),iO=St.configure({wrap:Je($t,Pt)});function Xi(e={}){let O="",t;e.matchClosingTags===!1&&(O="noMatch"),e.selfClosingTags===!0&&(O=(O?O+" ":"")+"selfClosing"),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(t=Je((e.nestedLanguages||[]).concat($t),(e.nestedAttributes||[]).concat(Pt)));let a=t?St.configure({wrap:t,dialect:O}):O?iO.configure({dialect:O}):iO;return new F(a,[iO.data.of({autocomplete:xi(e)}),e.autoCloseTags!==!1?yi:[],pt().support,_r().support])}const Ze=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),yi=j.inputHandler.of((e,O,t,a,r)=>{if(e.composing||e.state.readOnly||O!=t||a!=">"&&a!="/"||!iO.isActiveAt(e.state,O,-1))return!1;let s=r(),{state:i}=s,l=i.changeByRange(o=>{var c,h,Q;let f=i.doc.sliceString(o.from-1,o.to)==a,{head:p}=o,d=z(i).resolveInner(p,-1),P;if(f&&a==">"&&d.name=="EndTag"){let S=d.parent;if(((h=(c=S.parent)===null||c===void 0?void 0:c.lastChild)===null||h===void 0?void 0:h.name)!="CloseTag"&&(P=U(i.doc,S.parent,p))&&!Ze.has(P)){let k=p+(i.doc.sliceString(p,p+1)===">"?1:0),X=``;return{range:o,changes:{from:p,to:k,insert:X}}}}else if(f&&a=="/"&&d.name=="IncompleteCloseTag"){let S=d.parent;if(d.from==p-2&&((Q=S.lastChild)===null||Q===void 0?void 0:Q.name)!="CloseTag"&&(P=U(i.doc,S,p))&&!Ze.has(P)){let k=p+(i.doc.sliceString(p,p+1)===">"?1:0),X=`${P}>`;return{range:We.cursor(p+X.length,-1),changes:{from:p,to:k,insert:X}}}}return{range:o}});return l.changes.empty?!1:(e.dispatch([s,i.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),wi=I({String:n.string,Number:n.number,"True False":n.bool,PropertyName:n.propertyName,Null:n.null,",":n.separator,"[ ]":n.squareBracket,"{ }":n.brace}),Ti=q.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j",stateData:"#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O",goto:"!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",12,"["],["closedBy",8,"}",13,"]"]],propSources:[wi],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oc~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Oe~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zOh~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yOg~~'OO]~~'TO[~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),vi=D.define({name:"json",parser:Ti.configure({props:[J.add({Object:Y({except:/^\s*\}/}),Array:Y({except:/^\s*\]/})}),K.add({"Object Array":VO})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function qi(){return new F(vi)}const Ri=36,be=1,_i=2,V=3,xO=4,ji=5,Yi=6,Vi=7,Wi=8,Ui=9,Gi=10,zi=11,Ci=12,Ei=13,Ai=14,Mi=15,Li=16,Bi=17,xe=18,Ni=19,mt=20,gt=21,ke=22,Ii=23,Di=24;function vO(e){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57}function Ji(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function _(e,O,t){for(let a=!1;;){if(e.next<0)return;if(e.next==O&&!a){e.advance();return}a=t&&!a&&e.next==92,e.advance()}}function Ki(e,O){O:for(;;){if(e.next<0)return;if(e.next==36){e.advance();for(let t=0;t)".charCodeAt(t);for(;;){if(e.next<0)return;if(e.next==a&&e.peek(1)==39){e.advance(2);return}e.advance()}}function qO(e,O){for(;!(e.next!=95&&!vO(e.next));)O!=null&&(O+=String.fromCharCode(e.next)),e.advance();return O}function Hi(e){if(e.next==39||e.next==34||e.next==96){let O=e.next;e.advance(),_(e,O,!1)}else qO(e)}function Xe(e,O){for(;e.next==48||e.next==49;)e.advance();O&&e.next==O&&e.advance()}function ye(e,O){for(;;){if(e.next==46){if(O)break;O=!0}else if(e.next<48||e.next>57)break;e.advance()}if(e.next==69||e.next==101)for(e.advance(),(e.next==43||e.next==45)&&e.advance();e.next>=48&&e.next<=57;)e.advance()}function we(e){for(;!(e.next<0||e.next==10);)e.advance()}function R(e,O){for(let t=0;t!=&|~^/",specialVar:"?",identifierQuotes:'"',caseInsensitiveIdentifiers:!1,words:Zt(es,Os)};function ts(e,O,t,a){let r={};for(let s in RO)r[s]=(e.hasOwnProperty(s)?e:RO)[s];return O&&(r.words=Zt(O,t||"",a)),r}function bt(e){return new x(O=>{var t;let{next:a}=O;if(O.advance(),R(a,kO)){for(;R(O.next,kO);)O.advance();O.acceptToken(Ri)}else if(a==36&&e.doubleDollarQuotedStrings){let r=qO(O,"");O.next==36&&(O.advance(),Ki(O,r),O.acceptToken(V))}else if(a==39||a==34&&e.doubleQuotedStrings)_(O,a,e.backslashEscapes),O.acceptToken(V);else if(a==35&&e.hashComments||a==47&&O.next==47&&e.slashComments)we(O),O.acceptToken(be);else if(a==45&&O.next==45&&(!e.spaceAfterDashes||O.peek(1)==32))we(O),O.acceptToken(be);else if(a==47&&O.next==42){O.advance();for(let r=1;;){let s=O.next;if(O.next<0)break;if(O.advance(),s==42&&O.next==47){if(r--,O.advance(),!r)break}else s==47&&O.next==42&&(r++,O.advance())}O.acceptToken(_i)}else if((a==101||a==69)&&O.next==39)O.advance(),_(O,39,!0),O.acceptToken(V);else if((a==110||a==78)&&O.next==39&&e.charSetCasts)O.advance(),_(O,39,e.backslashEscapes),O.acceptToken(V);else if(a==95&&e.charSetCasts)for(let r=0;;r++){if(O.next==39&&r>1){O.advance(),_(O,39,e.backslashEscapes),O.acceptToken(V);break}if(!vO(O.next))break;O.advance()}else if(e.plsqlQuotingMechanism&&(a==113||a==81)&&O.next==39&&O.peek(1)>0&&!R(O.peek(1),kO)){let r=O.peek(1);O.advance(2),Fi(O,r),O.acceptToken(V)}else if(a==40)O.acceptToken(Vi);else if(a==41)O.acceptToken(Wi);else if(a==123)O.acceptToken(Ui);else if(a==125)O.acceptToken(Gi);else if(a==91)O.acceptToken(zi);else if(a==93)O.acceptToken(Ci);else if(a==59)O.acceptToken(Ei);else if(e.unquotedBitLiterals&&a==48&&O.next==98)O.advance(),Xe(O),O.acceptToken(ke);else if((a==98||a==66)&&(O.next==39||O.next==34)){const r=O.next;O.advance(),e.treatBitsAsBytes?(_(O,r,e.backslashEscapes),O.acceptToken(Ii)):(Xe(O,r),O.acceptToken(ke))}else if(a==48&&(O.next==120||O.next==88)||(a==120||a==88)&&O.next==39){let r=O.next==39;for(O.advance();Ji(O.next);)O.advance();r&&O.next==39&&O.advance(),O.acceptToken(xO)}else if(a==46&&O.next>=48&&O.next<=57)ye(O,!0),O.acceptToken(xO);else if(a==46)O.acceptToken(Ai);else if(a>=48&&a<=57)ye(O,!1),O.acceptToken(xO);else if(R(a,e.operatorChars)){for(;R(O.next,e.operatorChars);)O.advance();O.acceptToken(Mi)}else if(R(a,e.specialVar))O.next==a&&O.advance(),Hi(O),O.acceptToken(Bi);else if(R(a,e.identifierQuotes))_(O,a,!1),O.acceptToken(Ni);else if(a==58||a==44)O.acceptToken(Li);else if(vO(a)){let r=qO(O,String.fromCharCode(a));O.acceptToken(O.next==46||O.peek(-r.length-1)==46?xe:(t=e.words[r.toLowerCase()])!==null&&t!==void 0?t:xe)}})}const xt=bt(RO),as=q.deserialize({version:14,states:"%vQ]QQOOO#wQRO'#DSO$OQQO'#CwO%eQQO'#CxO%lQQO'#CyO%sQQO'#CzOOQQ'#DS'#DSOOQQ'#C}'#C}O'UQRO'#C{OOQQ'#Cv'#CvOOQQ'#C|'#C|Q]QQOOQOQQOOO'`QQO'#DOO(xQRO,59cO)PQQO,59cO)UQQO'#DSOOQQ,59d,59dO)cQQO,59dOOQQ,59e,59eO)jQQO,59eOOQQ,59f,59fO)qQQO,59fOOQQ-E6{-E6{OOQQ,59b,59bOOQQ-E6z-E6zOOQQ,59j,59jOOQQ-E6|-E6|O+VQRO1G.}O+^QQO,59cOOQQ1G/O1G/OOOQQ1G/P1G/POOQQ1G/Q1G/QP+kQQO'#C}O+rQQO1G.}O)PQQO,59cO,PQQO'#Cw",stateData:",[~OtOSPOSQOS~ORUOSUOTUOUUOVROXSOZTO]XO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O^]ORvXSvXTvXUvXVvXXvXZvX]vX_vX`vXavXbvXcvXdvXevXfvXgvXhvX~OsvX~P!jOa_Ob_Oc_O~ORUOSUOTUOUUOVROXSOZTO^tO_UO`UOa`Ob`Oc`OdUOeUOfUOgUOhUO~OWaO~P$ZOYcO~P$ZO[eO~P$ZORUOSUOTUOUUOVROXSOZTO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O]hOsoX~P%zOajObjOcjO~O^]ORkaSkaTkaUkaVkaXkaZka]ka_ka`kaakabkackadkaekafkagkahka~Oska~P'kO^]O~OWvXYvX[vX~P!jOWnO~P$ZOYoO~P$ZO[pO~P$ZO^]ORkiSkiTkiUkiVkiXkiZki]ki_ki`kiakibkickidkiekifkigkihki~Oski~P)xOWkaYka[ka~P'kO]hO~P$ZOWkiYki[ki~P)xOasObsOcsO~O",goto:"#hwPPPPPPPPPPPPPPPPPPPPPPPPPPx||||!Y!^!d!xPPP#[TYOZeUORSTWZbdfqT[OZQZORiZSWOZQbRQdSQfTZgWbdfqQ^PWk^lmrQl_Qm`RrseVORSTWZbdfq",nodeNames:"⚠ LineComment BlockComment String Number Bool Null ( ) { } [ ] ; . Operator Punctuation SpecialVar Identifier QuotedIdentifier Keyword Type Bits Bytes Builtin Script Statement CompositeIdentifier Parens Braces Brackets Statement",maxTerm:38,nodeProps:[["isolate",-4,1,2,3,19,""]],skippedNodes:[0,1,2],repeatNodeCount:3,tokenData:"RORO",tokenizers:[0,xt],topRules:{Script:[0,25]},tokenPrec:0});function _O(e){let O=e.cursor().moveTo(e.from,-1);for(;/Comment/.test(O.name);)O.moveTo(O.from,-1);return O.node}function B(e,O){let t=e.sliceString(O.from,O.to),a=/^([`'"])(.*)\1$/.exec(t);return a?a[2]:t}function hO(e){return e&&(e.name=="Identifier"||e.name=="QuotedIdentifier")}function rs(e,O){if(O.name=="CompositeIdentifier"){let t=[];for(let a=O.firstChild;a;a=a.nextSibling)hO(a)&&t.push(B(e,a));return t}return[B(e,O)]}function Te(e,O){for(let t=[];;){if(!O||O.name!=".")return t;let a=_O(O);if(!hO(a))return t;t.unshift(B(e,a)),O=_O(a)}}function is(e,O){let t=z(e).resolveInner(O,-1),a=ls(e.doc,t);return t.name=="Identifier"||t.name=="QuotedIdentifier"||t.name=="Keyword"?{from:t.from,quoted:t.name=="QuotedIdentifier"?e.doc.sliceString(t.from,t.from+1):null,parents:Te(e.doc,_O(t)),aliases:a}:t.name=="."?{from:O,quoted:null,parents:Te(e.doc,t),aliases:a}:{from:O,quoted:null,parents:[],empty:!0,aliases:a}}const ss=new Set("where group having order union intersect except all distinct limit offset fetch for".split(" "));function ls(e,O){let t;for(let r=O;!t;r=r.parent){if(!r)return null;r.name=="Statement"&&(t=r)}let a=null;for(let r=t.firstChild,s=!1,i=null;r;r=r.nextSibling){let l=r.name=="Keyword"?e.sliceString(r.from,r.to).toLowerCase():null,o=null;if(!s)s=l=="from";else if(l=="as"&&i&&hO(r.nextSibling))o=B(e,r.nextSibling);else{if(l&&ss.has(l))break;i&&hO(r)&&(o=B(e,r))}o&&(a||(a=Object.create(null)),a[o]=rs(e,i)),i=/Identifier$/.test(r.name)?r:null}return a}function ns(e,O){return e?O.map(t=>Object.assign(Object.assign({},t),{label:t.label[0]==e?t.label:e+t.label+e,apply:void 0})):O}const os=/^\w*$/,Qs=/^[`'"]?\w*[`'"]?$/;function ve(e){return e.self&&typeof e.self.label=="string"}class zO{constructor(O,t){this.idQuote=O,this.idCaseInsensitive=t,this.list=[],this.children=void 0}child(O){let t=this.children||(this.children=Object.create(null)),a=t[O];return a||(O&&!this.list.some(r=>r.label==O)&&this.list.push(qe(O,"type",this.idQuote,this.idCaseInsensitive)),t[O]=new zO(this.idQuote,this.idCaseInsensitive))}maybeChild(O){return this.children?this.children[O]:null}addCompletion(O){let t=this.list.findIndex(a=>a.label==O.label);t>-1?this.list[t]=O:this.list.push(O)}addCompletions(O){for(let t of O)this.addCompletion(typeof t=="string"?qe(t,"property",this.idQuote,this.idCaseInsensitive):t)}addNamespace(O){Array.isArray(O)?this.addCompletions(O):ve(O)?this.addNamespace(O.children):this.addNamespaceObject(O)}addNamespaceObject(O){for(let t of Object.keys(O)){let a=O[t],r=null,s=t.replace(/\\?\./g,l=>l=="."?"\0":l).split("\0"),i=this;ve(a)&&(r=a.self,a=a.children);for(let l=0;l{let{parents:Q,from:f,quoted:p,empty:d,aliases:P}=is(h.state,h.pos);if(d&&!h.explicit)return null;P&&Q.length==1&&(Q=P[Q[0]]||Q);let S=o;for(let v of Q){for(;!S.children||!S.children[v];)if(S==o&&c)S=c;else if(S==c&&a)S=S.child(a);else return null;let H=S.maybeChild(v);if(!H)return null;S=H}let k=p&&h.state.sliceDoc(h.pos,h.pos+1)==p,X=S.list;return S==o&&P&&(X=X.concat(Object.keys(P).map(v=>({label:v,type:"constant"})))),{from:f,to:k?h.pos+1:void 0,options:ns(p,X),validFor:p?Qs:os}}}function ps(e){return e==gt?"type":e==mt?"keyword":"variable"}function hs(e,O,t){let a=Object.keys(e).map(r=>t(O?r.toUpperCase():r,ps(e[r])));return Ye(["QuotedIdentifier","SpecialVar","String","LineComment","BlockComment","."],Ve(a))}let us=as.configure({props:[J.add({Statement:Y()}),K.add({Statement(e,O){return{from:Math.min(e.from+100,O.doc.lineAt(e.from).to),to:e.to}},BlockComment(e){return{from:e.from+2,to:e.to-2}}}),I({Keyword:n.keyword,Type:n.typeName,Builtin:n.standard(n.name),Bits:n.number,Bytes:n.string,Bool:n.bool,Null:n.null,Number:n.number,String:n.string,Identifier:n.name,QuotedIdentifier:n.special(n.string),SpecialVar:n.special(n.name),LineComment:n.lineComment,BlockComment:n.blockComment,Operator:n.operator,"Semi Punctuation":n.punctuation,"( )":n.paren,"{ }":n.brace,"[ ]":n.squareBracket})]});class N{constructor(O,t,a){this.dialect=O,this.language=t,this.spec=a}get extension(){return this.language.extension}static define(O){let t=ts(O,O.keywords,O.types,O.builtin),a=D.define({name:"sql",parser:us.configure({tokenizers:[{from:xt,to:bt(t)}]}),languageData:{commentTokens:{line:"--",block:{open:"/*",close:"*/"}},closeBrackets:{brackets:["(","[","{","'",'"',"`"]}}});return new N(t,a,O)}}function ds(e,O){return{label:e,type:O,boost:-1}}function fs(e,O=!1,t){return hs(e.dialect.words,O,t||ds)}function $s(e){return e.schema?cs(e.schema,e.tables,e.schemas,e.defaultTable,e.defaultSchema,e.dialect||CO):()=>null}function Ps(e){return e.schema?(e.dialect||CO).language.data.of({autocomplete:$s(e)}):[]}function Re(e={}){let O=e.dialect||CO;return new F(O.language,[Ps(e),O.language.data.of({autocomplete:fs(O,e.upperCaseKeywords,e.keywordCompletion)})])}const CO=N.define({});function Ss(e){let O;return{c(){O=qt("div"),Rt(O,"class","code-editor"),OO(O,"min-height",e[0]?e[0]+"px":null),OO(O,"max-height",e[1]?e[1]+"px":"auto")},m(t,a){_t(t,O,a),e[11](O)},p(t,[a]){a&1&&OO(O,"min-height",t[0]?t[0]+"px":null),a&2&&OO(O,"max-height",t[1]?t[1]+"px":"auto")},i:IO,o:IO,d(t){t&&jt(O),e[11](null)}}}function ms(e,O,t){let a;Yt(e,Vt,$=>t(12,a=$));const r=Wt();let{id:s=""}=O,{value:i=""}=O,{minHeight:l=null}=O,{maxHeight:o=null}=O,{disabled:c=!1}=O,{placeholder:h=""}=O,{language:Q="javascript"}=O,{singleLine:f=!1}=O,p,d,P=new eO,S=new eO,k=new eO,X=new eO;function v(){p==null||p.focus()}function H(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:i},bubbles:!0})),r("change",i)}function EO(){if(!s)return;const $=document.querySelectorAll('[for="'+s+'"]');for(let m of $)m.removeEventListener("click",v)}function AO(){if(!s)return;EO();const $=document.querySelectorAll('[for="'+s+'"]');for(let m of $)m.addEventListener("click",v)}function MO(){switch(Q){case"html":return Xi();case"json":return qi();case"sql-create-index":return Re({dialect:N.define({keywords:"create unique index if not exists on collate asc desc where like isnull notnull date time datetime unixepoch strftime lower upper substr case when then iif if else json_extract json_each json_tree json_array_length json_valid ",operatorChars:"*+-%<>!=&|/~",identifierQuotes:'`"',specialVar:"@:?$"}),upperCaseKeywords:!0});case"sql-select":let $={};for(let m of a)$[m.name]=Gt.getAllCollectionIdentifiers(m);return Re({dialect:N.define({keywords:"select distinct from where having group by order limit offset join left right inner with like not in match asc desc regexp isnull notnull glob count avg sum min max current random cast as int real text bool date time datetime unixepoch strftime coalesce lower upper substr case when then iif if else json_extract json_each json_tree json_array_length json_valid ",operatorChars:"*+-%<>!=&|/~",identifierQuotes:'`"',specialVar:"@:?$"}),schema:$,upperCaseKeywords:!0});default:return pt()}}Ut(()=>{const $={key:"Enter",run:m=>{f&&r("submit",i)}};return AO(),t(10,p=new j({parent:d,state:C.create({doc:i,extensions:[Jt(),Kt(),Ft(),Ht(),Oa(),C.allowMultipleSelections.of(!0),ea(ta,{fallback:!0}),aa(),ra(),ia(),sa(),la.of([$,...na,...oa,Qa.find(m=>m.key==="Mod-d"),...ca,...pa]),j.lineWrapping,ha({icons:!1}),P.of(MO()),X.of(DO(h)),S.of(j.editable.of(!0)),k.of(C.readOnly.of(!1)),C.transactionFilter.of(m=>{var LO,BO,NO;if(f&&m.newDoc.lines>1){if(!((NO=(BO=(LO=m.changes)==null?void 0:LO.inserted)==null?void 0:BO.filter(Xt=>!!Xt.text.find(yt=>yt)))!=null&&NO.length))return[];m.newDoc.text=[m.newDoc.text.join(" ")]}return m}),j.updateListener.of(m=>{!m.docChanged||c||(t(3,i=m.state.doc.toString()),H())})]})})),()=>{EO(),p==null||p.destroy()}});function kt($){zt[$?"unshift":"push"](()=>{d=$,t(2,d)})}return e.$$set=$=>{"id"in $&&t(4,s=$.id),"value"in $&&t(3,i=$.value),"minHeight"in $&&t(0,l=$.minHeight),"maxHeight"in $&&t(1,o=$.maxHeight),"disabled"in $&&t(5,c=$.disabled),"placeholder"in $&&t(6,h=$.placeholder),"language"in $&&t(7,Q=$.language),"singleLine"in $&&t(8,f=$.singleLine)},e.$$.update=()=>{e.$$.dirty&16&&s&&AO(),e.$$.dirty&1152&&p&&Q&&p.dispatch({effects:[P.reconfigure(MO())]}),e.$$.dirty&1056&&p&&typeof c<"u"&&p.dispatch({effects:[S.reconfigure(j.editable.of(!c)),k.reconfigure(C.readOnly.of(c))]}),e.$$.dirty&1032&&p&&i!=p.state.doc.toString()&&p.dispatch({changes:{from:0,to:p.state.doc.length,insert:i}}),e.$$.dirty&1088&&p&&typeof h<"u"&&p.dispatch({effects:[X.reconfigure(DO(h))]})},[l,o,d,i,s,c,h,Q,f,v,p,kt]}class bs extends wt{constructor(O){super(),Tt(this,O,ms,Ss,vt,{id:4,value:3,minHeight:0,maxHeight:1,disabled:5,placeholder:6,language:7,singleLine:8,focus:9})}get focus(){return this.$$.ctx[9]}}export{bs as default}; diff --git a/ui/dist/assets/CodeEditor-Dl2IHbSx.js b/ui/dist/assets/CodeEditor-Dl2IHbSx.js deleted file mode 100644 index 015c5dbf..00000000 --- a/ui/dist/assets/CodeEditor-Dl2IHbSx.js +++ /dev/null @@ -1,14 +0,0 @@ -import{S as wt,i as vt,s as qt,h as Yt,k as Tt,a1 as OO,n as Rt,I as IO,v as Vt,O as _t,T as jt,U as zt,Q as Gt,J as Ut,y as Ct}from"./index-rWxFAXsK.js";import{P as Wt,N as At,w as Et,D as Mt,x as VO,T as tO,I as _O,y as I,z as o,A as Lt,L as B,B as K,F as _,G as J,H as jO,J as F,v as C,K as Re,M as Nt,O as Dt,Q as Ve,R as _e,U as je,E as V,V as ze,W as g,X as It,Y as Bt,b as W,e as Kt,f as Jt,g as Ft,i as Ht,j as Oa,k as ea,u as ta,l as aa,m as ra,r as ia,n as sa,o as la,c as oa,d as na,s as ca,h as Qa,a as ha,p as ua,q as BO,C as eO}from"./index-C-PlLH2L.js";var KO={};class sO{constructor(O,t,a,r,s,i,l,n,Q,u=0,c){this.p=O,this.stack=t,this.state=a,this.reducePos=r,this.pos=s,this.score=i,this.buffer=l,this.bufferBase=n,this.curContext=Q,this.lookAhead=u,this.parent=c}toString(){return`[${this.stack.filter((O,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(O,t,a=0){let r=O.parser.context;return new sO(O,[],t,a,a,0,[],0,r?new JO(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(O,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=O}reduce(O){var t;let a=O>>19,r=O&65535,{parser:s}=this.p,i=this.reducePos=2e3&&!(!((t=this.p.parser.nodeSet.types[r])===null||t===void 0)&&t.isAnonymous)&&(Q==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSizen;)this.stack.pop();this.reduceContext(r,Q)}storeNode(O,t,a,r=4,s=!1){if(O==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&i.buffer[l-4]==0&&i.buffer[l-1]>-1){if(t==a)return;if(i.buffer[l-2]>=t){i.buffer[l-2]=a;return}}}if(!s||this.pos==a)this.buffer.push(O,t,a,r);else{let i=this.buffer.length;if(i>0&&this.buffer[i-4]!=0){let l=!1;for(let n=i;n>0&&this.buffer[n-2]>a;n-=4)if(this.buffer[n-1]>=0){l=!0;break}if(l)for(;i>0&&this.buffer[i-2]>a;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4)}this.buffer[i]=O,this.buffer[i+1]=t,this.buffer[i+2]=a,this.buffer[i+3]=r}}shift(O,t,a,r){if(O&131072)this.pushState(O&65535,this.pos);else if(O&262144)this.pos=r,this.shiftContext(t,a),t<=this.p.parser.maxNode&&this.buffer.push(t,a,r,4);else{let s=O,{parser:i}=this.p;(r>this.pos||t<=i.maxNode)&&(this.pos=r,i.stateFlag(s,1)||(this.reducePos=r)),this.pushState(s,a),this.shiftContext(t,a),t<=i.maxNode&&this.buffer.push(t,a,r,4)}}apply(O,t,a,r){O&65536?this.reduce(O):this.shift(O,t,a,r)}useNode(O,t){let a=this.p.reused.length-1;(a<0||this.p.reused[a]!=O)&&(this.p.reused.push(O),a++);let r=this.pos;this.reducePos=this.pos=r+O.length,this.pushState(t,r),this.buffer.push(a,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,O,this,this.p.stream.reset(this.pos-O.length)))}split(){let O=this,t=O.buffer.length;for(;t>0&&O.buffer[t-2]>O.reducePos;)t-=4;let a=O.buffer.slice(t),r=O.bufferBase+t;for(;O&&r==O.bufferBase;)O=O.parent;return new sO(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,a,r,this.curContext,this.lookAhead,O)}recoverByDelete(O,t){let a=O<=this.p.parser.maxNode;a&&this.storeNode(O,this.pos,t,4),this.storeNode(0,this.pos,t,a?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(O){for(let t=new pa(this);;){let a=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,O);if(a==0)return!1;if(!(a&65536))return!0;t.reduce(a)}}recoverByInsert(O){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let r=[];for(let s=0,i;sn&1&&l==i)||r.push(t[s],i)}t=r}let a=[];for(let r=0;r>19,r=t&65535,s=this.stack.length-a*3;if(s<0||O.getGoto(this.stack[s],r,!1)<0){let i=this.findForcedReduction();if(i==null)return!1;t=i}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:O}=this.p,t=[],a=(r,s)=>{if(!t.includes(r))return t.push(r),O.allActions(r,i=>{if(!(i&393216))if(i&65536){let l=(i>>19)-s;if(l>1){let n=i&65535,Q=this.stack.length-l*3;if(Q>=0&&O.getGoto(this.stack[Q],n,!1)>=0)return l<<19|65536|n}}else{let l=a(i,s+1);if(l!=null)return l}})};return a(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:O}=this.p;return O.data[O.stateSlot(this.state,1)]==65535&&!O.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(O){if(this.state!=O.state||this.stack.length!=O.stack.length)return!1;for(let t=0;tthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=O)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class JO{constructor(O,t){this.tracker=O,this.context=t,this.hash=O.strict?O.hash(t):0}}class pa{constructor(O){this.start=O,this.state=O.state,this.stack=O.stack,this.base=this.stack.length}reduce(O){let t=O&65535,a=O>>19;a==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(a-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}}class lO{constructor(O,t,a){this.stack=O,this.pos=t,this.index=a,this.buffer=O.buffer,this.index==0&&this.maybeNext()}static create(O,t=O.bufferBase+O.buffer.length){return new lO(O,t,t-O.bufferBase)}maybeNext(){let O=this.stack.parent;O!=null&&(this.index=this.stack.bufferBase-O.bufferBase,this.stack=O,this.buffer=O.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new lO(this.stack,this.pos,this.index)}}function M(e,O=Uint16Array){if(typeof e!="string")return e;let t=null;for(let a=0,r=0;a=92&&i--,i>=34&&i--;let n=i-32;if(n>=46&&(n-=46,l=!0),s+=n,l)break;s*=46}t?t[r++]=s:t=new O(s)}return t}class aO{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const FO=new aO;class fa{constructor(O,t){this.input=O,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=FO,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(O,t){let a=this.range,r=this.rangeIndex,s=this.pos+O;for(;sa.to:s>=a.to;){if(r==this.ranges.length-1)return null;let i=this.ranges[++r];s+=i.from-a.to,a=i}return s}clipPos(O){if(O>=this.range.from&&OO)return Math.max(O,t.from);return this.end}peek(O){let t=this.chunkOff+O,a,r;if(t>=0&&t=this.chunk2Pos&&al.to&&(this.chunk2=this.chunk2.slice(0,l.to-a)),r=this.chunk2.charCodeAt(0)}}return a>=this.token.lookAhead&&(this.token.lookAhead=a+1),r}acceptToken(O,t=0){let a=t?this.resolveOffset(t,-1):this.pos;if(a==null||a=this.chunk2Pos&&this.posthis.range.to?O.slice(0,this.range.to-this.pos):O,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(O=1){for(this.chunkOff+=O;this.pos+O>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();O-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=O,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(O,t){if(t?(this.token=t,t.start=O,t.lookAhead=O+1,t.value=t.extended=-1):this.token=FO,this.pos!=O){if(this.pos=O,O==this.end)return this.setDone(),this;for(;O=this.range.to;)this.range=this.ranges[++this.rangeIndex];O>=this.chunkPos&&O=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(O-this.chunkPos,t-this.chunkPos);if(O>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(O-this.chunk2Pos,t-this.chunk2Pos);if(O>=this.range.from&&t<=this.range.to)return this.input.read(O,t);let a="";for(let r of this.ranges){if(r.from>=t)break;r.to>O&&(a+=this.input.read(Math.max(r.from,O),Math.min(r.to,t)))}return a}}class z{constructor(O,t){this.data=O,this.id=t}token(O,t){let{parser:a}=t.p;Ge(this.data,O,t,this.id,a.data,a.tokenPrecTable)}}z.prototype.contextual=z.prototype.fallback=z.prototype.extend=!1;class oO{constructor(O,t,a){this.precTable=t,this.elseToken=a,this.data=typeof O=="string"?M(O):O}token(O,t){let a=O.pos,r=0;for(;;){let s=O.next<0,i=O.resolveOffset(1,1);if(Ge(this.data,O,t,0,this.data,this.precTable),O.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,i==null)break;O.reset(i,O.token)}r&&(O.reset(a,O.token),O.acceptToken(this.elseToken,r))}}oO.prototype.contextual=z.prototype.fallback=z.prototype.extend=!1;class x{constructor(O,t={}){this.token=O,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function Ge(e,O,t,a,r,s){let i=0,l=1<0){let f=e[h];if(n.allows(f)&&(O.token.value==-1||O.token.value==f||da(f,O.token.value,r,s))){O.acceptToken(f);break}}let u=O.next,c=0,d=e[i+2];if(O.next<0&&d>c&&e[Q+d*3-3]==65535){i=e[Q+d*3-1];continue O}for(;c>1,f=Q+h+(h<<1),P=e[f],S=e[f+1]||65536;if(u=S)c=h+1;else{i=e[f+2],O.advance();continue O}}break}}function HO(e,O,t){for(let a=O,r;(r=e[a])!=65535;a++)if(r==t)return a-O;return-1}function da(e,O,t,a){let r=HO(t,a,O);return r<0||HO(t,a,e)O)&&!a.type.isError)return t<0?Math.max(0,Math.min(a.to-1,O-25)):Math.min(e.length,Math.max(a.from+1,O+25));if(t<0?a.prevSibling():a.nextSibling())break;if(!a.parent())return t<0?0:e.length}}class $a{constructor(O,t){this.fragments=O,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let O=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(O){for(this.safeFrom=O.openStart?Oe(O.tree,O.from+O.offset,1)-O.offset:O.from,this.safeTo=O.openEnd?Oe(O.tree,O.to+O.offset,-1)-O.offset:O.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(O.tree),this.start.push(-O.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(O){if(OO)return this.nextStart=i,null;if(s instanceof tO){if(i==O){if(i=Math.max(this.safeFrom,O)&&(this.trees.push(s),this.start.push(i),this.index.push(0))}else this.index[t]++,this.nextStart=i+s.length}}}class Pa{constructor(O,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=O.tokenizers.map(a=>new aO)}getActions(O){let t=0,a=null,{parser:r}=O.p,{tokenizers:s}=r,i=r.stateSlot(O.state,3),l=O.curContext?O.curContext.hash:0,n=0;for(let Q=0;Qc.end+25&&(n=Math.max(c.lookAhead,n)),c.value!=0)){let d=t;if(c.extended>-1&&(t=this.addActions(O,c.extended,c.end,t)),t=this.addActions(O,c.value,c.end,t),!u.extend&&(a=c,t>d))break}}for(;this.actions.length>t;)this.actions.pop();return n&&O.setLookAhead(n),!a&&O.pos==this.stream.end&&(a=new aO,a.value=O.p.parser.eofTerm,a.start=a.end=O.pos,t=this.addActions(O,a.value,a.end,t)),this.mainToken=a,this.actions}getMainToken(O){if(this.mainToken)return this.mainToken;let t=new aO,{pos:a,p:r}=O;return t.start=a,t.end=Math.min(a+1,r.stream.end),t.value=a==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(O,t,a){let r=this.stream.clipPos(a.pos);if(t.token(this.stream.reset(r,O),a),O.value>-1){let{parser:s}=a.p;for(let i=0;i=0&&a.p.parser.dialect.allows(l>>1)){l&1?O.extended=l>>1:O.value=l>>1;break}}}else O.value=0,O.end=this.stream.clipPos(r+1)}putAction(O,t,a,r){for(let s=0;sO.bufferLength*4?new $a(a,O.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let O=this.stacks,t=this.minStackPos,a=this.stacks=[],r,s;if(this.bigReductionCount>300&&O.length==1){let[i]=O;for(;i.forceReduce()&&i.stack.length&&i.stack[i.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let i=0;it)a.push(l);else{if(this.advanceStack(l,a,O))continue;{r||(r=[],s=[]),r.push(l);let n=this.tokens.getMainToken(l);s.push(n.value,n.end)}}break}}if(!a.length){let i=r&&ga(r);if(i)return Z&&console.log("Finish with "+this.stackID(i)),this.stackToTree(i);if(this.parser.strict)throw Z&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&r){let i=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,a);if(i)return Z&&console.log("Force-finish "+this.stackID(i)),this.stackToTree(i.forceAll())}if(this.recovering){let i=this.recovering==1?1:this.recovering*3;if(a.length>i)for(a.sort((l,n)=>n.score-l.score);a.length>i;)a.pop();a.some(l=>l.reducePos>t)&&this.recovering--}else if(a.length>1){O:for(let i=0;i500&&Q.buffer.length>500)if((l.score-Q.score||l.buffer.length-Q.buffer.length)>0)a.splice(n--,1);else{a.splice(i--,1);continue O}}}a.length>12&&a.splice(12,a.length-12)}this.minStackPos=a[0].pos;for(let i=1;i ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return O.forceReduce()?O:null;if(this.fragments){let Q=O.curContext&&O.curContext.tracker.strict,u=Q?O.curContext.hash:0;for(let c=this.fragments.nodeAt(r);c;){let d=this.parser.nodeSet.types[c.type.id]==c.type?s.getGoto(O.state,c.type.id):-1;if(d>-1&&c.length&&(!Q||(c.prop(VO.contextHash)||0)==u))return O.useNode(c,d),Z&&console.log(i+this.stackID(O)+` (via reuse of ${s.getName(c.type.id)})`),!0;if(!(c instanceof tO)||c.children.length==0||c.positions[0]>0)break;let h=c.children[0];if(h instanceof tO&&c.positions[0]==0)c=h;else break}}let l=s.stateSlot(O.state,4);if(l>0)return O.reduce(l),Z&&console.log(i+this.stackID(O)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(O.stack.length>=8400)for(;O.stack.length>6e3&&O.forceReduce(););let n=this.tokens.getActions(O);for(let Q=0;Qr?t.push(f):a.push(f)}return!1}advanceFully(O,t){let a=O.pos;for(;;){if(!this.advanceStack(O,null,null))return!1;if(O.pos>a)return ee(O,t),!0}}runRecovery(O,t,a){let r=null,s=!1;for(let i=0;i ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),Z&&console.log(u+this.stackID(l)+" (restarted)"),this.advanceFully(l,a))))continue;let c=l.split(),d=u;for(let h=0;c.forceReduce()&&h<10&&(Z&&console.log(d+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,a));h++)Z&&(d=this.stackID(c)+" -> ");for(let h of l.recoverByInsert(n))Z&&console.log(u+this.stackID(h)+" (via recover-insert)"),this.advanceFully(h,a);this.stream.end>l.pos?(Q==l.pos&&(Q++,n=0),l.recoverByDelete(n,Q),Z&&console.log(u+this.stackID(l)+` (via recover-delete ${this.parser.getName(n)})`),ee(l,a)):(!r||r.scoree;class Ue{constructor(O){this.start=O.start,this.shift=O.shift||fO,this.reduce=O.reduce||fO,this.reuse=O.reuse||fO,this.hash=O.hash||(()=>0),this.strict=O.strict!==!1}}class Y extends Wt{constructor(O){if(super(),this.wrappers=[],O.version!=14)throw new RangeError(`Parser version (${O.version}) doesn't match runtime version (14)`);let t=O.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let l=0;lO.topRules[l][1]),r=[];for(let l=0;l=0)s(u,n,l[Q++]);else{let c=l[Q+-u];for(let d=-u;d>0;d--)s(l[Q++],n,c);Q++}}}this.nodeSet=new At(t.map((l,n)=>Et.define({name:n>=this.minRepeatTerm?void 0:l,id:n,props:r[n],top:a.indexOf(n)>-1,error:n==0,skipped:O.skippedNodes&&O.skippedNodes.indexOf(n)>-1}))),O.propSources&&(this.nodeSet=this.nodeSet.extend(...O.propSources)),this.strict=!1,this.bufferLength=Mt;let i=M(O.tokenData);this.context=O.context,this.specializerSpecs=O.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l=="number"?new z(i,l):l),this.topRules=O.topRules,this.dialects=O.dialects||{},this.dynamicPrecedences=O.dynamicPrecedences||null,this.tokenPrecTable=O.tokenPrec,this.termNames=O.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(O,t,a){let r=new Sa(this,O,t,a);for(let s of this.wrappers)r=s(r,O,t,a);return r}getGoto(O,t,a=!1){let r=this.goto;if(t>=r[0])return-1;for(let s=r[t+1];;){let i=r[s++],l=i&1,n=r[s++];if(l&&a)return n;for(let Q=s+(i>>1);s0}validAction(O,t){return!!this.allActions(O,a=>a==t?!0:null)}allActions(O,t){let a=this.stateSlot(O,4),r=a?t(a):void 0;for(let s=this.stateSlot(O,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=v(this.data,s+2);else break;r=t(v(this.data,s+1))}return r}nextStates(O){let t=[];for(let a=this.stateSlot(O,1);;a+=3){if(this.data[a]==65535)if(this.data[a+1]==1)a=v(this.data,a+2);else break;if(!(this.data[a+2]&1)){let r=this.data[a+1];t.some((s,i)=>i&1&&s==r)||t.push(this.data[a],r)}}return t}configure(O){let t=Object.assign(Object.create(Y.prototype),this);if(O.props&&(t.nodeSet=this.nodeSet.extend(...O.props)),O.top){let a=this.topRules[O.top];if(!a)throw new RangeError(`Invalid top rule name ${O.top}`);t.top=a}return O.tokenizers&&(t.tokenizers=this.tokenizers.map(a=>{let r=O.tokenizers.find(s=>s.from==a);return r?r.to:a})),O.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((a,r)=>{let s=O.specializers.find(l=>l.from==a.external);if(!s)return a;let i=Object.assign(Object.assign({},a),{external:s.to});return t.specializers[r]=te(i),i})),O.contextTracker&&(t.context=O.contextTracker),O.dialect&&(t.dialect=this.parseDialect(O.dialect)),O.strict!=null&&(t.strict=O.strict),O.wrap&&(t.wrappers=t.wrappers.concat(O.wrap)),O.bufferLength!=null&&(t.bufferLength=O.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(O){return this.termNames?this.termNames[O]:String(O<=this.maxNode&&this.nodeSet.types[O].name||O)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(O){let t=this.dynamicPrecedences;return t==null?0:t[O]||0}parseDialect(O){let t=Object.keys(this.dialects),a=t.map(()=>!1);if(O)for(let s of O.split(" ")){let i=t.indexOf(s);i>=0&&(a[i]=!0)}let r=null;for(let s=0;sa)&&t.p.parser.stateFlag(t.state,2)&&(!O||O.scoree.external(t,a)<<1|O}return e.get}const Za=54,ba=1,xa=55,ka=2,Xa=56,ya=3,ae=4,wa=5,nO=6,Ce=7,We=8,Ae=9,Ee=10,va=11,qa=12,Ya=13,dO=57,Ta=14,re=58,Me=20,Ra=22,Le=23,Va=24,XO=26,Ne=27,_a=28,ja=31,za=34,Ga=36,Ua=37,Ca=0,Wa=1,Aa={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},Ea={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},ie={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function Ma(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}function De(e){return e==9||e==10||e==13||e==32}let se=null,le=null,oe=0;function yO(e,O){let t=e.pos+O;if(oe==t&&le==e)return se;let a=e.peek(O);for(;De(a);)a=e.peek(++O);let r="";for(;Ma(a);)r+=String.fromCharCode(a),a=e.peek(++O);return le=e,oe=t,se=r?r.toLowerCase():a==La||a==Na?void 0:null}const Ie=60,cO=62,zO=47,La=63,Na=33,Da=45;function ne(e,O){this.name=e,this.parent=O}const Ia=[nO,Ee,Ce,We,Ae],Ba=new Ue({start:null,shift(e,O,t,a){return Ia.indexOf(O)>-1?new ne(yO(a,1)||"",e):e},reduce(e,O){return O==Me&&e?e.parent:e},reuse(e,O,t,a){let r=O.type.id;return r==nO||r==Ga?new ne(yO(a,1)||"",e):e},strict:!1}),Ka=new x((e,O)=>{if(e.next!=Ie){e.next<0&&O.context&&e.acceptToken(dO);return}e.advance();let t=e.next==zO;t&&e.advance();let a=yO(e,0);if(a===void 0)return;if(!a)return e.acceptToken(t?Ta:nO);let r=O.context?O.context.name:null;if(t){if(a==r)return e.acceptToken(va);if(r&&Ea[r])return e.acceptToken(dO,-2);if(O.dialectEnabled(Ca))return e.acceptToken(qa);for(let s=O.context;s;s=s.parent)if(s.name==a)return;e.acceptToken(Ya)}else{if(a=="script")return e.acceptToken(Ce);if(a=="style")return e.acceptToken(We);if(a=="textarea")return e.acceptToken(Ae);if(Aa.hasOwnProperty(a))return e.acceptToken(Ee);r&&ie[r]&&ie[r][a]?e.acceptToken(dO,-1):e.acceptToken(nO)}},{contextual:!0}),Ja=new x(e=>{for(let O=0,t=0;;t++){if(e.next<0){t&&e.acceptToken(re);break}if(e.next==Da)O++;else if(e.next==cO&&O>=2){t>=3&&e.acceptToken(re,-2);break}else O=0;e.advance()}});function Fa(e){for(;e;e=e.parent)if(e.name=="svg"||e.name=="math")return!0;return!1}const Ha=new x((e,O)=>{if(e.next==zO&&e.peek(1)==cO){let t=O.dialectEnabled(Wa)||Fa(O.context);e.acceptToken(t?wa:ae,2)}else e.next==cO&&e.acceptToken(ae,1)});function GO(e,O,t){let a=2+e.length;return new x(r=>{for(let s=0,i=0,l=0;;l++){if(r.next<0){l&&r.acceptToken(O);break}if(s==0&&r.next==Ie||s==1&&r.next==zO||s>=2&&si?r.acceptToken(O,-i):r.acceptToken(t,-(i-2));break}else if((r.next==10||r.next==13)&&l){r.acceptToken(O,1);break}else s=i=0;r.advance()}})}const Or=GO("script",Za,ba),er=GO("style",xa,ka),tr=GO("textarea",Xa,ya),ar=I({"Text RawText":o.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":o.angleBracket,TagName:o.tagName,"MismatchedCloseTag/TagName":[o.tagName,o.invalid],AttributeName:o.attributeName,"AttributeValue UnquotedAttributeValue":o.attributeValue,Is:o.definitionOperator,"EntityReference CharacterReference":o.character,Comment:o.blockComment,ProcessingInst:o.processingInstruction,DoctypeDecl:o.documentMeta}),rr=Y.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%ZQ&rO,59fO%fQ&rO,59iO%qQ&rO,59lO%|Q&rO,59nOOOa'#D^'#D^O&XOaO'#CxO&dOaO,59[OOOb'#D_'#D_O&lObO'#C{O&wObO,59[OOOd'#D`'#D`O'POdO'#DOO'[OdO,59[OOO`'#Da'#DaO'dO!rO,59[O'kQ#tO'#DROOO`,59[,59[OOOp'#Db'#DbO'pO$fO,59oOOO`,59o,59oO'xQ#|O,59qO'}Q#|O,59rOOO`-E7W-E7WO(SQ&rO'#CsOOQW'#DZ'#DZO(bQ&rO1G.wOOOa1G.w1G.wOOO`1G/Y1G/YO(mQ&rO1G/QOOOb1G/Q1G/QO(xQ&rO1G/TOOOd1G/T1G/TO)TQ&rO1G/WOOO`1G/W1G/WO)`Q&rO1G/YOOOa-E7[-E7[O)kQ#tO'#CyOOO`1G.v1G.vOOOb-E7]-E7]O)pQ#tO'#C|OOOd-E7^-E7^O)uQ#tO'#DPOOO`-E7_-E7_O)zQ#|O,59mOOOp-E7`-E7`OOO`1G/Z1G/ZOOO`1G/]1G/]OOO`1G/^1G/^O*PQ,UO,59_OOQW-E7X-E7XOOOa7+$c7+$cOOO`7+$t7+$tOOOb7+$l7+$lOOOd7+$o7+$oOOO`7+$r7+$rO*[Q#|O,59eO*aQ#|O,59hO*fQ#|O,59kOOO`1G/X1G/XO*kO7[O'#CvO*|OMhO'#CvOOQW1G.y1G.yOOO`1G/P1G/POOO`1G/S1G/SOOO`1G/V1G/VOOOO'#D['#D[O+_O7[O,59bOOQW,59b,59bOOOO'#D]'#D]O+pOMhO,59bOOOO-E7Y-E7YOOQW1G.|1G.|OOOO-E7Z-E7Z",stateData:",]~O!^OS~OUSOVPOWQOXROYTO[]O][O^^O`^Oa^Ob^Oc^Ox^O{_O!dZO~OfaO~OfbO~OfcO~OfdO~OfeO~O!WfOPlP!ZlP~O!XiOQoP!ZoP~O!YlORrP!ZrP~OUSOVPOWQOXROYTOZqO[]O][O^^O`^Oa^Ob^Oc^Ox^O!dZO~O!ZrO~P#dO![sO!euO~OfvO~OfwO~OS|OT}OhyO~OS!POT}OhyO~OS!ROT}OhyO~OS!TOT}OhyO~OS}OT}OhyO~O!WfOPlX!ZlX~OP!WO!Z!XO~O!XiOQoX!ZoX~OQ!ZO!Z!XO~O!YlORrX!ZrX~OR!]O!Z!XO~O!Z!XO~P#dOf!_O~O![sO!e!aO~OS!bO~OS!cO~Oi!dOSgXTgXhgX~OS!fOT!gOhyO~OS!hOT!gOhyO~OS!iOT!gOhyO~OS!jOT!gOhyO~OS!gOT!gOhyO~Of!kO~Of!lO~Of!mO~OS!nO~Ok!qO!`!oO!b!pO~OS!rO~OS!sO~OS!tO~Oa!uOb!uOc!uO!`!wO!a!uO~Oa!xOb!xOc!xO!b!wO!c!xO~Oa!uOb!uOc!uO!`!{O!a!uO~Oa!xOb!xOc!xO!b!{O!c!xO~OT~bac!dx{!d~",goto:"%p!`PPPPPPPPPPPPPPPPPPPP!a!gP!mPP!yP!|#P#S#Y#]#`#f#i#l#r#x!aP!a!aP$O$U$l$r$x%O%U%[%bPPPPPPPP%hX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:67,context:Ba,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,21,30,33,36,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,29,32,35,37,"OpenTag"],["group",-9,14,17,18,19,20,39,40,41,42,"Entity",16,"Entity TextContent",-3,28,31,34,"TextContent Entity"],["isolate",-11,21,29,30,32,33,35,36,37,38,41,42,"ltr",-3,26,27,39,""]],propSources:[ar],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zbkWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOa!R!R7tP;=`<%l7S!Z8OYkWa!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{ihSkWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbhSkWa!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXhSa!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TakWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOb!R!RAwP;=`<%lAY!ZBRYkWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbhSkWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbhSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXhSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!bx`P!a`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYlhS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_khS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_X`P!a`!cp!eQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZhSfQ`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!a`!cpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!a`!cp!dPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!a`!cpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!a`!cpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!a`!cpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!a`!cpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!a`!cpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!a`!cpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!a`!cpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!cpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO{PP!-nP;=`<%l!-Sq!-xS!cp{POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!a`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!a`{POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!a`!cp{POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!a`!cpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!a`!cpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!a`!cpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!a`!cpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!a`!cpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!a`!cpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!cpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOxPP!7TP;=`<%l!6Vq!7]V!cpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!cpxPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!a`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!a`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!a`xPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!a`!cpxPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let Q=l.type.id;if(Q==_a)return $O(l,n,t);if(Q==ja)return $O(l,n,a);if(Q==za)return $O(l,n,r);if(Q==Me&&s.length){let u=l.node,c=u.firstChild,d=c&&ce(c,n),h;if(d){for(let f of s)if(f.tag==d&&(!f.attrs||f.attrs(h||(h=Be(c,n))))){let P=u.lastChild,S=P.type.id==Ua?P.from:u.to;if(S>c.to)return{parser:f.parser,overlay:[{from:c.to,to:S}]}}}}if(i&&Q==Le){let u=l.node,c;if(c=u.firstChild){let d=i[n.read(c.from,c.to)];if(d)for(let h of d){if(h.tagName&&h.tagName!=ce(u.parent,n))continue;let f=u.lastChild;if(f.type.id==XO){let P=f.from+1,S=f.lastChild,k=f.to-(S&&S.isError?0:1);if(k>P)return{parser:h.parser,overlay:[{from:P,to:k}]}}else if(f.type.id==Ne)return{parser:h.parser,overlay:[{from:f.from,to:f.to}]}}}}return null})}const ir=99,Qe=1,sr=100,lr=101,he=2,Je=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],or=58,nr=40,Fe=95,cr=91,rO=45,Qr=46,hr=35,ur=37,pr=38,fr=92,dr=10;function L(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function He(e){return e>=48&&e<=57}const $r=new x((e,O)=>{for(let t=!1,a=0,r=0;;r++){let{next:s}=e;if(L(s)||s==rO||s==Fe||t&&He(s))!t&&(s!=rO||r>0)&&(t=!0),a===r&&s==rO&&a++,e.advance();else if(s==fr&&e.peek(1)!=dr)e.advance(),e.next>-1&&e.advance(),t=!0;else{t&&e.acceptToken(s==nr?sr:a==2&&O.canShift(he)?he:lr);break}}}),Pr=new x(e=>{if(Je.includes(e.peek(-1))){let{next:O}=e;(L(O)||O==Fe||O==hr||O==Qr||O==cr||O==or&&L(e.peek(1))||O==rO||O==pr)&&e.acceptToken(ir)}}),Sr=new x(e=>{if(!Je.includes(e.peek(-1))){let{next:O}=e;if(O==ur&&(e.advance(),e.acceptToken(Qe)),L(O)){do e.advance();while(L(e.next)||He(e.next));e.acceptToken(Qe)}}}),mr=I({"AtKeyword import charset namespace keyframes media supports":o.definitionKeyword,"from to selector":o.keyword,NamespaceName:o.namespace,KeyframeName:o.labelName,KeyframeRangeName:o.operatorKeyword,TagName:o.tagName,ClassName:o.className,PseudoClassName:o.constant(o.className),IdName:o.labelName,"FeatureName PropertyName":o.propertyName,AttributeName:o.attributeName,NumberLiteral:o.number,KeywordQuery:o.keyword,UnaryQueryOp:o.operatorKeyword,"CallTag ValueName":o.atom,VariableName:o.variableName,Callee:o.operatorKeyword,Unit:o.unit,"UniversalSelector NestingSelector":o.definitionOperator,MatchOp:o.compareOperator,"ChildOp SiblingOp, LogicOp":o.logicOperator,BinOp:o.arithmeticOperator,Important:o.modifier,Comment:o.blockComment,ColorLiteral:o.color,"ParenthesizedContent StringLiteral":o.string,":":o.punctuation,"PseudoOp #":o.derefOperator,"; ,":o.separator,"( )":o.paren,"[ ]":o.squareBracket,"{ }":o.brace}),gr={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,"nth-last-of-type":32,dir:32,"host-context":32,url:60,"url-prefix":60,domain:60,regexp:60,selector:138},Zr={__proto__:null,"@import":118,"@media":142,"@charset":146,"@namespace":150,"@keyframes":156,"@supports":168},br={__proto__:null,not:132,only:132},xr=Y.deserialize({version:14,states:":jQYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$_QXO'#CaO$fQ[O'#ChO$qQ[O'#DTO$vQ[O'#DWOOQP'#Em'#EmO${QdO'#DgO%jQ[O'#DtO${QdO'#DvO%{Q[O'#DxO&WQ[O'#D{O&`Q[O'#ERO&nQ[O'#ETOOQS'#El'#ElOOQS'#EW'#EWQYQ[OOO&uQXO'#CdO'jQWO'#DcO'oQWO'#EsO'zQ[O'#EsQOQWOOP(UO#tO'#C_POOO)C@[)C@[OOQP'#Cg'#CgOOQP,59Q,59QO#kQ[O,59QO(aQ[O'#E[O({QWO,58{O)TQ[O,59SO$qQ[O,59oO$vQ[O,59rO(aQ[O,59uO(aQ[O,59wO(aQ[O,59xO)`Q[O'#DbOOQS,58{,58{OOQP'#Ck'#CkOOQO'#DR'#DROOQP,59S,59SO)gQWO,59SO)lQWO,59SOOQP'#DV'#DVOOQP,59o,59oOOQO'#DX'#DXO)qQ`O,59rOOQS'#Cp'#CpO${QdO'#CqO)yQvO'#CsO+ZQtO,5:ROOQO'#Cx'#CxO)lQWO'#CwO+oQWO'#CyO+tQ[O'#DOOOQS'#Ep'#EpOOQO'#Dj'#DjO+|Q[O'#DqO,[QWO'#EtO&`Q[O'#DoO,jQWO'#DrOOQO'#Eu'#EuO)OQWO,5:`O,oQpO,5:bOOQS'#Dz'#DzO,wQWO,5:dO,|Q[O,5:dOOQO'#D}'#D}O-UQWO,5:gO-ZQWO,5:mO-cQWO,5:oOOQS-E8U-E8UO-kQdO,59}O-{Q[O'#E^O.YQWO,5;_O.YQWO,5;_POOO'#EV'#EVP.eO#tO,58yPOOO,58y,58yOOQP1G.l1G.lO/[QXO,5:vOOQO-E8Y-E8YOOQS1G.g1G.gOOQP1G.n1G.nO)gQWO1G.nO)lQWO1G.nOOQP1G/Z1G/ZO/iQ`O1G/^O0SQXO1G/aO0jQXO1G/cO1QQXO1G/dO1hQWO,59|O1mQ[O'#DSO1tQdO'#CoOOQP1G/^1G/^O${QdO1G/^O1{QpO,59]OOQS,59_,59_O${QdO,59aO2TQWO1G/mOOQS,59c,59cO2YQ!bO,59eOOQS'#DP'#DPOOQS'#EY'#EYO2eQ[O,59jOOQS,59j,59jO2mQWO'#DjO2xQWO,5:VO2}QWO,5:]O&`Q[O,5:XO&`Q[O'#E_O3VQWO,5;`O3bQWO,5:ZO(aQ[O,5:^OOQS1G/z1G/zOOQS1G/|1G/|OOQS1G0O1G0OO3sQWO1G0OO3xQdO'#EOOOQS1G0R1G0ROOQS1G0X1G0XOOQS1G0Z1G0ZO4TQtO1G/iOOQO1G/i1G/iOOQO,5:x,5:xO4kQ[O,5:xOOQO-E8[-E8[O4xQWO1G0yPOOO-E8T-E8TPOOO1G.e1G.eOOQP7+$Y7+$YOOQP7+$x7+$xO${QdO7+$xOOQS1G/h1G/hO5TQXO'#ErO5[QWO,59nO5aQtO'#EXO6XQdO'#EoO6cQWO,59ZO6hQpO7+$xOOQS1G.w1G.wOOQS1G.{1G.{OOQS7+%X7+%XOOQS1G/P1G/PO6pQWO1G/POOQS-E8W-E8WOOQS1G/U1G/UO${QdO1G/qOOQO1G/w1G/wOOQO1G/s1G/sO6uQWO,5:yOOQO-E8]-E8]O7TQXO1G/xOOQS7+%j7+%jO7[QYO'#CsOOQO'#EQ'#EQO7gQ`O'#EPOOQO'#EP'#EPO7rQWO'#E`O7zQdO,5:jOOQS,5:j,5:jO8VQtO'#E]O${QdO'#E]O9WQdO7+%TOOQO7+%T7+%TOOQO1G0d1G0dO9kQpO<OAN>OO;]QdO,5:uOOQO-E8X-E8XOOQO<T![;'S%^;'S;=`%o<%lO%^l;TUo`Oy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^l;nYo`#e[Oy%^z!Q%^!Q![;g![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^l[[o`#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^n?VSt^Oy%^z;'S%^;'S;=`%o<%lO%^l?hWjWOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^n@VU#bQOy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^~@nTjWOy%^z{@}{;'S%^;'S;=`%o<%lO%^~AUSo`#[~Oy%^z;'S%^;'S;=`%o<%lO%^lAg[#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^bBbU]QOy%^z![%^![!]Bt!];'S%^;'S;=`%o<%lO%^bB{S^Qo`Oy%^z;'S%^;'S;=`%o<%lO%^nC^S!Y^Oy%^z;'S%^;'S;=`%o<%lO%^dCoS|SOy%^z;'S%^;'S;=`%o<%lO%^bDQU!OQOy%^z!`%^!`!aDd!a;'S%^;'S;=`%o<%lO%^bDkS!OQo`Oy%^z;'S%^;'S;=`%o<%lO%^bDzWOy%^z!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bEk[![Qo`Oy%^z}%^}!OEd!O!Q%^!Q![Ed![!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^nFfSq^Oy%^z;'S%^;'S;=`%o<%lO%^nFwSp^Oy%^z;'S%^;'S;=`%o<%lO%^bGWUOy%^z#b%^#b#cGj#c;'S%^;'S;=`%o<%lO%^bGoUo`Oy%^z#W%^#W#XHR#X;'S%^;'S;=`%o<%lO%^bHYS!bQo`Oy%^z;'S%^;'S;=`%o<%lO%^bHiUOy%^z#f%^#f#gHR#g;'S%^;'S;=`%o<%lO%^fIQS!TUOy%^z;'S%^;'S;=`%o<%lO%^nIcS!S^Oy%^z;'S%^;'S;=`%o<%lO%^fItU!RQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`JZP;=`<%l$}",tokenizers:[Pr,Sr,$r,1,2,3,4,new oO("m~RRYZ[z{a~~g~aO#^~~dP!P!Qg~lO#_~~",28,105)],topRules:{StyleSheet:[0,4],Styles:[1,86]},specialized:[{term:100,get:e=>gr[e]||-1},{term:58,get:e=>Zr[e]||-1},{term:101,get:e=>br[e]||-1}],tokenPrec:1219});let PO=null;function SO(){if(!PO&&typeof document=="object"&&document.body){let{style:e}=document.body,O=[],t=new Set;for(let a in e)a!="cssText"&&a!="cssFloat"&&typeof e[a]=="string"&&(/[A-Z]/.test(a)&&(a=a.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),t.has(a)||(O.push(a),t.add(a)));PO=O.sort().map(a=>({type:"property",label:a,apply:a+": "}))}return PO||[]}const ue=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(e=>({type:"class",label:e})),pe=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(e=>({type:"keyword",label:e})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(e=>({type:"constant",label:e}))),kr=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(e=>({type:"type",label:e})),Xr=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(e=>({type:"keyword",label:e})),w=/^(\w[\w-]*|-\w[\w-]*|)$/,yr=/^-(-[\w-]*)?$/;function wr(e,O){var t;if((e.name=="("||e.type.isError)&&(e=e.parent||e),e.name!="ArgList")return!1;let a=(t=e.parent)===null||t===void 0?void 0:t.firstChild;return(a==null?void 0:a.name)!="Callee"?!1:O.sliceString(a.from,a.to)=="var"}const fe=new Re,vr=["Declaration"];function qr(e){for(let O=e;;){if(O.type.isTop)return O;if(!(O=O.parent))return e}}function Ot(e,O,t){if(O.to-O.from>4096){let a=fe.get(O);if(a)return a;let r=[],s=new Set,i=O.cursor(_O.IncludeAnonymous);if(i.firstChild())do for(let l of Ot(e,i.node,t))s.has(l.label)||(s.add(l.label),r.push(l));while(i.nextSibling());return fe.set(O,r),r}else{let a=[],r=new Set;return O.cursor().iterate(s=>{var i;if(t(s)&&s.matchContext(vr)&&((i=s.node.nextSibling)===null||i===void 0?void 0:i.name)==":"){let l=e.sliceString(s.from,s.to);r.has(l)||(r.add(l),a.push({label:l,type:"variable"}))}}),a}}const Yr=e=>O=>{let{state:t,pos:a}=O,r=C(t).resolveInner(a,-1),s=r.type.isError&&r.from==r.to-1&&t.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:SO(),validFor:w};if(r.name=="ValueName")return{from:r.from,options:pe,validFor:w};if(r.name=="PseudoClassName")return{from:r.from,options:ue,validFor:w};if(e(r)||(O.explicit||s)&&wr(r,t.doc))return{from:e(r)||s?r.from:a,options:Ot(t.doc,qr(r),e),validFor:yr};if(r.name=="TagName"){for(let{parent:n}=r;n;n=n.parent)if(n.name=="Block")return{from:r.from,options:SO(),validFor:w};return{from:r.from,options:kr,validFor:w}}if(r.name=="AtKeyword")return{from:r.from,options:Xr,validFor:w};if(!O.explicit)return null;let i=r.resolve(a),l=i.childBefore(a);return l&&l.name==":"&&i.name=="PseudoClassSelector"?{from:a,options:ue,validFor:w}:l&&l.name==":"&&i.name=="Declaration"||i.name=="ArgList"?{from:a,options:pe,validFor:w}:i.name=="Block"||i.name=="Styles"?{from:a,options:SO(),validFor:w}:null},Tr=Yr(e=>e.name=="VariableName"),QO=B.define({name:"css",parser:xr.configure({props:[K.add({Declaration:_()}),J.add({"Block KeyframeList":jO})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function Rr(){return new F(QO,QO.data.of({autocomplete:Tr}))}const Vr=312,_r=313,de=1,jr=2,zr=3,Gr=4,Ur=314,Cr=316,Wr=317,Ar=5,Er=6,Mr=0,wO=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],et=125,Lr=59,vO=47,Nr=42,Dr=43,Ir=45,Br=60,Kr=44,Jr=63,Fr=46,Hr=91,Oi=new Ue({start:!1,shift(e,O){return O==Ar||O==Er||O==Cr?e:O==Wr},strict:!1}),ei=new x((e,O)=>{let{next:t}=e;(t==et||t==-1||O.context)&&e.acceptToken(Ur)},{contextual:!0,fallback:!0}),ti=new x((e,O)=>{let{next:t}=e,a;wO.indexOf(t)>-1||t==vO&&((a=e.peek(1))==vO||a==Nr)||t!=et&&t!=Lr&&t!=-1&&!O.context&&e.acceptToken(Vr)},{contextual:!0}),ai=new x((e,O)=>{e.next==Hr&&!O.context&&e.acceptToken(_r)},{contextual:!0}),ri=new x((e,O)=>{let{next:t}=e;if(t==Dr||t==Ir){if(e.advance(),t==e.next){e.advance();let a=!O.context&&O.canShift(de);e.acceptToken(a?de:jr)}}else t==Jr&&e.peek(1)==Fr&&(e.advance(),e.advance(),(e.next<48||e.next>57)&&e.acceptToken(zr))},{contextual:!0});function mO(e,O){return e>=65&&e<=90||e>=97&&e<=122||e==95||e>=192||!O&&e>=48&&e<=57}const ii=new x((e,O)=>{if(e.next!=Br||!O.dialectEnabled(Mr)||(e.advance(),e.next==vO))return;let t=0;for(;wO.indexOf(e.next)>-1;)e.advance(),t++;if(mO(e.next,!0)){for(e.advance(),t++;mO(e.next,!1);)e.advance(),t++;for(;wO.indexOf(e.next)>-1;)e.advance(),t++;if(e.next==Kr)return;for(let a=0;;a++){if(a==7){if(!mO(e.next,!0))return;break}if(e.next!="extends".charCodeAt(a))break;e.advance(),t++}}e.acceptToken(Gr,-t)}),si=I({"get set async static":o.modifier,"for while do if else switch try catch finally return throw break continue default case":o.controlKeyword,"in of await yield void typeof delete instanceof":o.operatorKeyword,"let var const using function class extends":o.definitionKeyword,"import export from":o.moduleKeyword,"with debugger as new":o.keyword,TemplateString:o.special(o.string),super:o.atom,BooleanLiteral:o.bool,this:o.self,null:o.null,Star:o.modifier,VariableName:o.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":o.function(o.variableName),VariableDefinition:o.definition(o.variableName),Label:o.labelName,PropertyName:o.propertyName,PrivatePropertyName:o.special(o.propertyName),"CallExpression/MemberExpression/PropertyName":o.function(o.propertyName),"FunctionDeclaration/VariableDefinition":o.function(o.definition(o.variableName)),"ClassDeclaration/VariableDefinition":o.definition(o.className),PropertyDefinition:o.definition(o.propertyName),PrivatePropertyDefinition:o.definition(o.special(o.propertyName)),UpdateOp:o.updateOperator,"LineComment Hashbang":o.lineComment,BlockComment:o.blockComment,Number:o.number,String:o.string,Escape:o.escape,ArithOp:o.arithmeticOperator,LogicOp:o.logicOperator,BitOp:o.bitwiseOperator,CompareOp:o.compareOperator,RegExp:o.regexp,Equals:o.definitionOperator,Arrow:o.function(o.punctuation),": Spread":o.punctuation,"( )":o.paren,"[ ]":o.squareBracket,"{ }":o.brace,"InterpolationStart InterpolationEnd":o.special(o.brace),".":o.derefOperator,", ;":o.separator,"@":o.meta,TypeName:o.typeName,TypeDefinition:o.definition(o.typeName),"type enum interface implements namespace module declare":o.definitionKeyword,"abstract global Privacy readonly override":o.modifier,"is keyof unique infer":o.operatorKeyword,JSXAttributeValue:o.attributeValue,JSXText:o.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":o.angleBracket,"JSXIdentifier JSXNameSpacedName":o.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":o.attributeName,"JSXBuiltin/JSXIdentifier":o.standard(o.tagName)}),li={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,extends:54,this:58,true:66,false:66,null:78,void:82,typeof:86,super:102,new:136,delete:148,yield:157,await:161,class:166,public:229,private:229,protected:229,readonly:231,instanceof:250,satisfies:253,in:254,const:256,import:290,keyof:345,unique:349,infer:355,is:391,abstract:411,implements:413,type:415,let:418,var:420,using:423,interface:429,enum:433,namespace:439,module:441,declare:445,global:449,for:468,of:477,while:480,with:484,do:488,if:492,else:494,switch:498,case:504,try:510,catch:514,finally:518,return:522,throw:526,break:530,continue:534,debugger:538},oi={__proto__:null,async:123,get:125,set:127,declare:189,public:191,private:191,protected:191,static:193,abstract:195,override:197,readonly:203,accessor:205,new:395},ni={__proto__:null,"<":187},ci=Y.deserialize({version:14,states:"$CdQ%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#D^O.QQlO'#DdO.bQlO'#DoO%[QlO'#DwO0fQlO'#EPOOQ!0Lf'#EX'#EXO1PQ`O'#EUOOQO'#Em'#EmOOQO'#Ih'#IhO1XQ`O'#GpO1dQ`O'#ElO1iQ`O'#ElO3hQ!0MxO'#JnO6[Q!0MxO'#JoO6uQ`O'#F[O6zQ,UO'#FsOOQ!0Lf'#Fe'#FeO7VO7dO'#FeO7eQMhO'#FzO9RQ`O'#FyOOQ!0Lf'#Jo'#JoOOQ!0Lb'#Jn'#JnO9WQ`O'#GtOOQ['#K['#K[O9cQ`O'#IUO9hQ!0LrO'#IVOOQ['#J['#J[OOQ['#IZ'#IZQ`QlOOQ`QlOOO9pQ!L^O'#DsO9wQlO'#D{O:OQlO'#D}O9^Q`O'#GpO:VQMhO'#CoO:eQ`O'#EkO:pQ`O'#EvO:uQMhO'#FdO;dQ`O'#GpOOQO'#K]'#K]O;iQ`O'#K]O;wQ`O'#GxO;wQ`O'#GyO;wQ`O'#G{O9^Q`O'#HOOVQ`O'#CeO>gQ`O'#H_O>oQ`O'#HeO>oQ`O'#HgO`QlO'#HiO>oQ`O'#HkO>oQ`O'#HnO>tQ`O'#HtO>yQ!0LsO'#HzO%[QlO'#H|O?UQ!0LsO'#IOO?aQ!0LsO'#IQO9hQ!0LrO'#ISO?lQ!0MxO'#CiO@nQpO'#DiQOQ`OOO%[QlO'#D}OAUQ`O'#EQO:VQMhO'#EkOAaQ`O'#EkOAlQ!bO'#FdOOQ['#Cg'#CgOOQ!0Lb'#Dn'#DnOOQ!0Lb'#Jr'#JrO%[QlO'#JrOOQO'#Ju'#JuOOQO'#Id'#IdOBlQpO'#EdOOQ!0Lb'#Ec'#EcOOQ!0Lb'#Jy'#JyOChQ!0MSO'#EdOCrQpO'#ETOOQO'#Jt'#JtODWQpO'#JuOEeQpO'#ETOCrQpO'#EdPErO&2DjO'#CbPOOO)CDy)CDyOOOO'#I['#I[OE}O#tO,59UOOQ!0Lh,59U,59UOOOO'#I]'#I]OF]O&jO,59UOFkQ!L^O'#D`OOOO'#I_'#I_OFrO#@ItO,59xOOQ!0Lf,59x,59xOGQQlO'#I`OGeQ`O'#JpOIdQ!fO'#JpO+}QlO'#JpOIkQ`O,5:OOJRQ`O'#EmOJ`Q`O'#KPOJkQ`O'#KOOJkQ`O'#KOOJsQ`O,5;ZOJxQ`O'#J}OOQ!0Ln,5:Z,5:ZOKPQlO,5:ZOL}Q!0MxO,5:cOMnQ`O,5:kONXQ!0LrO'#J|ON`Q`O'#J{O9WQ`O'#J{ONtQ`O'#J{ON|Q`O,5;YO! RQ`O'#J{O!#WQ!fO'#JoOOQ!0Lh'#Ci'#CiO%[QlO'#EPO!#vQ!fO,5:pOOQS'#Jv'#JvOOQO-EpOOQ['#Jd'#JdOOQ[,5>q,5>qOOQ[-E[Q!0MxO,5:gO%[QlO,5:gO!@rQ!0MxO,5:iOOQO,5@w,5@wO!AcQMhO,5=[O!AqQ!0LrO'#JeO9RQ`O'#JeO!BSQ!0LrO,59ZO!B_QpO,59ZO!BgQMhO,59ZO:VQMhO,59ZO!BrQ`O,5;WO!BzQ`O'#H^O!C`Q`O'#KaO%[QlO,5;|O!9fQpO,5tQ`O'#HTO9^Q`O'#HVO!DwQ`O'#HVO:VQMhO'#HXO!D|Q`O'#HXOOQ[,5=m,5=mO!ERQ`O'#HYO!EdQ`O'#CoO!EiQ`O,59PO!EsQ`O,59PO!GxQlO,59POOQ[,59P,59PO!HYQ!0LrO,59PO%[QlO,59PO!JeQlO'#HaOOQ['#Hb'#HbOOQ['#Hc'#HcO`QlO,5=yO!J{Q`O,5=yO`QlO,5>PO`QlO,5>RO!KQQ`O,5>TO`QlO,5>VO!KVQ`O,5>YO!K[QlO,5>`OOQ[,5>f,5>fO%[QlO,5>fO9hQ!0LrO,5>hOOQ[,5>j,5>jO# fQ`O,5>jOOQ[,5>l,5>lO# fQ`O,5>lOOQ[,5>n,5>nO#!SQpO'#D[O%[QlO'#JrO#!uQpO'#JrO##PQpO'#DjO##bQpO'#DjO#%sQlO'#DjO#%zQ`O'#JqO#&SQ`O,5:TO#&XQ`O'#EqO#&gQ`O'#KQO#&oQ`O,5;[O#&tQpO'#DjO#'RQpO'#ESOOQ!0Lf,5:l,5:lO%[QlO,5:lO#'YQ`O,5:lO>tQ`O,5;VO!B_QpO,5;VO!BgQMhO,5;VO:VQMhO,5;VO#'bQ`O,5@^O#'gQ07dO,5:pOOQO-EzO+}QlO,5>zOOQO,5?Q,5?QO#*oQlO'#I`OOQO-E<^-E<^O#*|Q`O,5@[O#+UQ!fO,5@[O#+]Q`O,5@jOOQ!0Lf1G/j1G/jO%[QlO,5@kO#+eQ`O'#IfOOQO-EoQ`O1G3oO$4WQlO1G3qO$8[QlO'#HpOOQ[1G3t1G3tO$8iQ`O'#HvO>tQ`O'#HxOOQ[1G3z1G3zO$8qQlO1G3zO9hQ!0LrO1G4QOOQ[1G4S1G4SOOQ!0Lb'#G]'#G]O9hQ!0LrO1G4UO9hQ!0LrO1G4WO$tQ`O,5:UO!(vQlO,5:UO!B_QpO,5:UO$<}Q?MtO,5:UOOQO,5;],5;]O$=XQpO'#IaO$=oQ`O,5@]OOQ!0Lf1G/o1G/oO$=wQpO'#IgO$>RQ`O,5@lOOQ!0Lb1G0v1G0vO##bQpO,5:UOOQO'#Ic'#IcO$>ZQpO,5:nOOQ!0Ln,5:n,5:nO#']Q`O1G0WOOQ!0Lf1G0W1G0WO%[QlO1G0WOOQ!0Lf1G0q1G0qO>tQ`O1G0qO!B_QpO1G0qO!BgQMhO1G0qOOQ!0Lb1G5x1G5xO!BSQ!0LrO1G0ZOOQO1G0j1G0jO%[QlO1G0jO$>bQ!0LrO1G0jO$>mQ!0LrO1G0jO!B_QpO1G0ZOCrQpO1G0ZO$>{Q!0LrO1G0jOOQO1G0Z1G0ZO$?aQ!0MxO1G0jPOOO-EzO$?}Q`O1G5vO$@VQ`O1G6UO$@_Q!fO1G6VO9WQ`O,5?QO$@iQ!0MxO1G6SO%[QlO1G6SO$@yQ!0LrO1G6SO$A[Q`O1G6RO$A[Q`O1G6RO9WQ`O1G6RO$AdQ`O,5?TO9WQ`O,5?TOOQO,5?T,5?TO$AxQ`O,5?TO$)QQ`O,5?TOOQO-E[OOQ[,5>[,5>[O%[QlO'#HqO%<{Q`O'#HsOOQ[,5>b,5>bO9WQ`O,5>bOOQ[,5>d,5>dOOQ[7+)f7+)fOOQ[7+)l7+)lOOQ[7+)p7+)pOOQ[7+)r7+)rO%=QQpO1G5xO%=lQ?MtO1G0wO%=vQ`O1G0wOOQO1G/p1G/pO%>RQ?MtO1G/pO>tQ`O1G/pO!(vQlO'#DjOOQO,5>{,5>{OOQO-E<_-E<_OOQO,5?R,5?ROOQO-EtQ`O7+&]O!B_QpO7+&]OOQO7+%u7+%uO$?aQ!0MxO7+&UOOQO7+&U7+&UO%[QlO7+&UO%>]Q!0LrO7+&UO!BSQ!0LrO7+%uO!B_QpO7+%uO%>hQ!0LrO7+&UO%>vQ!0MxO7++nO%[QlO7++nO%?WQ`O7++mO%?WQ`O7++mOOQO1G4o1G4oO9WQ`O1G4oO%?`Q`O1G4oOOQS7+%z7+%zO#']Q`O<|O%[QlO,5>|OOQO-E<`-E<`O%KlQ`O1G5yOOQ!0Lf<]OOQ[,5>_,5>_O&;hQ`O1G3|O9WQ`O7+&cO!(vQlO7+&cOOQO7+%[7+%[O&;mQ?MtO1G6VO>tQ`O7+%[OOQ!0Lf<tQ`O<tQ`O7+)hO'+dQ`O<{AN>{O%[QlOAN?[OOQO<{Oh%VOk+bO![']O%f+aO~O!d+dOa(XX![(XX'v(XX!Y(XX~Oa%lO![XO'v%lO~Oh%VO!i%cO~Oh%VO!i%cO(P%eO~O!d#vO#h(uO~Ob+oO%g+pO(P+lO(RTO(UUO!Z)UP~O!Y+qO`)TX~O[+uO~O`+vO~O![%}O(P%eO(Q!lO`)TP~Oh%VO#]+{O~Oh%VOk,OO![$|O~O![,QO~O},SO![XO~O%k%tO~O!u,XO~Oe,^O~Ob,_O(P#nO(RTO(UUO!Z)SP~Oe%{O~O%g!QO(P&WO~P=RO[,dO`,cO~OPYOQYOSfOdzOeyOmkOoYOpkOqkOwkOyYO{YO!PWO!TkO!UkO!fuO!iZO!lYO!mYO!nYO!pvO!uxO!y]O%e}O(RTO(UUO(]VO(k[O(ziO~O![!eO!r!gO$V!kO(P!dO~P!E{O`,cOa%lO'v%lO~OPYOQYOSfOd!jOe!iOmkOoYOpkOqkOwkOyYO{YO!PWO!TkO!UkO![!eO!fuO!iZO!lYO!mYO!nYO!pvO!u!hO$V!kO(P!dO(RTO(UUO(]VO(k[O(ziO~Oa,iO!rwO#t!OO%i!OO%j!OO%k!OO~P!HeO!i&lO~O&Y,oO~O![,qO~O&k,sO&m,tOP&haQ&haS&haY&haa&had&hae&ham&hao&hap&haq&haw&hay&ha{&ha!P&ha!T&ha!U&ha![&ha!f&ha!i&ha!l&ha!m&ha!n&ha!p&ha!r&ha!u&ha!y&ha#t&ha$V&ha%e&ha%g&ha%i&ha%j&ha%k&ha%n&ha%p&ha%s&ha%t&ha%v&ha&S&ha&Y&ha&[&ha&^&ha&`&ha&c&ha&i&ha&o&ha&q&ha&s&ha&u&ha&w&ha's&ha(P&ha(R&ha(U&ha(]&ha(k&ha(z&ha!Z&ha&a&hab&ha&f&ha~O(P,yO~Oh!bX!Y!OX!Z!OX!d!OX!d!bX!i!bX#]!OX~O!Y!bX!Z!bX~P# kO!d-OO#],}Oh(fX!Y#eX!Z#eX!d(fX!i(fX~O!Y(fX!Z(fX~P#!^Oh%VO!d-QO!i%cO!Y!^X!Z!^X~Op!nO!P!oO(RTO(UUO(a!mO~OP;jOQ;jOSfOd=fOe!iOmkOo;jOpkOqkOwkOy;jO{;jO!PWO!TkO!UkO![!eO!f;mO!iZO!l;jO!m;jO!n;jO!p;nO!r;qO!u!hO$V!kO(RTO(UUO(]VO(k[O(z=dO~O(P{Og'XX!Y'XX~P!+oO!Y.xOg(la~OSfO![3vO$c3wO~O!Z3{O~Os3|O~P#.uOa$lq!Y$lq'v$lq's$lq!V$lq!h$lqs$lq![$lq%f$lq!d$lq~P!9}O!V4OO~P!&fO!P4PO~O}){O'u)|O(v%POk'ea(u'ea!Y'ea#]'ea~Og'ea#}'ea~P%+ZO}){O'u)|Ok'ga(u'ga(v'ga!Y'ga#]'ga~Og'ga#}'ga~P%+|O(n$YO~P#.uO!VfX!V$xX!YfX!Y$xX!d%PX#]fX~P!/nO(PU#>[#>|#?`#?f#?l#?z#@a#BQ#B`#Bg#C}#D]#Ey#FX#F_#Fe#Fk#Fu#F{#GR#G]#Go#GuPPPPPPPPPPP#G{PPPPPPP#Hp#Kw#Ma#Mh#MpPPP$%OP$%X$(Q$.k$.n$.q$/p$/s$/z$0SP$0Y$0]P$0y$0}$1u$3T$3Y$3pPP$3u$3{$4PP$4S$4W$4[$5W$5o$6W$6[$6_$6b$6h$6k$6o$6sR!|RoqOXst!Z#d%k&o&q&r&t,l,q1}2QY!vQ']-^1b5iQ%rvQ%zyQ&R|Q&g!VS'T!e-UQ'c!iS'i!r!yU*g$|*W*kQ+j%{Q+w&TQ,]&aQ-['[Q-f'dQ-n'jQ0S*mQ1l,^R < TypeParamList TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:377,context:Oi,nodeProps:[["isolate",-8,5,6,14,34,36,48,50,52,""],["group",-26,9,17,19,65,204,208,212,213,215,218,221,231,233,239,241,243,245,248,254,260,262,264,266,268,270,271,"Statement",-34,13,14,29,32,33,39,48,51,52,54,59,67,69,73,77,79,81,82,107,108,117,118,135,138,140,141,142,143,144,146,147,166,167,169,"Expression",-23,28,30,34,38,40,42,171,173,175,176,178,179,180,182,183,184,186,187,188,198,200,202,203,"Type",-3,85,100,106,"ClassItem"],["openedBy",23,"<",35,"InterpolationStart",53,"[",57,"{",70,"(",159,"JSXStartCloseTag"],["closedBy",24,">",37,"InterpolationEnd",47,"]",58,"}",71,")",164,"JSXEndTag"]],propSources:[si],skippedNodes:[0,5,6,274],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$h&j(V!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(V!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$h&j(SpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(SpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Sp(V!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$h&j(Sp(V!b'x0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(T#S$h&j'y0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$h&j(Sp(V!b'y0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$h&j!m),Q(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#u(Ch$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#u(Ch$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(R':f$h&j(V!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$h&j(V!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$h&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$c`$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$c``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$c`$h&j(V!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(V!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$c`(V!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$h&j(Sp(V!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$h&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(V!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$h&j(SpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(SpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Sp(V!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l^!Q^$h&j!U7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!U7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!U7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c^!Ezl$h&j(V!b!U7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(V!b!U7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(V!b!U7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(V!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$h&j(V!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!^!LYP;=`<%l!KS>^!L`P;=`<%l!_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$h&j(Sp(V!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$h&j(Sp(V!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$h&j(Sp(V!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$h&j(Sp(V!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!d$b$h&j#})Lv(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#O-v$?V_!Z(CdsBr$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z?O$@a_!n7`$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$Aq|$h&j(Sp(V!b'x0/l$[#t(P,2j(a$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$h&j(Sp(V!b'y0/l$[#t(P,2j(a$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[ti,ai,ri,ii,2,3,4,5,6,7,8,9,10,11,12,13,14,ei,new oO("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOu~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!R~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(_~~",141,336),new oO("j~RQYZXz{^~^O'|~~aP!P!Qd~iO'}~~",25,319)],topRules:{Script:[0,7],SingleExpression:[1,272],SingleClassItem:[2,273]},dialects:{jsx:0,ts:14980},dynamicPrecedences:{77:1,79:1,91:1,167:1,196:1},specialized:[{term:323,get:e=>li[e]||-1},{term:339,get:e=>oi[e]||-1},{term:92,get:e=>ni[e]||-1}],tokenPrec:15004}),tt=[g("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),g("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),g("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),g("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),g("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),g(`try { - \${} -} catch (\${error}) { - \${} -}`,{label:"try",detail:"/ catch block",type:"keyword"}),g("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),g(`if (\${}) { - \${} -} else { - \${} -}`,{label:"if",detail:"/ else block",type:"keyword"}),g(`class \${name} { - constructor(\${params}) { - \${} - } -}`,{label:"class",detail:"definition",type:"keyword"}),g('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),g('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],Qi=tt.concat([g("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),g("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),g("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),$e=new Re,at=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function A(e){return(O,t)=>{let a=O.node.getChild("VariableDefinition");return a&&t(a,e),!0}}const hi=["FunctionDeclaration"],ui={FunctionDeclaration:A("function"),ClassDeclaration:A("class"),ClassExpression:()=>!0,EnumDeclaration:A("constant"),TypeAliasDeclaration:A("type"),NamespaceDeclaration:A("namespace"),VariableDefinition(e,O){e.matchContext(hi)||O(e,"variable")},TypeDefinition(e,O){O(e,"type")},__proto__:null};function rt(e,O){let t=$e.get(O);if(t)return t;let a=[],r=!0;function s(i,l){let n=e.sliceString(i.from,i.to);a.push({label:n,type:l})}return O.cursor(_O.IncludeAnonymous).iterate(i=>{if(r)r=!1;else if(i.name){let l=ui[i.name];if(l&&l(i,s)||at.has(i.name))return!1}else if(i.to-i.from>8192){for(let l of rt(e,i.node))a.push(l);return!1}}),$e.set(O,a),a}const Pe=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,it=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName",".","?."];function pi(e){let O=C(e.state).resolveInner(e.pos,-1);if(it.indexOf(O.name)>-1)return null;let t=O.name=="VariableName"||O.to-O.from<20&&Pe.test(e.state.sliceDoc(O.from,O.to));if(!t&&!e.explicit)return null;let a=[];for(let r=O;r;r=r.parent)at.has(r.name)&&(a=a.concat(rt(e.state.doc,r)));return{options:a,from:t?O.from:e.pos,validFor:Pe}}const y=B.define({name:"javascript",parser:ci.configure({props:[K.add({IfStatement:_({except:/^\s*({|else\b)/}),TryStatement:_({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:Nt,SwitchBody:e=>{let O=e.textAfter,t=/^\s*\}/.test(O),a=/^\s*(case|default)\b/.test(O);return e.baseIndent+(t?0:a?1:2)*e.unit},Block:Dt({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":_({except:/^{/}),JSXElement(e){let O=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(O?0:e.unit)},JSXEscape(e){let O=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(O?0:e.unit)},"JSXOpenTag JSXSelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),J.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":jO,BlockComment(e){return{from:e.from+2,to:e.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),st={test:e=>/^JSX/.test(e.name),facet:It({commentTokens:{block:{open:"{/*",close:"*/}"}}})},lt=y.configure({dialect:"ts"},"typescript"),ot=y.configure({dialect:"jsx",props:[Ve.add(e=>e.isTop?[st]:void 0)]}),nt=y.configure({dialect:"jsx ts",props:[Ve.add(e=>e.isTop?[st]:void 0)]},"typescript");let ct=e=>({label:e,type:"keyword"});const Qt="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(ct),fi=Qt.concat(["declare","implements","private","protected","public"].map(ct));function ht(e={}){let O=e.jsx?e.typescript?nt:ot:e.typescript?lt:y,t=e.typescript?Qi.concat(fi):tt.concat(Qt);return new F(O,[y.data.of({autocomplete:_e(it,je(t))}),y.data.of({autocomplete:pi}),e.jsx?Pi:[]])}function di(e){for(;;){if(e.name=="JSXOpenTag"||e.name=="JSXSelfClosingTag"||e.name=="JSXFragmentTag")return e;if(e.name=="JSXEscape"||!e.parent)return null;e=e.parent}}function Se(e,O,t=e.length){for(let a=O==null?void 0:O.firstChild;a;a=a.nextSibling)if(a.name=="JSXIdentifier"||a.name=="JSXBuiltin"||a.name=="JSXNamespacedName"||a.name=="JSXMemberExpression")return e.sliceString(a.from,Math.min(a.to,t));return""}const $i=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Pi=V.inputHandler.of((e,O,t,a,r)=>{if(($i?e.composing:e.compositionStarted)||e.state.readOnly||O!=t||a!=">"&&a!="/"||!y.isActiveAt(e.state,O,-1))return!1;let s=r(),{state:i}=s,l=i.changeByRange(n=>{var Q;let{head:u}=n,c=C(i).resolveInner(u-1,-1),d;if(c.name=="JSXStartTag"&&(c=c.parent),!(i.doc.sliceString(u-1,u)!=a||c.name=="JSXAttributeValue"&&c.to>u)){if(a==">"&&c.name=="JSXFragmentTag")return{range:n,changes:{from:u,insert:""}};if(a=="/"&&c.name=="JSXStartCloseTag"){let h=c.parent,f=h.parent;if(f&&h.from==u-2&&((d=Se(i.doc,f.firstChild,u))||((Q=f.firstChild)===null||Q===void 0?void 0:Q.name)=="JSXFragmentTag")){let P=`${d}>`;return{range:ze.cursor(u+P.length,-1),changes:{from:u,insert:P}}}}else if(a==">"){let h=di(c);if(h&&h.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(i.doc.sliceString(u,u+2))&&(d=Se(i.doc,h,u)))return{range:n,changes:{from:u,insert:``}}}}return{range:n}});return l.changes.empty?!1:(e.dispatch([s,i.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),E=["_blank","_self","_top","_parent"],gO=["ascii","utf-8","utf-16","latin1","latin1"],ZO=["get","post","put","delete"],bO=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],b=["true","false"],p={},Si={a:{attrs:{href:null,ping:null,type:null,media:null,target:E,hreflang:null}},abbr:p,address:p,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:p,aside:p,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:p,base:{attrs:{href:null,target:E}},bdi:p,bdo:p,blockquote:{attrs:{cite:null}},body:p,br:p,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:bO,formmethod:ZO,formnovalidate:["novalidate"],formtarget:E,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:p,center:p,cite:p,code:p,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:p,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:p,div:p,dl:p,dt:p,em:p,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:p,figure:p,footer:p,form:{attrs:{action:null,name:null,"accept-charset":gO,autocomplete:["on","off"],enctype:bO,method:ZO,novalidate:["novalidate"],target:E}},h1:p,h2:p,h3:p,h4:p,h5:p,h6:p,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:p,hgroup:p,hr:p,html:{attrs:{manifest:null}},i:p,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:bO,formmethod:ZO,formnovalidate:["novalidate"],formtarget:E,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:p,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:p,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:p,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:gO,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:p,noscript:p,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p,param:{attrs:{name:null,value:null}},pre:p,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:p,rt:p,ruby:p,samp:p,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:gO}},section:p,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:p,source:{attrs:{src:null,type:null,media:null}},span:p,strong:p,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:p,summary:p,sup:p,table:p,tbody:p,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:p,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:p,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:p,time:{attrs:{datetime:null}},title:p,tr:p,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:p,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:p},ut={accesskey:null,class:null,contenteditable:b,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:b,autocorrect:b,autocapitalize:b,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":b,"aria-autocomplete":["inline","list","both","none"],"aria-busy":b,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":b,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":b,"aria-hidden":b,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":b,"aria-multiselectable":b,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":b,"aria-relevant":null,"aria-required":b,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},pt="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(e=>"on"+e);for(let e of pt)ut[e]=null;class hO{constructor(O,t){this.tags=Object.assign(Object.assign({},Si),O),this.globalAttrs=Object.assign(Object.assign({},ut),t),this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}hO.default=new hO;function G(e,O,t=e.length){if(!O)return"";let a=O.firstChild,r=a&&a.getChild("TagName");return r?e.sliceString(r.from,Math.min(r.to,t)):""}function U(e,O=!1){for(;e;e=e.parent)if(e.name=="Element")if(O)O=!1;else return e;return null}function ft(e,O,t){let a=t.tags[G(e,U(O))];return(a==null?void 0:a.children)||t.allTags}function UO(e,O){let t=[];for(let a=U(O);a&&!a.type.isTop;a=U(a.parent)){let r=G(e,a);if(r&&a.lastChild.name=="CloseTag")break;r&&t.indexOf(r)<0&&(O.name=="EndTag"||O.from>=a.firstChild.to)&&t.push(r)}return t}const dt=/^[:\-\.\w\u00b7-\uffff]*$/;function me(e,O,t,a,r){let s=/\s*>/.test(e.sliceDoc(r,r+5))?"":">",i=U(t,!0);return{from:a,to:r,options:ft(e.doc,i,O).map(l=>({label:l,type:"type"})).concat(UO(e.doc,t).map((l,n)=>({label:"/"+l,apply:"/"+l+s,type:"type",boost:99-n}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function ge(e,O,t,a){let r=/\s*>/.test(e.sliceDoc(a,a+5))?"":">";return{from:t,to:a,options:UO(e.doc,O).map((s,i)=>({label:s,apply:s+r,type:"type",boost:99-i})),validFor:dt}}function mi(e,O,t,a){let r=[],s=0;for(let i of ft(e.doc,t,O))r.push({label:"<"+i,type:"type"});for(let i of UO(e.doc,t))r.push({label:"",type:"type",boost:99-s++});return{from:a,to:a,options:r,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function gi(e,O,t,a,r){let s=U(t),i=s?O.tags[G(e.doc,s)]:null,l=i&&i.attrs?Object.keys(i.attrs):[],n=i&&i.globalAttrs===!1?l:l.length?l.concat(O.globalAttrNames):O.globalAttrNames;return{from:a,to:r,options:n.map(Q=>({label:Q,type:"property"})),validFor:dt}}function Zi(e,O,t,a,r){var s;let i=(s=t.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),l=[],n;if(i){let Q=e.sliceDoc(i.from,i.to),u=O.globalAttrs[Q];if(!u){let c=U(t),d=c?O.tags[G(e.doc,c)]:null;u=(d==null?void 0:d.attrs)&&d.attrs[Q]}if(u){let c=e.sliceDoc(a,r).toLowerCase(),d='"',h='"';/^['"]/.test(c)?(n=c[0]=='"'?/^[^"]*$/:/^[^']*$/,d="",h=e.sliceDoc(r,r+1)==c[0]?"":c[0],c=c.slice(1),a++):n=/^[^\s<>='"]*$/;for(let f of u)l.push({label:f,apply:d+f+h,type:"constant"})}}return{from:a,to:r,options:l,validFor:n}}function bi(e,O){let{state:t,pos:a}=O,r=C(t).resolveInner(a,-1),s=r.resolve(a);for(let i=a,l;s==r&&(l=r.childBefore(i));){let n=l.lastChild;if(!n||!n.type.isError||n.frombi(a,r)}const ki=y.parser.configure({top:"SingleExpression"}),$t=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:lt.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:ot.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:nt.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:ki},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:y.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:QO.parser}],Pt=[{name:"style",parser:QO.parser.configure({top:"Styles"})}].concat(pt.map(e=>({name:e,parser:y.parser}))),St=B.define({name:"html",parser:rr.configure({props:[K.add({Element(e){let O=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+O[0].length?e.continue():e.lineIndent(e.node.from)+(O[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].lengthe.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-._"}}),iO=St.configure({wrap:Ke($t,Pt)});function Xi(e={}){let O="",t;e.matchClosingTags===!1&&(O="noMatch"),e.selfClosingTags===!0&&(O=(O?O+" ":"")+"selfClosing"),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(t=Ke((e.nestedLanguages||[]).concat($t),(e.nestedAttributes||[]).concat(Pt)));let a=t?St.configure({wrap:t,dialect:O}):O?iO.configure({dialect:O}):iO;return new F(a,[iO.data.of({autocomplete:xi(e)}),e.autoCloseTags!==!1?yi:[],ht().support,Rr().support])}const Ze=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),yi=V.inputHandler.of((e,O,t,a,r)=>{if(e.composing||e.state.readOnly||O!=t||a!=">"&&a!="/"||!iO.isActiveAt(e.state,O,-1))return!1;let s=r(),{state:i}=s,l=i.changeByRange(n=>{var Q,u,c;let d=i.doc.sliceString(n.from-1,n.to)==a,{head:h}=n,f=C(i).resolveInner(h,-1),P;if(d&&a==">"&&f.name=="EndTag"){let S=f.parent;if(((u=(Q=S.parent)===null||Q===void 0?void 0:Q.lastChild)===null||u===void 0?void 0:u.name)!="CloseTag"&&(P=G(i.doc,S.parent,h))&&!Ze.has(P)){let k=h+(i.doc.sliceString(h,h+1)===">"?1:0),X=``;return{range:n,changes:{from:h,to:k,insert:X}}}}else if(d&&a=="/"&&f.name=="IncompleteCloseTag"){let S=f.parent;if(f.from==h-2&&((c=S.lastChild)===null||c===void 0?void 0:c.name)!="CloseTag"&&(P=G(i.doc,S,h))&&!Ze.has(P)){let k=h+(i.doc.sliceString(h,h+1)===">"?1:0),X=`${P}>`;return{range:ze.cursor(h+X.length,-1),changes:{from:h,to:k,insert:X}}}}return{range:n}});return l.changes.empty?!1:(e.dispatch([s,i.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),wi=I({String:o.string,Number:o.number,"True False":o.bool,PropertyName:o.propertyName,Null:o.null,",":o.separator,"[ ]":o.squareBracket,"{ }":o.brace}),vi=Y.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j",stateData:"#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O",goto:"!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",12,"["],["closedBy",8,"}",13,"]"]],propSources:[wi],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oc~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Oe~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zOh~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yOg~~'OO]~~'TO[~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),qi=B.define({name:"json",parser:vi.configure({props:[K.add({Object:_({except:/^\s*\}/}),Array:_({except:/^\s*\]/})}),J.add({"Object Array":jO})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function Yi(){return new F(qi)}const Ti=36,be=1,Ri=2,j=3,xO=4,Vi=5,_i=6,ji=7,zi=8,Gi=9,Ui=10,Ci=11,Wi=12,Ai=13,Ei=14,Mi=15,Li=16,Ni=17,xe=18,Di=19,mt=20,gt=21,ke=22,Ii=23,Bi=24;function qO(e){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57}function Ki(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function R(e,O,t){for(let a=!1;;){if(e.next<0)return;if(e.next==O&&!a){e.advance();return}a=t&&!a&&e.next==92,e.advance()}}function Ji(e,O){O:for(;;){if(e.next<0)return;if(e.next==36){e.advance();for(let t=0;t)".charCodeAt(t);for(;;){if(e.next<0)return;if(e.next==a&&e.peek(1)==39){e.advance(2);return}e.advance()}}function YO(e,O){for(;!(e.next!=95&&!qO(e.next));)O!=null&&(O+=String.fromCharCode(e.next)),e.advance();return O}function Hi(e){if(e.next==39||e.next==34||e.next==96){let O=e.next;e.advance(),R(e,O,!1)}else YO(e)}function Xe(e,O){for(;e.next==48||e.next==49;)e.advance();O&&e.next==O&&e.advance()}function ye(e,O){for(;;){if(e.next==46){if(O)break;O=!0}else if(e.next<48||e.next>57)break;e.advance()}if(e.next==69||e.next==101)for(e.advance(),(e.next==43||e.next==45)&&e.advance();e.next>=48&&e.next<=57;)e.advance()}function we(e){for(;!(e.next<0||e.next==10);)e.advance()}function T(e,O){for(let t=0;t!=&|~^/",specialVar:"?",identifierQuotes:'"',caseInsensitiveIdentifiers:!1,words:Zt(es,Os)};function ts(e,O,t,a){let r={};for(let s in TO)r[s]=(e.hasOwnProperty(s)?e:TO)[s];return O&&(r.words=Zt(O,t||"",a)),r}function bt(e){return new x(O=>{var t;let{next:a}=O;if(O.advance(),T(a,kO)){for(;T(O.next,kO);)O.advance();O.acceptToken(Ti)}else if(a==36&&e.doubleDollarQuotedStrings){let r=YO(O,"");O.next==36&&(O.advance(),Ji(O,r),O.acceptToken(j))}else if(a==39||a==34&&e.doubleQuotedStrings)R(O,a,e.backslashEscapes),O.acceptToken(j);else if(a==35&&e.hashComments||a==47&&O.next==47&&e.slashComments)we(O),O.acceptToken(be);else if(a==45&&O.next==45&&(!e.spaceAfterDashes||O.peek(1)==32))we(O),O.acceptToken(be);else if(a==47&&O.next==42){O.advance();for(let r=1;;){let s=O.next;if(O.next<0)break;if(O.advance(),s==42&&O.next==47){if(r--,O.advance(),!r)break}else s==47&&O.next==42&&(r++,O.advance())}O.acceptToken(Ri)}else if((a==101||a==69)&&O.next==39)O.advance(),R(O,39,!0),O.acceptToken(j);else if((a==110||a==78)&&O.next==39&&e.charSetCasts)O.advance(),R(O,39,e.backslashEscapes),O.acceptToken(j);else if(a==95&&e.charSetCasts)for(let r=0;;r++){if(O.next==39&&r>1){O.advance(),R(O,39,e.backslashEscapes),O.acceptToken(j);break}if(!qO(O.next))break;O.advance()}else if(e.plsqlQuotingMechanism&&(a==113||a==81)&&O.next==39&&O.peek(1)>0&&!T(O.peek(1),kO)){let r=O.peek(1);O.advance(2),Fi(O,r),O.acceptToken(j)}else if(a==40)O.acceptToken(ji);else if(a==41)O.acceptToken(zi);else if(a==123)O.acceptToken(Gi);else if(a==125)O.acceptToken(Ui);else if(a==91)O.acceptToken(Ci);else if(a==93)O.acceptToken(Wi);else if(a==59)O.acceptToken(Ai);else if(e.unquotedBitLiterals&&a==48&&O.next==98)O.advance(),Xe(O),O.acceptToken(ke);else if((a==98||a==66)&&(O.next==39||O.next==34)){const r=O.next;O.advance(),e.treatBitsAsBytes?(R(O,r,e.backslashEscapes),O.acceptToken(Ii)):(Xe(O,r),O.acceptToken(ke))}else if(a==48&&(O.next==120||O.next==88)||(a==120||a==88)&&O.next==39){let r=O.next==39;for(O.advance();Ki(O.next);)O.advance();r&&O.next==39&&O.advance(),O.acceptToken(xO)}else if(a==46&&O.next>=48&&O.next<=57)ye(O,!0),O.acceptToken(xO);else if(a==46)O.acceptToken(Ei);else if(a>=48&&a<=57)ye(O,!1),O.acceptToken(xO);else if(T(a,e.operatorChars)){for(;T(O.next,e.operatorChars);)O.advance();O.acceptToken(Mi)}else if(T(a,e.specialVar))O.next==a&&O.advance(),Hi(O),O.acceptToken(Ni);else if(T(a,e.identifierQuotes))R(O,a,!1),O.acceptToken(Di);else if(a==58||a==44)O.acceptToken(Li);else if(qO(a)){let r=YO(O,String.fromCharCode(a));O.acceptToken(O.next==46||O.peek(-r.length-1)==46?xe:(t=e.words[r.toLowerCase()])!==null&&t!==void 0?t:xe)}})}const xt=bt(TO),as=Y.deserialize({version:14,states:"%vQ]QQOOO#wQRO'#DSO$OQQO'#CwO%eQQO'#CxO%lQQO'#CyO%sQQO'#CzOOQQ'#DS'#DSOOQQ'#C}'#C}O'UQRO'#C{OOQQ'#Cv'#CvOOQQ'#C|'#C|Q]QQOOQOQQOOO'`QQO'#DOO(xQRO,59cO)PQQO,59cO)UQQO'#DSOOQQ,59d,59dO)cQQO,59dOOQQ,59e,59eO)jQQO,59eOOQQ,59f,59fO)qQQO,59fOOQQ-E6{-E6{OOQQ,59b,59bOOQQ-E6z-E6zOOQQ,59j,59jOOQQ-E6|-E6|O+VQRO1G.}O+^QQO,59cOOQQ1G/O1G/OOOQQ1G/P1G/POOQQ1G/Q1G/QP+kQQO'#C}O+rQQO1G.}O)PQQO,59cO,PQQO'#Cw",stateData:",[~OtOSPOSQOS~ORUOSUOTUOUUOVROXSOZTO]XO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O^]ORvXSvXTvXUvXVvXXvXZvX]vX_vX`vXavXbvXcvXdvXevXfvXgvXhvX~OsvX~P!jOa_Ob_Oc_O~ORUOSUOTUOUUOVROXSOZTO^tO_UO`UOa`Ob`Oc`OdUOeUOfUOgUOhUO~OWaO~P$ZOYcO~P$ZO[eO~P$ZORUOSUOTUOUUOVROXSOZTO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O]hOsoX~P%zOajObjOcjO~O^]ORkaSkaTkaUkaVkaXkaZka]ka_ka`kaakabkackadkaekafkagkahka~Oska~P'kO^]O~OWvXYvX[vX~P!jOWnO~P$ZOYoO~P$ZO[pO~P$ZO^]ORkiSkiTkiUkiVkiXkiZki]ki_ki`kiakibkickidkiekifkigkihki~Oski~P)xOWkaYka[ka~P'kO]hO~P$ZOWkiYki[ki~P)xOasObsOcsO~O",goto:"#hwPPPPPPPPPPPPPPPPPPPPPPPPPPx||||!Y!^!d!xPPP#[TYOZeUORSTWZbdfqT[OZQZORiZSWOZQbRQdSQfTZgWbdfqQ^PWk^lmrQl_Qm`RrseVORSTWZbdfq",nodeNames:"⚠ LineComment BlockComment String Number Bool Null ( ) { } [ ] ; . Operator Punctuation SpecialVar Identifier QuotedIdentifier Keyword Type Bits Bytes Builtin Script Statement CompositeIdentifier Parens Braces Brackets Statement",maxTerm:38,nodeProps:[["isolate",-4,1,2,3,19,""]],skippedNodes:[0,1,2],repeatNodeCount:3,tokenData:"RORO",tokenizers:[0,xt],topRules:{Script:[0,25]},tokenPrec:0});function RO(e){let O=e.cursor().moveTo(e.from,-1);for(;/Comment/.test(O.name);)O.moveTo(O.from,-1);return O.node}function N(e,O){let t=e.sliceString(O.from,O.to),a=/^([`'"])(.*)\1$/.exec(t);return a?a[2]:t}function uO(e){return e&&(e.name=="Identifier"||e.name=="QuotedIdentifier")}function rs(e,O){if(O.name=="CompositeIdentifier"){let t=[];for(let a=O.firstChild;a;a=a.nextSibling)uO(a)&&t.push(N(e,a));return t}return[N(e,O)]}function ve(e,O){for(let t=[];;){if(!O||O.name!=".")return t;let a=RO(O);if(!uO(a))return t;t.unshift(N(e,a)),O=RO(a)}}function is(e,O){let t=C(e).resolveInner(O,-1),a=ls(e.doc,t);return t.name=="Identifier"||t.name=="QuotedIdentifier"||t.name=="Keyword"?{from:t.from,quoted:t.name=="QuotedIdentifier"?e.doc.sliceString(t.from,t.from+1):null,parents:ve(e.doc,RO(t)),aliases:a}:t.name=="."?{from:O,quoted:null,parents:ve(e.doc,t),aliases:a}:{from:O,quoted:null,parents:[],empty:!0,aliases:a}}const ss=new Set("where group having order union intersect except all distinct limit offset fetch for".split(" "));function ls(e,O){let t;for(let r=O;!t;r=r.parent){if(!r)return null;r.name=="Statement"&&(t=r)}let a=null;for(let r=t.firstChild,s=!1,i=null;r;r=r.nextSibling){let l=r.name=="Keyword"?e.sliceString(r.from,r.to).toLowerCase():null,n=null;if(!s)s=l=="from";else if(l=="as"&&i&&uO(r.nextSibling))n=N(e,r.nextSibling);else{if(l&&ss.has(l))break;i&&uO(r)&&(n=N(e,r))}n&&(a||(a=Object.create(null)),a[n]=rs(e,i)),i=/Identifier$/.test(r.name)?r:null}return a}function os(e,O){return e?O.map(t=>Object.assign(Object.assign({},t),{label:t.label[0]==e?t.label:e+t.label+e,apply:void 0})):O}const ns=/^\w*$/,cs=/^[`'"]?\w*[`'"]?$/;function qe(e){return e.self&&typeof e.self.label=="string"}class CO{constructor(O,t){this.idQuote=O,this.idCaseInsensitive=t,this.list=[],this.children=void 0}child(O){let t=this.children||(this.children=Object.create(null)),a=t[O];return a||(O&&!this.list.some(r=>r.label==O)&&this.list.push(Ye(O,"type",this.idQuote,this.idCaseInsensitive)),t[O]=new CO(this.idQuote,this.idCaseInsensitive))}maybeChild(O){return this.children?this.children[O]:null}addCompletion(O){let t=this.list.findIndex(a=>a.label==O.label);t>-1?this.list[t]=O:this.list.push(O)}addCompletions(O){for(let t of O)this.addCompletion(typeof t=="string"?Ye(t,"property",this.idQuote,this.idCaseInsensitive):t)}addNamespace(O){Array.isArray(O)?this.addCompletions(O):qe(O)?this.addNamespace(O.children):this.addNamespaceObject(O)}addNamespaceObject(O){for(let t of Object.keys(O)){let a=O[t],r=null,s=t.replace(/\\?\./g,l=>l=="."?"\0":l).split("\0"),i=this;qe(a)&&(r=a.self,a=a.children);for(let l=0;l{let{parents:c,from:d,quoted:h,empty:f,aliases:P}=is(u.state,u.pos);if(f&&!u.explicit)return null;P&&c.length==1&&(c=P[c[0]]||c);let S=n;for(let q of c){for(;!S.children||!S.children[q];)if(S==n&&Q)S=Q;else if(S==Q&&a)S=S.child(a);else return null;let H=S.maybeChild(q);if(!H)return null;S=H}let k=h&&u.state.sliceDoc(u.pos,u.pos+1)==h,X=S.list;return S==n&&P&&(X=X.concat(Object.keys(P).map(q=>({label:q,type:"constant"})))),{from:d,to:k?u.pos+1:void 0,options:os(h,X),validFor:h?cs:ns}}}function hs(e){return e==gt?"type":e==mt?"keyword":"variable"}function us(e,O,t){let a=Object.keys(e).map(r=>t(O?r.toUpperCase():r,hs(e[r])));return _e(["QuotedIdentifier","SpecialVar","String","LineComment","BlockComment","."],je(a))}let ps=as.configure({props:[K.add({Statement:_()}),J.add({Statement(e,O){return{from:Math.min(e.from+100,O.doc.lineAt(e.from).to),to:e.to}},BlockComment(e){return{from:e.from+2,to:e.to-2}}}),I({Keyword:o.keyword,Type:o.typeName,Builtin:o.standard(o.name),Bits:o.number,Bytes:o.string,Bool:o.bool,Null:o.null,Number:o.number,String:o.string,Identifier:o.name,QuotedIdentifier:o.special(o.string),SpecialVar:o.special(o.name),LineComment:o.lineComment,BlockComment:o.blockComment,Operator:o.operator,"Semi Punctuation":o.punctuation,"( )":o.paren,"{ }":o.brace,"[ ]":o.squareBracket})]});class D{constructor(O,t,a){this.dialect=O,this.language=t,this.spec=a}get extension(){return this.language.extension}static define(O){let t=ts(O,O.keywords,O.types,O.builtin),a=B.define({name:"sql",parser:ps.configure({tokenizers:[{from:xt,to:bt(t)}]}),languageData:{commentTokens:{line:"--",block:{open:"/*",close:"*/"}},closeBrackets:{brackets:["(","[","{","'",'"',"`"]}}});return new D(t,a,O)}}function fs(e,O){return{label:e,type:O,boost:-1}}function ds(e,O=!1,t){return us(e.dialect.words,O,t||fs)}function $s(e){return e.schema?Qs(e.schema,e.tables,e.schemas,e.defaultTable,e.defaultSchema,e.dialect||WO):()=>null}function Ps(e){return e.schema?(e.dialect||WO).language.data.of({autocomplete:$s(e)}):[]}function Te(e={}){let O=e.dialect||WO;return new F(O.language,[Ps(e),O.language.data.of({autocomplete:ds(O,e.upperCaseKeywords,e.keywordCompletion)})])}const WO=D.define({});function Ss(e){let O;return{c(){O=Yt("div"),Tt(O,"class","code-editor"),OO(O,"min-height",e[0]?e[0]+"px":null),OO(O,"max-height",e[1]?e[1]+"px":"auto")},m(t,a){Rt(t,O,a),e[11](O)},p(t,[a]){a&1&&OO(O,"min-height",t[0]?t[0]+"px":null),a&2&&OO(O,"max-height",t[1]?t[1]+"px":"auto")},i:IO,o:IO,d(t){t&&Vt(O),e[11](null)}}}function ms(e,O,t){let a;_t(e,jt,$=>t(12,a=$));const r=zt();let{id:s=""}=O,{value:i=""}=O,{minHeight:l=null}=O,{maxHeight:n=null}=O,{disabled:Q=!1}=O,{placeholder:u=""}=O,{language:c="javascript"}=O,{singleLine:d=!1}=O,h,f,P=new eO,S=new eO,k=new eO,X=new eO;function q(){h==null||h.focus()}function H(){f==null||f.dispatchEvent(new CustomEvent("change",{detail:{value:i},bubbles:!0})),r("change",i)}function AO(){if(!s)return;const $=document.querySelectorAll('[for="'+s+'"]');for(let m of $)m.removeEventListener("click",q)}function EO(){if(!s)return;AO();const $=document.querySelectorAll('[for="'+s+'"]');for(let m of $)m.addEventListener("click",q)}function MO(){switch(c){case"html":return Xi();case"json":return Yi();case"sql-create-index":return Te({dialect:D.define({keywords:"create unique index if not exists on collate asc desc where like isnull notnull date time datetime unixepoch strftime lower upper substr case when then iif if else json_extract json_each json_tree json_array_length json_valid ",operatorChars:"*+-%<>!=&|/~",identifierQuotes:'`"',specialVar:"@:?$"}),upperCaseKeywords:!0});case"sql-select":let $={};for(let m of a)$[m.name]=Ut.getAllCollectionIdentifiers(m);return Te({dialect:D.define({keywords:"select distinct from where having group by order limit offset join left right inner with like not in match asc desc regexp isnull notnull glob count avg sum min max current random cast as int real text bool date time datetime unixepoch strftime coalesce lower upper substr case when then iif if else json_extract json_each json_tree json_array_length json_valid ",operatorChars:"*+-%<>!=&|/~",identifierQuotes:'`"',specialVar:"@:?$"}),schema:$,upperCaseKeywords:!0});default:return ht()}}Gt(()=>{const $={key:"Enter",run:m=>{d&&r("submit",i)}};return EO(),t(10,h=new V({parent:f,state:W.create({doc:i,extensions:[Kt(),Jt(),Ft(),Ht(),Oa(),W.allowMultipleSelections.of(!0),ea(ta,{fallback:!0}),aa(),ra(),ia(),sa(),la.of([$,...oa,...na,ca.find(m=>m.key==="Mod-d"),...Qa,...ha]),V.lineWrapping,ua({icons:!1}),P.of(MO()),X.of(BO(u)),S.of(V.editable.of(!0)),k.of(W.readOnly.of(!1)),W.transactionFilter.of(m=>{var LO,NO,DO;if(d&&m.newDoc.lines>1){if(!((DO=(NO=(LO=m.changes)==null?void 0:LO.inserted)==null?void 0:NO.filter(Xt=>!!Xt.text.find(yt=>yt)))!=null&&DO.length))return[];m.newDoc.text=[m.newDoc.text.join(" ")]}return m}),V.updateListener.of(m=>{!m.docChanged||Q||(t(3,i=m.state.doc.toString()),H())})]})})),()=>{AO(),h==null||h.destroy()}});function kt($){Ct[$?"unshift":"push"](()=>{f=$,t(2,f)})}return e.$$set=$=>{"id"in $&&t(4,s=$.id),"value"in $&&t(3,i=$.value),"minHeight"in $&&t(0,l=$.minHeight),"maxHeight"in $&&t(1,n=$.maxHeight),"disabled"in $&&t(5,Q=$.disabled),"placeholder"in $&&t(6,u=$.placeholder),"language"in $&&t(7,c=$.language),"singleLine"in $&&t(8,d=$.singleLine)},e.$$.update=()=>{e.$$.dirty&16&&s&&EO(),e.$$.dirty&1152&&h&&c&&h.dispatch({effects:[P.reconfigure(MO())]}),e.$$.dirty&1056&&h&&typeof Q<"u"&&h.dispatch({effects:[S.reconfigure(V.editable.of(!Q)),k.reconfigure(W.readOnly.of(Q))]}),e.$$.dirty&1032&&h&&i!=h.state.doc.toString()&&h.dispatch({changes:{from:0,to:h.state.doc.length,insert:i}}),e.$$.dirty&1088&&h&&typeof u<"u"&&h.dispatch({effects:[X.reconfigure(BO(u))]})},[l,n,f,i,s,Q,u,c,d,q,h,kt]}class bs extends wt{constructor(O){super(),vt(this,O,ms,Ss,qt,{id:4,value:3,minHeight:0,maxHeight:1,disabled:5,placeholder:6,language:7,singleLine:8,focus:9})}get focus(){return this.$$.ctx[9]}}export{bs as default}; diff --git a/ui/dist/assets/CreateApiDocs-BzGj6G0X.js b/ui/dist/assets/CreateApiDocs-D603KXnO.js similarity index 99% rename from ui/dist/assets/CreateApiDocs-BzGj6G0X.js rename to ui/dist/assets/CreateApiDocs-D603KXnO.js index ead69ae3..6183174c 100644 --- a/ui/dist/assets/CreateApiDocs-BzGj6G0X.js +++ b/ui/dist/assets/CreateApiDocs-D603KXnO.js @@ -1,4 +1,4 @@ -import{S as $t,i as qt,s as St,V as Tt,J as ee,X as ue,W as Ct,h as s,z as _,j as p,c as $e,k as w,n as r,o as i,m as qe,H as oe,Y as Ve,Z as pt,E as Ot,_ as Mt,G as Lt,t as ye,a as ve,v as d,d as Se,p as Pt,l as Te,q as Ft,I as we,L as Ht}from"./index-rWxFAXsK.js";import{F as Rt}from"./FieldsQueryParam-DmBOgcIi.js";function mt(a,e,t){const l=a.slice();return l[10]=e[t],l}function bt(a,e,t){const l=a.slice();return l[10]=e[t],l}function _t(a,e,t){const l=a.slice();return l[15]=e[t],l}function kt(a){let e;return{c(){e=s("p"),e.innerHTML="Requires superuser Authorization:TOKEN header",w(e,"class","txt-hint txt-sm txt-right")},m(t,l){r(t,e,l)},d(t){t&&d(e)}}}function ht(a){let e,t,l,u,c,f,b,m,$,h,g,A,T,O,R,M,I,J,S,Q,L,q,k,P,te,Y,U,re,G,K,X;function fe(y,C){var V,W,H;return C&1&&(f=null),f==null&&(f=!!((H=(W=(V=y[0])==null?void 0:V.fields)==null?void 0:W.find(Kt))!=null&&H.required)),f?At:jt}let le=fe(a,-1),E=le(a);function Z(y,C){var V,W,H;return C&1&&(I=null),I==null&&(I=!!((H=(W=(V=y[0])==null?void 0:V.fields)==null?void 0:W.find(Gt))!=null&&H.required)),I?Vt:Bt}let x=Z(a,-1),F=x(a);return{c(){e=s("tr"),e.innerHTML='Auth specific fields',t=p(),l=s("tr"),u=s("td"),c=s("div"),E.c(),b=p(),m=s("span"),m.textContent="email",$=p(),h=s("td"),h.innerHTML='String',g=p(),A=s("td"),A.textContent="Auth record email address.",T=p(),O=s("tr"),R=s("td"),M=s("div"),F.c(),J=p(),S=s("span"),S.textContent="emailVisibility",Q=p(),L=s("td"),L.innerHTML='Boolean',q=p(),k=s("td"),k.textContent="Whether to show/hide the auth record email when fetching the record data.",P=p(),te=s("tr"),te.innerHTML='
Required password
String Auth record password.',Y=p(),U=s("tr"),U.innerHTML='
Required passwordConfirm
String Auth record password confirmation.',re=p(),G=s("tr"),G.innerHTML=`
Optional verified
Boolean Indicates whether the auth record is verified or not. +import{S as $t,i as qt,s as St,V as Tt,J as ee,X as ue,W as Ct,h as s,z as _,j as p,c as $e,k as w,n as r,o as i,m as qe,H as oe,Y as Ve,Z as pt,E as Ot,_ as Mt,G as Lt,t as ye,a as ve,v as d,d as Se,p as Pt,l as Te,q as Ft,I as we,L as Ht}from"./index-C58oTbH7.js";import{F as Rt}from"./FieldsQueryParam-B-V1imBW.js";function mt(a,e,t){const l=a.slice();return l[10]=e[t],l}function bt(a,e,t){const l=a.slice();return l[10]=e[t],l}function _t(a,e,t){const l=a.slice();return l[15]=e[t],l}function kt(a){let e;return{c(){e=s("p"),e.innerHTML="Requires superuser Authorization:TOKEN header",w(e,"class","txt-hint txt-sm txt-right")},m(t,l){r(t,e,l)},d(t){t&&d(e)}}}function ht(a){let e,t,l,u,c,f,b,m,$,h,g,A,T,O,R,M,I,J,S,Q,L,q,k,P,te,Y,U,re,G,K,X;function fe(y,C){var V,W,H;return C&1&&(f=null),f==null&&(f=!!((H=(W=(V=y[0])==null?void 0:V.fields)==null?void 0:W.find(Kt))!=null&&H.required)),f?At:jt}let le=fe(a,-1),E=le(a);function Z(y,C){var V,W,H;return C&1&&(I=null),I==null&&(I=!!((H=(W=(V=y[0])==null?void 0:V.fields)==null?void 0:W.find(Gt))!=null&&H.required)),I?Vt:Bt}let x=Z(a,-1),F=x(a);return{c(){e=s("tr"),e.innerHTML='Auth specific fields',t=p(),l=s("tr"),u=s("td"),c=s("div"),E.c(),b=p(),m=s("span"),m.textContent="email",$=p(),h=s("td"),h.innerHTML='String',g=p(),A=s("td"),A.textContent="Auth record email address.",T=p(),O=s("tr"),R=s("td"),M=s("div"),F.c(),J=p(),S=s("span"),S.textContent="emailVisibility",Q=p(),L=s("td"),L.innerHTML='Boolean',q=p(),k=s("td"),k.textContent="Whether to show/hide the auth record email when fetching the record data.",P=p(),te=s("tr"),te.innerHTML='
Required password
String Auth record password.',Y=p(),U=s("tr"),U.innerHTML='
Required passwordConfirm
String Auth record password confirmation.',re=p(),G=s("tr"),G.innerHTML=`
Optional verified
Boolean Indicates whether the auth record is verified or not.
This field can be set only by superusers or auth records with "Manage" access.`,K=p(),X=s("tr"),X.innerHTML='Other fields',w(c,"class","inline-flex"),w(M,"class","inline-flex")},m(y,C){r(y,e,C),r(y,t,C),r(y,l,C),i(l,u),i(u,c),E.m(c,null),i(c,b),i(c,m),i(l,$),i(l,h),i(l,g),i(l,A),r(y,T,C),r(y,O,C),i(O,R),i(R,M),F.m(M,null),i(M,J),i(M,S),i(O,Q),i(O,L),i(O,q),i(O,k),r(y,P,C),r(y,te,C),r(y,Y,C),r(y,U,C),r(y,re,C),r(y,G,C),r(y,K,C),r(y,X,C)},p(y,C){le!==(le=fe(y,C))&&(E.d(1),E=le(y),E&&(E.c(),E.m(c,b))),x!==(x=Z(y,C))&&(F.d(1),F=x(y),F&&(F.c(),F.m(M,J)))},d(y){y&&(d(e),d(t),d(l),d(T),d(O),d(P),d(te),d(Y),d(U),d(re),d(G),d(K),d(X)),E.d(),F.d()}}}function jt(a){let e;return{c(){e=s("span"),e.textContent="Optional",w(e,"class","label label-warning")},m(t,l){r(t,e,l)},d(t){t&&d(e)}}}function At(a){let e;return{c(){e=s("span"),e.textContent="Required",w(e,"class","label label-success")},m(t,l){r(t,e,l)},d(t){t&&d(e)}}}function Bt(a){let e;return{c(){e=s("span"),e.textContent="Optional",w(e,"class","label label-warning")},m(t,l){r(t,e,l)},d(t){t&&d(e)}}}function Vt(a){let e;return{c(){e=s("span"),e.textContent="Required",w(e,"class","label label-success")},m(t,l){r(t,e,l)},d(t){t&&d(e)}}}function Nt(a){let e;return{c(){e=s("span"),e.textContent="Required",w(e,"class","label label-success")},m(t,l){r(t,e,l)},d(t){t&&d(e)}}}function Dt(a){let e;return{c(){e=s("span"),e.textContent="Optional",w(e,"class","label label-warning")},m(t,l){r(t,e,l)},d(t){t&&d(e)}}}function Jt(a){let e,t=a[15].maxSelect===1?"id":"ids",l,u;return{c(){e=_("Relation record "),l=_(t),u=_(".")},m(c,f){r(c,e,f),r(c,l,f),r(c,u,f)},p(c,f){f&64&&t!==(t=c[15].maxSelect===1?"id":"ids")&&oe(l,t)},d(c){c&&(d(e),d(l),d(u))}}}function Et(a){let e,t,l,u,c,f,b,m,$;return{c(){e=_("File object."),t=s("br"),l=_(` Set to empty value (`),u=s("code"),u.textContent="null",c=_(", "),f=s("code"),f.textContent='""',b=_(" or "),m=s("code"),m.textContent="[]",$=_(`) to delete diff --git a/ui/dist/assets/DeleteApiDocs-DjxcrIL2.js b/ui/dist/assets/DeleteApiDocs-BEM8M84w.js similarity index 98% rename from ui/dist/assets/DeleteApiDocs-DjxcrIL2.js rename to ui/dist/assets/DeleteApiDocs-BEM8M84w.js index e543b929..fac92eca 100644 --- a/ui/dist/assets/DeleteApiDocs-DjxcrIL2.js +++ b/ui/dist/assets/DeleteApiDocs-BEM8M84w.js @@ -1,4 +1,4 @@ -import{S as Re,i as Ee,s as Pe,V as Te,X as U,h as c,z as y,j as k,c as De,k as m,n as p,o as i,m as Ce,H as ee,Y as he,Z as Be,E as Oe,_ as Ie,G as qe,t as te,a as le,v as f,d as we,J as Ae,p as Me,l as z,q as He,W as Le}from"./index-rWxFAXsK.js";function ke(a,l,s){const o=a.slice();return o[6]=l[s],o}function ge(a,l,s){const o=a.slice();return o[6]=l[s],o}function ve(a){let l;return{c(){l=c("p"),l.innerHTML="Requires superuser Authorization:TOKEN header",m(l,"class","txt-hint txt-sm txt-right")},m(s,o){p(s,l,o)},d(s){s&&f(l)}}}function ye(a,l){let s,o,h;function r(){return l[5](l[6])}return{key:a,first:null,c(){s=c("button"),s.textContent=`${l[6].code} `,m(s,"class","tab-item"),z(s,"active",l[2]===l[6].code),this.first=s},m(n,d){p(n,s,d),o||(h=He(s,"click",r),o=!0)},p(n,d){l=n,d&20&&z(s,"active",l[2]===l[6].code)},d(n){n&&f(s),o=!1,h()}}}function $e(a,l){let s,o,h,r;return o=new Le({props:{content:l[6].body}}),{key:a,first:null,c(){s=c("div"),De(o.$$.fragment),h=k(),m(s,"class","tab-item"),z(s,"active",l[2]===l[6].code),this.first=s},m(n,d){p(n,s,d),Ce(o,s,null),i(s,h),r=!0},p(n,d){l=n,(!r||d&20)&&z(s,"active",l[2]===l[6].code)},i(n){r||(te(o.$$.fragment,n),r=!0)},o(n){le(o.$$.fragment,n),r=!1},d(n){n&&f(s),we(o)}}}function Se(a){var fe,me;let l,s,o=a[0].name+"",h,r,n,d,$,D,F,M=a[0].name+"",G,se,J,C,K,P,N,g,H,ae,L,E,oe,V,S=a[0].name+"",W,ne,X,ie,Y,T,Z,B,Q,O,x,w,I,v=[],ce=new Map,re,q,b=[],de=new Map,R;C=new Te({props:{js:` +import{S as Re,i as Ee,s as Pe,V as Te,X as U,h as c,z as y,j as k,c as De,k as m,n as p,o as i,m as Ce,H as ee,Y as he,Z as Be,E as Oe,_ as Ie,G as qe,t as te,a as le,v as f,d as we,J as Ae,p as Me,l as z,q as He,W as Le}from"./index-C58oTbH7.js";function ke(a,l,s){const o=a.slice();return o[6]=l[s],o}function ge(a,l,s){const o=a.slice();return o[6]=l[s],o}function ve(a){let l;return{c(){l=c("p"),l.innerHTML="Requires superuser Authorization:TOKEN header",m(l,"class","txt-hint txt-sm txt-right")},m(s,o){p(s,l,o)},d(s){s&&f(l)}}}function ye(a,l){let s,o,h;function r(){return l[5](l[6])}return{key:a,first:null,c(){s=c("button"),s.textContent=`${l[6].code} `,m(s,"class","tab-item"),z(s,"active",l[2]===l[6].code),this.first=s},m(n,d){p(n,s,d),o||(h=He(s,"click",r),o=!0)},p(n,d){l=n,d&20&&z(s,"active",l[2]===l[6].code)},d(n){n&&f(s),o=!1,h()}}}function $e(a,l){let s,o,h,r;return o=new Le({props:{content:l[6].body}}),{key:a,first:null,c(){s=c("div"),De(o.$$.fragment),h=k(),m(s,"class","tab-item"),z(s,"active",l[2]===l[6].code),this.first=s},m(n,d){p(n,s,d),Ce(o,s,null),i(s,h),r=!0},p(n,d){l=n,(!r||d&20)&&z(s,"active",l[2]===l[6].code)},i(n){r||(te(o.$$.fragment,n),r=!0)},o(n){le(o.$$.fragment,n),r=!1},d(n){n&&f(s),we(o)}}}function Se(a){var fe,me;let l,s,o=a[0].name+"",h,r,n,d,$,D,F,M=a[0].name+"",G,se,J,C,K,P,N,g,H,ae,L,E,oe,V,S=a[0].name+"",W,ne,X,ie,Y,T,Z,B,Q,O,x,w,I,v=[],ce=new Map,re,q,b=[],de=new Map,R;C=new Te({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${a[3]}'); diff --git a/ui/dist/assets/EmailChangeDocs-BgOnZTqB.js b/ui/dist/assets/EmailChangeDocs-Bks_OEhb.js similarity index 99% rename from ui/dist/assets/EmailChangeDocs-BgOnZTqB.js rename to ui/dist/assets/EmailChangeDocs-Bks_OEhb.js index 99a596c8..c6ff76b6 100644 --- a/ui/dist/assets/EmailChangeDocs-BgOnZTqB.js +++ b/ui/dist/assets/EmailChangeDocs-Bks_OEhb.js @@ -1,4 +1,4 @@ -import{S as se,i as oe,s as ie,X as I,h as p,j as C,z as U,k as b,n as g,o as u,H as F,Y as le,Z as Re,E as ne,_ as Se,G as ae,t as V,a as X,v,l as K,q as ce,W as Oe,c as x,m as ee,d as te,V as Me,$ as _e,J as Be,p as De,a0 as be}from"./index-rWxFAXsK.js";function ge(n,e,t){const l=n.slice();return l[4]=e[t],l}function ve(n,e,t){const l=n.slice();return l[4]=e[t],l}function ke(n,e){let t,l=e[4].code+"",d,i,r,a;function m(){return e[3](e[4])}return{key:n,first:null,c(){t=p("button"),d=U(l),i=C(),b(t,"class","tab-item"),K(t,"active",e[1]===e[4].code),this.first=t},m(k,A){g(k,t,A),u(t,d),u(t,i),r||(a=ce(t,"click",m),r=!0)},p(k,A){e=k,A&4&&l!==(l=e[4].code+"")&&F(d,l),A&6&&K(t,"active",e[1]===e[4].code)},d(k){k&&v(t),r=!1,a()}}}function $e(n,e){let t,l,d,i;return l=new Oe({props:{content:e[4].body}}),{key:n,first:null,c(){t=p("div"),x(l.$$.fragment),d=C(),b(t,"class","tab-item"),K(t,"active",e[1]===e[4].code),this.first=t},m(r,a){g(r,t,a),ee(l,t,null),u(t,d),i=!0},p(r,a){e=r;const m={};a&4&&(m.content=e[4].body),l.$set(m),(!i||a&6)&&K(t,"active",e[1]===e[4].code)},i(r){i||(V(l.$$.fragment,r),i=!0)},o(r){X(l.$$.fragment,r),i=!1},d(r){r&&v(t),te(l)}}}function He(n){let e,t,l,d,i,r,a,m=n[0].name+"",k,A,Y,W,J,L,z,B,D,S,H,q=[],O=new Map,P,j,T=[],N=new Map,w,E=I(n[2]);const M=c=>c[4].code;for(let c=0;cc[4].code;for(let c=0;c<_.length;c+=1){let f=ge(n,_,c),s=Z(f);N.set(s,T[c]=$e(s,f))}return{c(){e=p("div"),t=p("strong"),t.textContent="POST",l=C(),d=p("div"),i=p("p"),r=U("/api/collections/"),a=p("strong"),k=U(m),A=U("/confirm-email-change"),Y=C(),W=p("div"),W.textContent="Body Parameters",J=C(),L=p("table"),L.innerHTML='Param Type Description
Required token
String The token from the change email request email.
Required password
String The account password to confirm the email change.',z=C(),B=p("div"),B.textContent="Responses",D=C(),S=p("div"),H=p("div");for(let c=0;ct(1,d=a.code);return n.$$set=a=>{"collection"in a&&t(0,l=a.collection)},t(2,i=[{code:204,body:"null"},{code:400,body:` +import{S as se,i as oe,s as ie,X as I,h as p,j as C,z as U,k as b,n as g,o as u,H as F,Y as le,Z as Re,E as ne,_ as Se,G as ae,t as V,a as X,v,l as K,q as ce,W as Oe,c as x,m as ee,d as te,V as Me,$ as _e,J as Be,p as De,a0 as be}from"./index-C58oTbH7.js";function ge(n,e,t){const l=n.slice();return l[4]=e[t],l}function ve(n,e,t){const l=n.slice();return l[4]=e[t],l}function ke(n,e){let t,l=e[4].code+"",d,i,r,a;function m(){return e[3](e[4])}return{key:n,first:null,c(){t=p("button"),d=U(l),i=C(),b(t,"class","tab-item"),K(t,"active",e[1]===e[4].code),this.first=t},m(k,A){g(k,t,A),u(t,d),u(t,i),r||(a=ce(t,"click",m),r=!0)},p(k,A){e=k,A&4&&l!==(l=e[4].code+"")&&F(d,l),A&6&&K(t,"active",e[1]===e[4].code)},d(k){k&&v(t),r=!1,a()}}}function $e(n,e){let t,l,d,i;return l=new Oe({props:{content:e[4].body}}),{key:n,first:null,c(){t=p("div"),x(l.$$.fragment),d=C(),b(t,"class","tab-item"),K(t,"active",e[1]===e[4].code),this.first=t},m(r,a){g(r,t,a),ee(l,t,null),u(t,d),i=!0},p(r,a){e=r;const m={};a&4&&(m.content=e[4].body),l.$set(m),(!i||a&6)&&K(t,"active",e[1]===e[4].code)},i(r){i||(V(l.$$.fragment,r),i=!0)},o(r){X(l.$$.fragment,r),i=!1},d(r){r&&v(t),te(l)}}}function He(n){let e,t,l,d,i,r,a,m=n[0].name+"",k,A,Y,W,J,L,z,B,D,S,H,q=[],O=new Map,P,j,T=[],N=new Map,w,E=I(n[2]);const M=c=>c[4].code;for(let c=0;cc[4].code;for(let c=0;c<_.length;c+=1){let f=ge(n,_,c),s=Z(f);N.set(s,T[c]=$e(s,f))}return{c(){e=p("div"),t=p("strong"),t.textContent="POST",l=C(),d=p("div"),i=p("p"),r=U("/api/collections/"),a=p("strong"),k=U(m),A=U("/confirm-email-change"),Y=C(),W=p("div"),W.textContent="Body Parameters",J=C(),L=p("table"),L.innerHTML='Param Type Description
Required token
String The token from the change email request email.
Required password
String The account password to confirm the email change.',z=C(),B=p("div"),B.textContent="Responses",D=C(),S=p("div"),H=p("div");for(let c=0;ct(1,d=a.code);return n.$$set=a=>{"collection"in a&&t(0,l=a.collection)},t(2,i=[{code:204,body:"null"},{code:400,body:` { "code": 400, "message": "An error occurred while validating the submitted data.", diff --git a/ui/dist/assets/FieldsQueryParam-DmBOgcIi.js b/ui/dist/assets/FieldsQueryParam-B-V1imBW.js similarity index 96% rename from ui/dist/assets/FieldsQueryParam-DmBOgcIi.js rename to ui/dist/assets/FieldsQueryParam-B-V1imBW.js index 0e83622d..9db035fb 100644 --- a/ui/dist/assets/FieldsQueryParam-DmBOgcIi.js +++ b/ui/dist/assets/FieldsQueryParam-B-V1imBW.js @@ -1,4 +1,4 @@ -import{S as I,i as J,s as N,W as O,h as t,j as c,z as i,c as P,k as Q,n as R,o as e,m as W,H as A,t as D,a as G,v as K,d as U}from"./index-rWxFAXsK.js";function V(f){let n,o,u,d,v,s,p,y,g,F,r,S,_,w,b,E,C,a,$,H,L,q,M,T,m,j,k,z,x;return r=new O({props:{content:"?fields=*,"+f[0]+"expand.relField.name"}}),{c(){n=t("tr"),o=t("td"),o.textContent="fields",u=c(),d=t("td"),d.innerHTML='String',v=c(),s=t("td"),p=t("p"),y=i(`Comma separated string of the fields to return in the JSON response +import{S as I,i as J,s as N,W as O,h as t,j as c,z as i,c as P,k as Q,n as R,o as e,m as W,H as A,t as D,a as G,v as K,d as U}from"./index-C58oTbH7.js";function V(f){let n,o,u,d,v,s,p,y,g,F,r,S,_,w,b,E,C,a,$,H,L,q,M,T,m,j,k,z,x;return r=new O({props:{content:"?fields=*,"+f[0]+"expand.relField.name"}}),{c(){n=t("tr"),o=t("td"),o.textContent="fields",u=c(),d=t("td"),d.innerHTML='String',v=c(),s=t("td"),p=t("p"),y=i(`Comma separated string of the fields to return in the JSON response `),g=t("em"),g.textContent="(by default returns all fields)",F=i(`. Ex.: `),P(r.$$.fragment),S=c(),_=t("p"),_.innerHTML="* targets all keys from the specific depth level.",w=c(),b=t("p"),b.textContent="In addition, the following field modifiers are also supported:",E=c(),C=t("ul"),a=t("li"),$=t("code"),$.textContent=":excerpt(maxLength, withEllipsis?)",H=c(),L=t("br"),q=i(` Returns a short plain text version of the field string value. diff --git a/ui/dist/assets/FilterAutocompleteInput-Ek7e14PX.js b/ui/dist/assets/FilterAutocompleteInput-DNssmiMR.js similarity index 97% rename from ui/dist/assets/FilterAutocompleteInput-Ek7e14PX.js rename to ui/dist/assets/FilterAutocompleteInput-DNssmiMR.js index 7ab26d91..c0b99cff 100644 --- a/ui/dist/assets/FilterAutocompleteInput-Ek7e14PX.js +++ b/ui/dist/assets/FilterAutocompleteInput-DNssmiMR.js @@ -1 +1 @@ -import{S as $,i as ee,s as te,h as ne,k as re,n as ie,I,v as ae,O as oe,T as le,U as se,Q as de,J as u,y as ce}from"./index-rWxFAXsK.js";import{c as fe,d as ue,s as ge,h as he,a as ye,E,b as S,e as pe,f as ke,g as me,i as xe,j as be,k as we,l as Ee,m as Se,r as Ke,n as Ce,o as Re,p as Le,q as Q,C as R,S as qe,t as ve,u as Oe,v as We}from"./index-C-PlLH2L.js";function _e(e){return new Worker(""+new URL("autocomplete.worker-BdIjQwYp.js",import.meta.url).href,{name:e==null?void 0:e.name})}function Ie(e){j(e,"start");var r={},t=e.languageData||{},g=!1;for(var h in e)if(h!=t&&e.hasOwnProperty(h))for(var f=r[h]=[],a=e[h],i=0;i2&&a.token&&typeof a.token!="string"){t.pending=[];for(var s=2;s-1)return null;var h=t.indent.length-1,f=e[t.state];e:for(;;){for(var a=0;at(21,g=n));const h=se();let{id:f=""}=r,{value:a=""}=r,{disabled:i=!1}=r,{placeholder:o=""}=r,{baseCollection:s=null}=r,{singleLine:y=!1}=r,{extraAutocompleteKeys:L=[]}=r,{disableRequestKeys:b=!1}=r,{disableCollectionJoinKeys:m=!1}=r,d,p,q=i,D=new R,J=new R,A=new R,B=new R,v=new _e,M=[],T=[],H=[],K="",O="";function W(){d==null||d.focus()}let _=null;v.onmessage=n=>{H=n.data.baseKeys||[],M=n.data.requestKeys||[],T=n.data.collectionJoinKeys||[]};function G(){clearTimeout(_),_=setTimeout(()=>{v.postMessage({baseCollection:s,collections:V(g),disableRequestKeys:b,disableCollectionJoinKeys:m})},250)}function V(n){let c=n.slice();return s&&u.pushOrReplaceByKey(c,s,"id"),c}function U(){p==null||p.dispatchEvent(new CustomEvent("change",{detail:{value:a},bubbles:!0}))}function F(){if(!f)return;const n=document.querySelectorAll('[for="'+f+'"]');for(let c of n)c.removeEventListener("click",W)}function N(){if(!f)return;F();const n=document.querySelectorAll('[for="'+f+'"]');for(let c of n)c.addEventListener("click",W)}function Y(n=!0,c=!0){let l=[].concat(L);return l=l.concat(H||[]),n&&(l=l.concat(M||[])),c&&(l=l.concat(T||[])),l}function z(n){var w;let c=n.matchBefore(/[\'\"\@\w\.]*/);if(c&&c.from==c.to&&!n.explicit)return null;let l=We(n.state).resolveInner(n.pos,-1);if(((w=l==null?void 0:l.type)==null?void 0:w.name)=="comment")return null;let x=[{label:"false"},{label:"true"},{label:"@now"},{label:"@second"},{label:"@minute"},{label:"@hour"},{label:"@year"},{label:"@day"},{label:"@month"},{label:"@weekday"},{label:"@todayStart"},{label:"@todayEnd"},{label:"@monthStart"},{label:"@monthEnd"},{label:"@yearStart"},{label:"@yearEnd"}];m||x.push({label:"@collection.*",apply:"@collection."});let C=Y(!b&&c.text.startsWith("@r"),!m&&c.text.startsWith("@c"));for(const k of C)x.push({label:k.endsWith(".")?k+"*":k,apply:k,boost:k.indexOf("_via_")>0?-1:0});return{from:c.from,options:x}}function P(){return qe.define(Ie({start:[{regex:/true|false|null/,token:"atom"},{regex:/\/\/.*/,token:"comment"},{regex:/"(?:[^\\]|\\.)*?(?:"|$)/,token:"string"},{regex:/'(?:[^\\]|\\.)*?(?:'|$)/,token:"string"},{regex:/0x[a-f\d]+|[-+]?(?:\.\d+|\d+\.?\d*)(?:e[-+]?\d+)?/i,token:"number"},{regex:/\&\&|\|\||\=|\!\=|\~|\!\~|\>|\<|\>\=|\<\=/,token:"operator"},{regex:/[\{\[\(]/,indent:!0},{regex:/[\}\]\)]/,dedent:!0},{regex:/\w+[\w\.]*\w+/,token:"keyword"},{regex:u.escapeRegExp("@now"),token:"keyword"},{regex:u.escapeRegExp("@second"),token:"keyword"},{regex:u.escapeRegExp("@minute"),token:"keyword"},{regex:u.escapeRegExp("@hour"),token:"keyword"},{regex:u.escapeRegExp("@year"),token:"keyword"},{regex:u.escapeRegExp("@day"),token:"keyword"},{regex:u.escapeRegExp("@month"),token:"keyword"},{regex:u.escapeRegExp("@weekday"),token:"keyword"},{regex:u.escapeRegExp("@todayStart"),token:"keyword"},{regex:u.escapeRegExp("@todayEnd"),token:"keyword"},{regex:u.escapeRegExp("@monthStart"),token:"keyword"},{regex:u.escapeRegExp("@monthEnd"),token:"keyword"},{regex:u.escapeRegExp("@yearStart"),token:"keyword"},{regex:u.escapeRegExp("@yearEnd"),token:"keyword"},{regex:u.escapeRegExp("@request.method"),token:"keyword"}],meta:{lineComment:"//"}}))}de(()=>{const n={key:"Enter",run:l=>{y&&h("submit",a)}};N();let c=[n,...fe,...ue,ge.find(l=>l.key==="Mod-d"),...he,...ye];return y||c.push(ve),t(11,d=new E({parent:p,state:S.create({doc:a,extensions:[pe(),ke(),me(),xe(),be(),S.allowMultipleSelections.of(!0),we(Oe,{fallback:!0}),Ee(),Se(),Ke(),Ce(),Re.of(c),E.lineWrapping,Le({override:[z],icons:!1}),B.of(Q(o)),J.of(E.editable.of(!i)),A.of(S.readOnly.of(i)),D.of(P()),S.transactionFilter.of(l=>{var x,C,w;if(y&&l.newDoc.lines>1){if(!((w=(C=(x=l.changes)==null?void 0:x.inserted)==null?void 0:C.filter(k=>!!k.text.find(Z=>Z)))!=null&&w.length))return[];l.newDoc.text=[l.newDoc.text.join(" ")]}return l}),E.updateListener.of(l=>{!l.docChanged||i||(t(1,a=l.state.doc.toString()),U())})]})})),()=>{clearTimeout(_),F(),d==null||d.destroy(),v.terminate()}});function X(n){ce[n?"unshift":"push"](()=>{p=n,t(0,p)})}return e.$$set=n=>{"id"in n&&t(2,f=n.id),"value"in n&&t(1,a=n.value),"disabled"in n&&t(3,i=n.disabled),"placeholder"in n&&t(4,o=n.placeholder),"baseCollection"in n&&t(5,s=n.baseCollection),"singleLine"in n&&t(6,y=n.singleLine),"extraAutocompleteKeys"in n&&t(7,L=n.extraAutocompleteKeys),"disableRequestKeys"in n&&t(8,b=n.disableRequestKeys),"disableCollectionJoinKeys"in n&&t(9,m=n.disableCollectionJoinKeys)},e.$$.update=()=>{e.$$.dirty[0]&32&&t(13,K=He(s)),e.$$.dirty[0]&25352&&!i&&(O!=K||b!==-1||m!==-1)&&(t(14,O=K),G()),e.$$.dirty[0]&4&&f&&N(),e.$$.dirty[0]&2080&&d&&s!=null&&s.fields&&d.dispatch({effects:[D.reconfigure(P())]}),e.$$.dirty[0]&6152&&d&&q!=i&&(d.dispatch({effects:[J.reconfigure(E.editable.of(!i)),A.reconfigure(S.readOnly.of(i))]}),t(12,q=i),U()),e.$$.dirty[0]&2050&&d&&a!=d.state.doc.toString()&&d.dispatch({changes:{from:0,to:d.state.doc.length,insert:a}}),e.$$.dirty[0]&2064&&d&&typeof o<"u"&&d.dispatch({effects:[B.reconfigure(Q(o))]})},[p,a,f,i,o,s,y,L,b,m,W,d,q,K,O,X]}class Pe extends ${constructor(r){super(),ee(this,r,Ue,Te,te,{id:2,value:1,disabled:3,placeholder:4,baseCollection:5,singleLine:6,extraAutocompleteKeys:7,disableRequestKeys:8,disableCollectionJoinKeys:9,focus:10},null,[-1,-1])}get focus(){return this.$$.ctx[10]}}export{Pe as default}; +import{S as $,i as ee,s as te,h as ne,k as re,n as ie,I,v as ae,O as oe,T as le,U as se,Q as de,J as u,y as ce}from"./index-C58oTbH7.js";import{c as fe,d as ue,s as ge,h as he,a as ye,E,b as S,e as pe,f as ke,g as me,i as xe,j as be,k as we,l as Ee,m as Se,r as Ke,n as Ce,o as Re,p as Le,q as Q,C as R,S as qe,t as ve,u as Oe,v as We}from"./index-CH-gyH77.js";function _e(e){return new Worker(""+new URL("autocomplete.worker-BdIjQwYp.js",import.meta.url).href,{name:e==null?void 0:e.name})}function Ie(e){j(e,"start");var r={},t=e.languageData||{},g=!1;for(var h in e)if(h!=t&&e.hasOwnProperty(h))for(var f=r[h]=[],a=e[h],i=0;i2&&a.token&&typeof a.token!="string"){t.pending=[];for(var s=2;s-1)return null;var h=t.indent.length-1,f=e[t.state];e:for(;;){for(var a=0;at(21,g=n));const h=se();let{id:f=""}=r,{value:a=""}=r,{disabled:i=!1}=r,{placeholder:o=""}=r,{baseCollection:s=null}=r,{singleLine:y=!1}=r,{extraAutocompleteKeys:L=[]}=r,{disableRequestKeys:b=!1}=r,{disableCollectionJoinKeys:m=!1}=r,d,p,q=i,D=new R,J=new R,A=new R,B=new R,v=new _e,M=[],T=[],H=[],K="",O="";function W(){d==null||d.focus()}let _=null;v.onmessage=n=>{H=n.data.baseKeys||[],M=n.data.requestKeys||[],T=n.data.collectionJoinKeys||[]};function G(){clearTimeout(_),_=setTimeout(()=>{v.postMessage({baseCollection:s,collections:V(g),disableRequestKeys:b,disableCollectionJoinKeys:m})},250)}function V(n){let c=n.slice();return s&&u.pushOrReplaceByKey(c,s,"id"),c}function U(){p==null||p.dispatchEvent(new CustomEvent("change",{detail:{value:a},bubbles:!0}))}function F(){if(!f)return;const n=document.querySelectorAll('[for="'+f+'"]');for(let c of n)c.removeEventListener("click",W)}function N(){if(!f)return;F();const n=document.querySelectorAll('[for="'+f+'"]');for(let c of n)c.addEventListener("click",W)}function Y(n=!0,c=!0){let l=[].concat(L);return l=l.concat(H||[]),n&&(l=l.concat(M||[])),c&&(l=l.concat(T||[])),l}function z(n){var w;let c=n.matchBefore(/[\'\"\@\w\.]*/);if(c&&c.from==c.to&&!n.explicit)return null;let l=We(n.state).resolveInner(n.pos,-1);if(((w=l==null?void 0:l.type)==null?void 0:w.name)=="comment")return null;let x=[{label:"false"},{label:"true"},{label:"@now"},{label:"@second"},{label:"@minute"},{label:"@hour"},{label:"@year"},{label:"@day"},{label:"@month"},{label:"@weekday"},{label:"@todayStart"},{label:"@todayEnd"},{label:"@monthStart"},{label:"@monthEnd"},{label:"@yearStart"},{label:"@yearEnd"}];m||x.push({label:"@collection.*",apply:"@collection."});let C=Y(!b&&c.text.startsWith("@r"),!m&&c.text.startsWith("@c"));for(const k of C)x.push({label:k.endsWith(".")?k+"*":k,apply:k,boost:k.indexOf("_via_")>0?-1:0});return{from:c.from,options:x}}function P(){return qe.define(Ie({start:[{regex:/true|false|null/,token:"atom"},{regex:/\/\/.*/,token:"comment"},{regex:/"(?:[^\\]|\\.)*?(?:"|$)/,token:"string"},{regex:/'(?:[^\\]|\\.)*?(?:'|$)/,token:"string"},{regex:/0x[a-f\d]+|[-+]?(?:\.\d+|\d+\.?\d*)(?:e[-+]?\d+)?/i,token:"number"},{regex:/\&\&|\|\||\=|\!\=|\~|\!\~|\>|\<|\>\=|\<\=/,token:"operator"},{regex:/[\{\[\(]/,indent:!0},{regex:/[\}\]\)]/,dedent:!0},{regex:/\w+[\w\.]*\w+/,token:"keyword"},{regex:u.escapeRegExp("@now"),token:"keyword"},{regex:u.escapeRegExp("@second"),token:"keyword"},{regex:u.escapeRegExp("@minute"),token:"keyword"},{regex:u.escapeRegExp("@hour"),token:"keyword"},{regex:u.escapeRegExp("@year"),token:"keyword"},{regex:u.escapeRegExp("@day"),token:"keyword"},{regex:u.escapeRegExp("@month"),token:"keyword"},{regex:u.escapeRegExp("@weekday"),token:"keyword"},{regex:u.escapeRegExp("@todayStart"),token:"keyword"},{regex:u.escapeRegExp("@todayEnd"),token:"keyword"},{regex:u.escapeRegExp("@monthStart"),token:"keyword"},{regex:u.escapeRegExp("@monthEnd"),token:"keyword"},{regex:u.escapeRegExp("@yearStart"),token:"keyword"},{regex:u.escapeRegExp("@yearEnd"),token:"keyword"},{regex:u.escapeRegExp("@request.method"),token:"keyword"}],meta:{lineComment:"//"}}))}de(()=>{const n={key:"Enter",run:l=>{y&&h("submit",a)}};N();let c=[n,...fe,...ue,ge.find(l=>l.key==="Mod-d"),...he,...ye];return y||c.push(ve),t(11,d=new E({parent:p,state:S.create({doc:a,extensions:[pe(),ke(),me(),xe(),be(),S.allowMultipleSelections.of(!0),we(Oe,{fallback:!0}),Ee(),Se(),Ke(),Ce(),Re.of(c),E.lineWrapping,Le({override:[z],icons:!1}),B.of(Q(o)),J.of(E.editable.of(!i)),A.of(S.readOnly.of(i)),D.of(P()),S.transactionFilter.of(l=>{var x,C,w;if(y&&l.newDoc.lines>1){if(!((w=(C=(x=l.changes)==null?void 0:x.inserted)==null?void 0:C.filter(k=>!!k.text.find(Z=>Z)))!=null&&w.length))return[];l.newDoc.text=[l.newDoc.text.join(" ")]}return l}),E.updateListener.of(l=>{!l.docChanged||i||(t(1,a=l.state.doc.toString()),U())})]})})),()=>{clearTimeout(_),F(),d==null||d.destroy(),v.terminate()}});function X(n){ce[n?"unshift":"push"](()=>{p=n,t(0,p)})}return e.$$set=n=>{"id"in n&&t(2,f=n.id),"value"in n&&t(1,a=n.value),"disabled"in n&&t(3,i=n.disabled),"placeholder"in n&&t(4,o=n.placeholder),"baseCollection"in n&&t(5,s=n.baseCollection),"singleLine"in n&&t(6,y=n.singleLine),"extraAutocompleteKeys"in n&&t(7,L=n.extraAutocompleteKeys),"disableRequestKeys"in n&&t(8,b=n.disableRequestKeys),"disableCollectionJoinKeys"in n&&t(9,m=n.disableCollectionJoinKeys)},e.$$.update=()=>{e.$$.dirty[0]&32&&t(13,K=He(s)),e.$$.dirty[0]&25352&&!i&&(O!=K||b!==-1||m!==-1)&&(t(14,O=K),G()),e.$$.dirty[0]&4&&f&&N(),e.$$.dirty[0]&2080&&d&&s!=null&&s.fields&&d.dispatch({effects:[D.reconfigure(P())]}),e.$$.dirty[0]&6152&&d&&q!=i&&(d.dispatch({effects:[J.reconfigure(E.editable.of(!i)),A.reconfigure(S.readOnly.of(i))]}),t(12,q=i),U()),e.$$.dirty[0]&2050&&d&&a!=d.state.doc.toString()&&d.dispatch({changes:{from:0,to:d.state.doc.length,insert:a}}),e.$$.dirty[0]&2064&&d&&typeof o<"u"&&d.dispatch({effects:[B.reconfigure(Q(o))]})},[p,a,f,i,o,s,y,L,b,m,W,d,q,K,O,X]}class Pe extends ${constructor(r){super(),ee(this,r,Ue,Te,te,{id:2,value:1,disabled:3,placeholder:4,baseCollection:5,singleLine:6,extraAutocompleteKeys:7,disableRequestKeys:8,disableCollectionJoinKeys:9,focus:10},null,[-1,-1])}get focus(){return this.$$.ctx[10]}}export{Pe as default}; diff --git a/ui/dist/assets/ListApiDocs-D54ZVVWM.js b/ui/dist/assets/ListApiDocs-C43-0tDt.js similarity index 99% rename from ui/dist/assets/ListApiDocs-D54ZVVWM.js rename to ui/dist/assets/ListApiDocs-C43-0tDt.js index 1d77935a..6bf6a3fc 100644 --- a/ui/dist/assets/ListApiDocs-D54ZVVWM.js +++ b/ui/dist/assets/ListApiDocs-C43-0tDt.js @@ -1,4 +1,4 @@ -import{S as el,i as ll,s as sl,h as e,j as s,L as ol,k as a,n as m,q as nl,I as Ue,v as h,z as g,o as t,V as al,W as Le,X as ae,c as Kt,m as Qt,H as ve,Y as Je,Z as il,E as rl,_ as cl,G as dl,t as Ct,a as kt,d as Vt,$ as pl,J as Te,p as fl,l as Ae}from"./index-rWxFAXsK.js";import{F as ul}from"./FieldsQueryParam-DmBOgcIi.js";function ml(r){let n,o,i;return{c(){n=e("span"),n.textContent="Show details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-down-s-line")},m(f,b){m(f,n,b),m(f,o,b),m(f,i,b)},d(f){f&&(h(n),h(o),h(i))}}}function hl(r){let n,o,i;return{c(){n=e("span"),n.textContent="Hide details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-up-s-line")},m(f,b){m(f,n,b),m(f,o,b),m(f,i,b)},d(f){f&&(h(n),h(o),h(i))}}}function Ke(r){let n,o,i,f,b,p,u,C,_,x,d,Y,yt,Wt,S,Xt,H,it,P,Z,ie,j,z,re,rt,vt,tt,Ft,ce,ct,dt,et,q,Yt,Lt,k,lt,At,Zt,Tt,U,st,Pt,te,Rt,v,pt,Ot,de,ft,pe,D,Et,nt,St,F,ut,fe,J,qt,ee,Nt,le,Ht,ue,L,mt,me,ht,he,M,be,T,Dt,ot,Mt,K,bt,ge,I,It,y,Bt,at,Gt,_e,Q,gt,we,_t,xe,jt,$e,B,zt,Ce,G,ke,wt,se,R,xt,V,W,O,Ut,ne,X;return{c(){n=e("p"),n.innerHTML=`The syntax basically follows the format +import{S as el,i as ll,s as sl,h as e,j as s,L as ol,k as a,n as m,q as nl,I as Ue,v as h,z as g,o as t,V as al,W as Le,X as ae,c as Kt,m as Qt,H as ve,Y as Je,Z as il,E as rl,_ as cl,G as dl,t as Ct,a as kt,d as Vt,$ as pl,J as Te,p as fl,l as Ae}from"./index-C58oTbH7.js";import{F as ul}from"./FieldsQueryParam-B-V1imBW.js";function ml(r){let n,o,i;return{c(){n=e("span"),n.textContent="Show details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-down-s-line")},m(f,b){m(f,n,b),m(f,o,b),m(f,i,b)},d(f){f&&(h(n),h(o),h(i))}}}function hl(r){let n,o,i;return{c(){n=e("span"),n.textContent="Hide details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-up-s-line")},m(f,b){m(f,n,b),m(f,o,b),m(f,i,b)},d(f){f&&(h(n),h(o),h(i))}}}function Ke(r){let n,o,i,f,b,p,u,C,_,x,d,Y,yt,Wt,S,Xt,H,it,P,Z,ie,j,z,re,rt,vt,tt,Ft,ce,ct,dt,et,q,Yt,Lt,k,lt,At,Zt,Tt,U,st,Pt,te,Rt,v,pt,Ot,de,ft,pe,D,Et,nt,St,F,ut,fe,J,qt,ee,Nt,le,Ht,ue,L,mt,me,ht,he,M,be,T,Dt,ot,Mt,K,bt,ge,I,It,y,Bt,at,Gt,_e,Q,gt,we,_t,xe,jt,$e,B,zt,Ce,G,ke,wt,se,R,xt,V,W,O,Ut,ne,X;return{c(){n=e("p"),n.innerHTML=`The syntax basically follows the format OPERAND OPERATOR OPERAND, where:`,o=s(),i=e("ul"),f=e("li"),f.innerHTML=`OPERAND - could be any of the above field literal, string (single or double quoted), number, null, true, false`,b=s(),p=e("li"),u=e("code"),u.textContent="OPERATOR",C=g(` - is one of: `),_=e("br"),x=s(),d=e("ul"),Y=e("li"),yt=e("code"),yt.textContent="=",Wt=s(),S=e("span"),S.textContent="Equal",Xt=s(),H=e("li"),it=e("code"),it.textContent="!=",P=s(),Z=e("span"),Z.textContent="NOT equal",ie=s(),j=e("li"),z=e("code"),z.textContent=">",re=s(),rt=e("span"),rt.textContent="Greater than",vt=s(),tt=e("li"),Ft=e("code"),Ft.textContent=">=",ce=s(),ct=e("span"),ct.textContent="Greater than or equal",dt=s(),et=e("li"),q=e("code"),q.textContent="<",Yt=s(),Lt=e("span"),Lt.textContent="Less than",k=s(),lt=e("li"),At=e("code"),At.textContent="<=",Zt=s(),Tt=e("span"),Tt.textContent="Less than or equal",U=s(),st=e("li"),Pt=e("code"),Pt.textContent="~",te=s(),Rt=e("span"),Rt.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for diff --git a/ui/dist/assets/PageInstaller-5hIJ_v1g.js b/ui/dist/assets/PageInstaller-DJzBwXdp.js similarity index 98% rename from ui/dist/assets/PageInstaller-5hIJ_v1g.js rename to ui/dist/assets/PageInstaller-DJzBwXdp.js index aee96724..81255b53 100644 --- a/ui/dist/assets/PageInstaller-5hIJ_v1g.js +++ b/ui/dist/assets/PageInstaller-DJzBwXdp.js @@ -1,3 +1,3 @@ -import{S as W,i as G,s as J,F as Q,c as S,m as E,t as O,a as j,d as D,r as M,g as V,p as C,b as X,e as Y,f as K,h as k,j as q,k as r,l as z,n as m,o as T,q as I,u as Z,v as h,w as x,x as ee,y as U,z as N,A,B as te}from"./index-rWxFAXsK.js";function ne(s){let t,o,u,n,e,p,_,d;return{c(){t=k("label"),o=N("Email"),n=q(),e=k("input"),r(t,"for",u=s[20]),r(e,"type","email"),r(e,"autocomplete","off"),r(e,"id",p=s[20]),e.disabled=s[7],e.required=!0},m(a,i){m(a,t,i),T(t,o),m(a,n,i),m(a,e,i),s[11](e),A(e,s[2]),_||(d=I(e,"input",s[12]),_=!0)},p(a,i){i&1048576&&u!==(u=a[20])&&r(t,"for",u),i&1048576&&p!==(p=a[20])&&r(e,"id",p),i&128&&(e.disabled=a[7]),i&4&&e.value!==a[2]&&A(e,a[2])},d(a){a&&(h(t),h(n),h(e)),s[11](null),_=!1,d()}}}function le(s){let t,o,u,n,e,p,_,d,a,i;return{c(){t=k("label"),o=N("Password"),n=q(),e=k("input"),_=q(),d=k("div"),d.textContent="Recommended at least 10 characters.",r(t,"for",u=s[20]),r(e,"type","password"),r(e,"autocomplete","new-password"),r(e,"minlength","10"),r(e,"id",p=s[20]),e.disabled=s[7],e.required=!0,r(d,"class","help-block")},m(c,g){m(c,t,g),T(t,o),m(c,n,g),m(c,e,g),A(e,s[3]),m(c,_,g),m(c,d,g),a||(i=I(e,"input",s[13]),a=!0)},p(c,g){g&1048576&&u!==(u=c[20])&&r(t,"for",u),g&1048576&&p!==(p=c[20])&&r(e,"id",p),g&128&&(e.disabled=c[7]),g&8&&e.value!==c[3]&&A(e,c[3])},d(c){c&&(h(t),h(n),h(e),h(_),h(d)),a=!1,i()}}}function se(s){let t,o,u,n,e,p,_,d;return{c(){t=k("label"),o=N("Password confirm"),n=q(),e=k("input"),r(t,"for",u=s[20]),r(e,"type","password"),r(e,"minlength","10"),r(e,"id",p=s[20]),e.disabled=s[7],e.required=!0},m(a,i){m(a,t,i),T(t,o),m(a,n,i),m(a,e,i),A(e,s[4]),_||(d=I(e,"input",s[14]),_=!0)},p(a,i){i&1048576&&u!==(u=a[20])&&r(t,"for",u),i&1048576&&p!==(p=a[20])&&r(e,"id",p),i&128&&(e.disabled=a[7]),i&16&&e.value!==a[4]&&A(e,a[4])},d(a){a&&(h(t),h(n),h(e)),_=!1,d()}}}function ie(s){let t,o,u,n,e,p,_,d,a,i,c,g,B,w,F,$,v,y,L;return n=new K({props:{class:"form-field required",name:"email",$$slots:{default:[ne,({uniqueId:l})=>({20:l}),({uniqueId:l})=>l?1048576:0]},$$scope:{ctx:s}}}),p=new K({props:{class:"form-field required",name:"password",$$slots:{default:[le,({uniqueId:l})=>({20:l}),({uniqueId:l})=>l?1048576:0]},$$scope:{ctx:s}}}),d=new K({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[se,({uniqueId:l})=>({20:l}),({uniqueId:l})=>l?1048576:0]},$$scope:{ctx:s}}}),{c(){t=k("form"),o=k("div"),o.innerHTML="

Create your first superuser account in order to continue

",u=q(),S(n.$$.fragment),e=q(),S(p.$$.fragment),_=q(),S(d.$$.fragment),a=q(),i=k("button"),i.innerHTML='Create superuser and login ',c=q(),g=k("hr"),B=q(),w=k("label"),w.innerHTML=' Or initialize from backup',F=q(),$=k("input"),r(o,"class","content txt-center m-b-base"),r(i,"type","submit"),r(i,"class","btn btn-lg btn-block btn-next"),z(i,"btn-disabled",s[7]),z(i,"btn-loading",s[0]),r(t,"class","block"),r(t,"autocomplete","off"),r(w,"for","backupFileInput"),r(w,"class","btn btn-lg btn-hint btn-transparent btn-block"),z(w,"btn-disabled",s[7]),z(w,"btn-loading",s[1]),r($,"id","backupFileInput"),r($,"type","file"),r($,"class","hidden"),r($,"accept",".zip")},m(l,b){m(l,t,b),T(t,o),T(t,u),E(n,t,null),T(t,e),E(p,t,null),T(t,_),E(d,t,null),T(t,a),T(t,i),m(l,c,b),m(l,g,b),m(l,B,b),m(l,w,b),m(l,F,b),m(l,$,b),s[15]($),v=!0,y||(L=[I(t,"submit",Z(s[8])),I($,"change",s[16])],y=!0)},p(l,b){const H={};b&3145892&&(H.$$scope={dirty:b,ctx:l}),n.$set(H);const f={};b&3145864&&(f.$$scope={dirty:b,ctx:l}),p.$set(f);const P={};b&3145872&&(P.$$scope={dirty:b,ctx:l}),d.$set(P),(!v||b&128)&&z(i,"btn-disabled",l[7]),(!v||b&1)&&z(i,"btn-loading",l[0]),(!v||b&128)&&z(w,"btn-disabled",l[7]),(!v||b&2)&&z(w,"btn-loading",l[1])},i(l){v||(O(n.$$.fragment,l),O(p.$$.fragment,l),O(d.$$.fragment,l),v=!0)},o(l){j(n.$$.fragment,l),j(p.$$.fragment,l),j(d.$$.fragment,l),v=!1},d(l){l&&(h(t),h(c),h(g),h(B),h(w),h(F),h($)),D(n),D(p),D(d),s[15](null),y=!1,x(L)}}}function ae(s){let t,o;return t=new Q({props:{$$slots:{default:[ie]},$$scope:{ctx:s}}}),{c(){S(t.$$.fragment)},m(u,n){E(t,u,n),o=!0},p(u,[n]){const e={};n&2097407&&(e.$$scope={dirty:n,ctx:u}),t.$set(e)},i(u){o||(O(t.$$.fragment,u),o=!0)},o(u){j(t.$$.fragment,u),o=!1},d(u){D(t,u)}}}function oe(s,t,o){let u,{params:n}=t,e="",p="",_="",d=!1,a=!1,i,c;g();async function g(){if(!(n!=null&&n.token))return M("/");o(0,d=!0);try{const f=V(n==null?void 0:n.token);await C.collection("_superusers").getOne(f.id,{requestKey:"installer_token_check",headers:{Authorization:n==null?void 0:n.token}})}catch(f){f!=null&&f.isAbort||(X("The installer token is invalid or has expired."),M("/"))}o(0,d=!1),await Y(),i==null||i.focus()}async function B(){if(!u){o(0,d=!0);try{await C.collection("_superusers").create({email:e,password:p,passwordConfirm:_},{headers:{Authorization:n==null?void 0:n.token}}),await C.collection("_superusers").authWithPassword(e,p),M("/")}catch(f){C.error(f)}o(0,d=!1)}}function w(){c&&o(6,c.value="",c)}function F(f){f&&ee(`Note that we don't perform validations for the uploaded backup files. Proceed with caution and only if you trust the file source. +import{S as W,i as G,s as J,F as Q,c as S,m as E,t as O,a as j,d as D,r as M,g as V,p as C,b as X,e as Y,f as K,h as k,j as q,k as r,l as z,n as m,o as T,q as I,u as Z,v as h,w as x,x as ee,y as U,z as N,A,B as te}from"./index-C58oTbH7.js";function ne(s){let t,o,u,n,e,p,_,d;return{c(){t=k("label"),o=N("Email"),n=q(),e=k("input"),r(t,"for",u=s[20]),r(e,"type","email"),r(e,"autocomplete","off"),r(e,"id",p=s[20]),e.disabled=s[7],e.required=!0},m(a,i){m(a,t,i),T(t,o),m(a,n,i),m(a,e,i),s[11](e),A(e,s[2]),_||(d=I(e,"input",s[12]),_=!0)},p(a,i){i&1048576&&u!==(u=a[20])&&r(t,"for",u),i&1048576&&p!==(p=a[20])&&r(e,"id",p),i&128&&(e.disabled=a[7]),i&4&&e.value!==a[2]&&A(e,a[2])},d(a){a&&(h(t),h(n),h(e)),s[11](null),_=!1,d()}}}function le(s){let t,o,u,n,e,p,_,d,a,i;return{c(){t=k("label"),o=N("Password"),n=q(),e=k("input"),_=q(),d=k("div"),d.textContent="Recommended at least 10 characters.",r(t,"for",u=s[20]),r(e,"type","password"),r(e,"autocomplete","new-password"),r(e,"minlength","10"),r(e,"id",p=s[20]),e.disabled=s[7],e.required=!0,r(d,"class","help-block")},m(c,g){m(c,t,g),T(t,o),m(c,n,g),m(c,e,g),A(e,s[3]),m(c,_,g),m(c,d,g),a||(i=I(e,"input",s[13]),a=!0)},p(c,g){g&1048576&&u!==(u=c[20])&&r(t,"for",u),g&1048576&&p!==(p=c[20])&&r(e,"id",p),g&128&&(e.disabled=c[7]),g&8&&e.value!==c[3]&&A(e,c[3])},d(c){c&&(h(t),h(n),h(e),h(_),h(d)),a=!1,i()}}}function se(s){let t,o,u,n,e,p,_,d;return{c(){t=k("label"),o=N("Password confirm"),n=q(),e=k("input"),r(t,"for",u=s[20]),r(e,"type","password"),r(e,"minlength","10"),r(e,"id",p=s[20]),e.disabled=s[7],e.required=!0},m(a,i){m(a,t,i),T(t,o),m(a,n,i),m(a,e,i),A(e,s[4]),_||(d=I(e,"input",s[14]),_=!0)},p(a,i){i&1048576&&u!==(u=a[20])&&r(t,"for",u),i&1048576&&p!==(p=a[20])&&r(e,"id",p),i&128&&(e.disabled=a[7]),i&16&&e.value!==a[4]&&A(e,a[4])},d(a){a&&(h(t),h(n),h(e)),_=!1,d()}}}function ie(s){let t,o,u,n,e,p,_,d,a,i,c,g,B,w,F,$,v,y,L;return n=new K({props:{class:"form-field required",name:"email",$$slots:{default:[ne,({uniqueId:l})=>({20:l}),({uniqueId:l})=>l?1048576:0]},$$scope:{ctx:s}}}),p=new K({props:{class:"form-field required",name:"password",$$slots:{default:[le,({uniqueId:l})=>({20:l}),({uniqueId:l})=>l?1048576:0]},$$scope:{ctx:s}}}),d=new K({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[se,({uniqueId:l})=>({20:l}),({uniqueId:l})=>l?1048576:0]},$$scope:{ctx:s}}}),{c(){t=k("form"),o=k("div"),o.innerHTML="

Create your first superuser account in order to continue

",u=q(),S(n.$$.fragment),e=q(),S(p.$$.fragment),_=q(),S(d.$$.fragment),a=q(),i=k("button"),i.innerHTML='Create superuser and login ',c=q(),g=k("hr"),B=q(),w=k("label"),w.innerHTML=' Or initialize from backup',F=q(),$=k("input"),r(o,"class","content txt-center m-b-base"),r(i,"type","submit"),r(i,"class","btn btn-lg btn-block btn-next"),z(i,"btn-disabled",s[7]),z(i,"btn-loading",s[0]),r(t,"class","block"),r(t,"autocomplete","off"),r(w,"for","backupFileInput"),r(w,"class","btn btn-lg btn-hint btn-transparent btn-block"),z(w,"btn-disabled",s[7]),z(w,"btn-loading",s[1]),r($,"id","backupFileInput"),r($,"type","file"),r($,"class","hidden"),r($,"accept",".zip")},m(l,b){m(l,t,b),T(t,o),T(t,u),E(n,t,null),T(t,e),E(p,t,null),T(t,_),E(d,t,null),T(t,a),T(t,i),m(l,c,b),m(l,g,b),m(l,B,b),m(l,w,b),m(l,F,b),m(l,$,b),s[15]($),v=!0,y||(L=[I(t,"submit",Z(s[8])),I($,"change",s[16])],y=!0)},p(l,b){const H={};b&3145892&&(H.$$scope={dirty:b,ctx:l}),n.$set(H);const f={};b&3145864&&(f.$$scope={dirty:b,ctx:l}),p.$set(f);const P={};b&3145872&&(P.$$scope={dirty:b,ctx:l}),d.$set(P),(!v||b&128)&&z(i,"btn-disabled",l[7]),(!v||b&1)&&z(i,"btn-loading",l[0]),(!v||b&128)&&z(w,"btn-disabled",l[7]),(!v||b&2)&&z(w,"btn-loading",l[1])},i(l){v||(O(n.$$.fragment,l),O(p.$$.fragment,l),O(d.$$.fragment,l),v=!0)},o(l){j(n.$$.fragment,l),j(p.$$.fragment,l),j(d.$$.fragment,l),v=!1},d(l){l&&(h(t),h(c),h(g),h(B),h(w),h(F),h($)),D(n),D(p),D(d),s[15](null),y=!1,x(L)}}}function ae(s){let t,o;return t=new Q({props:{$$slots:{default:[ie]},$$scope:{ctx:s}}}),{c(){S(t.$$.fragment)},m(u,n){E(t,u,n),o=!0},p(u,[n]){const e={};n&2097407&&(e.$$scope={dirty:n,ctx:u}),t.$set(e)},i(u){o||(O(t.$$.fragment,u),o=!0)},o(u){j(t.$$.fragment,u),o=!1},d(u){D(t,u)}}}function oe(s,t,o){let u,{params:n}=t,e="",p="",_="",d=!1,a=!1,i,c;g();async function g(){if(!(n!=null&&n.token))return M("/");o(0,d=!0);try{const f=V(n==null?void 0:n.token);await C.collection("_superusers").getOne(f.id,{requestKey:"installer_token_check",headers:{Authorization:n==null?void 0:n.token}})}catch(f){f!=null&&f.isAbort||(X("The installer token is invalid or has expired."),M("/"))}o(0,d=!1),await Y(),i==null||i.focus()}async function B(){if(!u){o(0,d=!0);try{await C.collection("_superusers").create({email:e,password:p,passwordConfirm:_},{headers:{Authorization:n==null?void 0:n.token}}),await C.collection("_superusers").authWithPassword(e,p),M("/")}catch(f){C.error(f)}o(0,d=!1)}}function w(){c&&o(6,c.value="",c)}function F(f){f&&ee(`Note that we don't perform validations for the uploaded backup files. Proceed with caution and only if you trust the file source. Do you really want to upload and initialize "${f.name}"?`,()=>{$(f)},()=>{w()})}async function $(f){if(!(!f||u)){o(1,a=!0);try{await C.backups.upload({file:f},{headers:{Authorization:n==null?void 0:n.token}}),await C.backups.restore(f.name,{headers:{Authorization:n==null?void 0:n.token}}),te("Please wait while extracting the uploaded archive!"),await new Promise(P=>setTimeout(P,2e3)),M("/")}catch(P){C.error(P)}w(),o(1,a=!1)}}function v(f){U[f?"unshift":"push"](()=>{i=f,o(5,i)})}function y(){e=this.value,o(2,e)}function L(){p=this.value,o(3,p)}function l(){_=this.value,o(4,_)}function b(f){U[f?"unshift":"push"](()=>{c=f,o(6,c)})}const H=f=>{var P,R;F((R=(P=f.target)==null?void 0:P.files)==null?void 0:R[0])};return s.$$set=f=>{"params"in f&&o(10,n=f.params)},s.$$.update=()=>{s.$$.dirty&3&&o(7,u=d||a)},[d,a,e,p,_,i,c,u,B,F,n,v,y,L,l,b,H]}class re extends W{constructor(t){super(),G(this,t,oe,ae,J,{params:10})}}export{re as default}; diff --git a/ui/dist/assets/PageOAuth2RedirectFailure-toDQLSNo.js b/ui/dist/assets/PageOAuth2RedirectFailure-CXP-KtJg.js similarity index 88% rename from ui/dist/assets/PageOAuth2RedirectFailure-toDQLSNo.js rename to ui/dist/assets/PageOAuth2RedirectFailure-CXP-KtJg.js index 4550b3f5..a1833339 100644 --- a/ui/dist/assets/PageOAuth2RedirectFailure-toDQLSNo.js +++ b/ui/dist/assets/PageOAuth2RedirectFailure-CXP-KtJg.js @@ -1 +1 @@ -import{S as r,i as c,s as l,h as u,k as h,n as p,I as n,v as d,O as f,P as m,Q as g,R as o}from"./index-rWxFAXsK.js";function _(s){let t;return{c(){t=u("div"),t.innerHTML='

Auth failed.

You can close this window and go back to the app to try again.
',h(t,"class","content txt-hint txt-center p-base")},m(e,a){p(e,t,a)},p:n,i:n,o:n,d(e){e&&d(t)}}}function b(s,t,e){let a;return f(s,o,i=>e(0,a=i)),m(o,a="OAuth2 auth failed",a),g(()=>{window.close()}),[]}class x extends r{constructor(t){super(),c(this,t,b,_,l,{})}}export{x as default}; +import{S as r,i as c,s as l,h as u,k as h,n as p,I as n,v as d,O as f,P as m,Q as g,R as o}from"./index-C58oTbH7.js";function _(s){let t;return{c(){t=u("div"),t.innerHTML='

Auth failed.

You can close this window and go back to the app to try again.
',h(t,"class","content txt-hint txt-center p-base")},m(e,a){p(e,t,a)},p:n,i:n,o:n,d(e){e&&d(t)}}}function b(s,t,e){let a;return f(s,o,i=>e(0,a=i)),m(o,a="OAuth2 auth failed",a),g(()=>{window.close()}),[]}class x extends r{constructor(t){super(),c(this,t,b,_,l,{})}}export{x as default}; diff --git a/ui/dist/assets/PageOAuth2RedirectSuccess-CwN4_gyA.js b/ui/dist/assets/PageOAuth2RedirectSuccess-8NzihWC_.js similarity index 88% rename from ui/dist/assets/PageOAuth2RedirectSuccess-CwN4_gyA.js rename to ui/dist/assets/PageOAuth2RedirectSuccess-8NzihWC_.js index 1908f2b1..f232e41f 100644 --- a/ui/dist/assets/PageOAuth2RedirectSuccess-CwN4_gyA.js +++ b/ui/dist/assets/PageOAuth2RedirectSuccess-8NzihWC_.js @@ -1 +1 @@ -import{S as i,i as r,s as u,h as l,k as p,n as h,I as n,v as d,O as m,P as f,Q as _,R as o}from"./index-rWxFAXsK.js";function b(a){let t;return{c(){t=l("div"),t.innerHTML='

Auth completed.

You can close this window and go back to the app.
',p(t,"class","content txt-hint txt-center p-base")},m(e,s){h(e,t,s)},p:n,i:n,o:n,d(e){e&&d(t)}}}function g(a,t,e){let s;return m(a,o,c=>e(0,s=c)),f(o,s="OAuth2 auth completed",s),_(()=>{window.close()}),[]}class x extends i{constructor(t){super(),r(this,t,g,b,u,{})}}export{x as default}; +import{S as i,i as r,s as u,h as l,k as p,n as h,I as n,v as d,O as m,P as f,Q as _,R as o}from"./index-C58oTbH7.js";function b(a){let t;return{c(){t=l("div"),t.innerHTML='

Auth completed.

You can close this window and go back to the app.
',p(t,"class","content txt-hint txt-center p-base")},m(e,s){h(e,t,s)},p:n,i:n,o:n,d(e){e&&d(t)}}}function g(a,t,e){let s;return m(a,o,c=>e(0,s=c)),f(o,s="OAuth2 auth completed",s),_(()=>{window.close()}),[]}class x extends i{constructor(t){super(),r(this,t,g,b,u,{})}}export{x as default}; diff --git a/ui/dist/assets/PageRecordConfirmEmailChange-DRKGFrr7.js b/ui/dist/assets/PageRecordConfirmEmailChange-DfPs5Q3f.js similarity index 98% rename from ui/dist/assets/PageRecordConfirmEmailChange-DRKGFrr7.js rename to ui/dist/assets/PageRecordConfirmEmailChange-DfPs5Q3f.js index 19c774e4..71816dc7 100644 --- a/ui/dist/assets/PageRecordConfirmEmailChange-DRKGFrr7.js +++ b/ui/dist/assets/PageRecordConfirmEmailChange-DfPs5Q3f.js @@ -1,2 +1,2 @@ -import{S as J,i as M,s as j,F as z,c as L,m as S,t as h,a as v,d as I,J as A,L as G,n as _,E as N,G as R,v as b,M as W,g as Y,p as B,f as D,h as m,z as y,j as C,k as p,l as T,o as g,q as P,u as K,I as E,H as O,A as F}from"./index-rWxFAXsK.js";function Q(i){let e,t,n,l,s,o,f,a,r,u,k,$,d=i[3]&&H(i);return o=new D({props:{class:"form-field required",name:"password",$$slots:{default:[V,({uniqueId:c})=>({8:c}),({uniqueId:c})=>c?256:0]},$$scope:{ctx:i}}}),{c(){e=m("form"),t=m("div"),n=m("h5"),l=y(`Type your password to confirm changing your email address +import{S as J,i as M,s as j,F as z,c as L,m as S,t as h,a as v,d as I,J as A,L as G,n as _,E as N,G as R,v as b,M as W,g as Y,p as B,f as D,h as m,z as y,j as C,k as p,l as T,o as g,q as P,u as K,I as E,H as O,A as F}from"./index-C58oTbH7.js";function Q(i){let e,t,n,l,s,o,f,a,r,u,k,$,d=i[3]&&H(i);return o=new D({props:{class:"form-field required",name:"password",$$slots:{default:[V,({uniqueId:c})=>({8:c}),({uniqueId:c})=>c?256:0]},$$scope:{ctx:i}}}),{c(){e=m("form"),t=m("div"),n=m("h5"),l=y(`Type your password to confirm changing your email address `),d&&d.c(),s=C(),L(o.$$.fragment),f=C(),a=m("button"),r=m("span"),r.textContent="Confirm new email",p(t,"class","content txt-center m-b-base"),p(r,"class","txt"),p(a,"type","submit"),p(a,"class","btn btn-lg btn-block"),a.disabled=i[1],T(a,"btn-loading",i[1])},m(c,w){_(c,e,w),g(e,t),g(t,n),g(n,l),d&&d.m(n,null),g(e,s),S(o,e,null),g(e,f),g(e,a),g(a,r),u=!0,k||($=P(e,"submit",K(i[4])),k=!0)},p(c,w){c[3]?d?d.p(c,w):(d=H(c),d.c(),d.m(n,null)):d&&(d.d(1),d=null);const q={};w&769&&(q.$$scope={dirty:w,ctx:c}),o.$set(q),(!u||w&2)&&(a.disabled=c[1]),(!u||w&2)&&T(a,"btn-loading",c[1])},i(c){u||(h(o.$$.fragment,c),u=!0)},o(c){v(o.$$.fragment,c),u=!1},d(c){c&&b(e),d&&d.d(),I(o),k=!1,$()}}}function U(i){let e,t,n,l,s;return{c(){e=m("div"),e.innerHTML='

Successfully changed the user email address.

You can now sign in with your new email address.

',t=C(),n=m("button"),n.textContent="Close",p(e,"class","alert alert-success"),p(n,"type","button"),p(n,"class","btn btn-transparent btn-block")},m(o,f){_(o,e,f),_(o,t,f),_(o,n,f),l||(s=P(n,"click",i[6]),l=!0)},p:E,i:E,o:E,d(o){o&&(b(e),b(t),b(n)),l=!1,s()}}}function H(i){let e,t,n;return{c(){e=y("to "),t=m("strong"),n=y(i[3]),p(t,"class","txt-nowrap")},m(l,s){_(l,e,s),_(l,t,s),g(t,n)},p(l,s){s&8&&O(n,l[3])},d(l){l&&(b(e),b(t))}}}function V(i){let e,t,n,l,s,o,f,a;return{c(){e=m("label"),t=y("Password"),l=C(),s=m("input"),p(e,"for",n=i[8]),p(s,"type","password"),p(s,"id",o=i[8]),s.required=!0,s.autofocus=!0},m(r,u){_(r,e,u),g(e,t),_(r,l,u),_(r,s,u),F(s,i[0]),s.focus(),f||(a=P(s,"input",i[7]),f=!0)},p(r,u){u&256&&n!==(n=r[8])&&p(e,"for",n),u&256&&o!==(o=r[8])&&p(s,"id",o),u&1&&s.value!==r[0]&&F(s,r[0])},d(r){r&&(b(e),b(l),b(s)),f=!1,a()}}}function X(i){let e,t,n,l;const s=[U,Q],o=[];function f(a,r){return a[2]?0:1}return e=f(i),t=o[e]=s[e](i),{c(){t.c(),n=G()},m(a,r){o[e].m(a,r),_(a,n,r),l=!0},p(a,r){let u=e;e=f(a),e===u?o[e].p(a,r):(N(),v(o[u],1,1,()=>{o[u]=null}),R(),t=o[e],t?t.p(a,r):(t=o[e]=s[e](a),t.c()),h(t,1),t.m(n.parentNode,n))},i(a){l||(h(t),l=!0)},o(a){v(t),l=!1},d(a){a&&b(n),o[e].d(a)}}}function Z(i){let e,t;return e=new z({props:{nobranding:!0,$$slots:{default:[X]},$$scope:{ctx:i}}}),{c(){L(e.$$.fragment)},m(n,l){S(e,n,l),t=!0},p(n,[l]){const s={};l&527&&(s.$$scope={dirty:l,ctx:n}),e.$set(s)},i(n){t||(h(e.$$.fragment,n),t=!0)},o(n){v(e.$$.fragment,n),t=!1},d(n){I(e,n)}}}function x(i,e,t){let n,{params:l}=e,s="",o=!1,f=!1;async function a(){if(o)return;t(1,o=!0);const k=new W("../");try{const $=Y(l==null?void 0:l.token);await k.collection($.collectionId).confirmEmailChange(l==null?void 0:l.token,s),t(2,f=!0)}catch($){B.error($)}t(1,o=!1)}const r=()=>window.close();function u(){s=this.value,t(0,s)}return i.$$set=k=>{"params"in k&&t(5,l=k.params)},i.$$.update=()=>{i.$$.dirty&32&&t(3,n=A.getJWTPayload(l==null?void 0:l.token).newEmail||"")},[s,o,f,n,a,l,r,u]}class te extends J{constructor(e){super(),M(this,e,x,Z,j,{params:5})}}export{te as default}; diff --git a/ui/dist/assets/PageRecordConfirmPasswordReset-CIhbgoQZ.js b/ui/dist/assets/PageRecordConfirmPasswordReset-vozypaOJ.js similarity index 98% rename from ui/dist/assets/PageRecordConfirmPasswordReset-CIhbgoQZ.js rename to ui/dist/assets/PageRecordConfirmPasswordReset-vozypaOJ.js index 74ee3011..1d073a31 100644 --- a/ui/dist/assets/PageRecordConfirmPasswordReset-CIhbgoQZ.js +++ b/ui/dist/assets/PageRecordConfirmPasswordReset-vozypaOJ.js @@ -1,2 +1,2 @@ -import{S as z,i as A,s as E,F as G,c as H,m as L,t as P,a as q,d as N,J as W,L as Y,n as _,E as B,G as D,v as m,M as K,g as O,p as Q,f as J,h as b,z as y,j as C,k as p,l as M,o as w,q as S,u as U,I as F,H as V,A as R}from"./index-rWxFAXsK.js";function X(a){let e,l,s,n,t,o,c,r,i,u,v,g,k,h,d=a[4]&&j(a);return o=new J({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:a}}}),r=new J({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:a}}}),{c(){e=b("form"),l=b("div"),s=b("h5"),n=y(`Reset your user password +import{S as z,i as A,s as E,F as G,c as H,m as L,t as P,a as q,d as N,J as W,L as Y,n as _,E as B,G as D,v as m,M as K,g as O,p as Q,f as J,h as b,z as y,j as C,k as p,l as M,o as w,q as S,u as U,I as F,H as V,A as R}from"./index-C58oTbH7.js";function X(a){let e,l,s,n,t,o,c,r,i,u,v,g,k,h,d=a[4]&&j(a);return o=new J({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:a}}}),r=new J({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:a}}}),{c(){e=b("form"),l=b("div"),s=b("h5"),n=y(`Reset your user password `),d&&d.c(),t=C(),H(o.$$.fragment),c=C(),H(r.$$.fragment),i=C(),u=b("button"),v=b("span"),v.textContent="Set new password",p(l,"class","content txt-center m-b-base"),p(v,"class","txt"),p(u,"type","submit"),p(u,"class","btn btn-lg btn-block"),u.disabled=a[2],M(u,"btn-loading",a[2])},m(f,$){_(f,e,$),w(e,l),w(l,s),w(s,n),d&&d.m(s,null),w(e,t),L(o,e,null),w(e,c),L(r,e,null),w(e,i),w(e,u),w(u,v),g=!0,k||(h=S(e,"submit",U(a[5])),k=!0)},p(f,$){f[4]?d?d.p(f,$):(d=j(f),d.c(),d.m(s,null)):d&&(d.d(1),d=null);const T={};$&3073&&(T.$$scope={dirty:$,ctx:f}),o.$set(T);const I={};$&3074&&(I.$$scope={dirty:$,ctx:f}),r.$set(I),(!g||$&4)&&(u.disabled=f[2]),(!g||$&4)&&M(u,"btn-loading",f[2])},i(f){g||(P(o.$$.fragment,f),P(r.$$.fragment,f),g=!0)},o(f){q(o.$$.fragment,f),q(r.$$.fragment,f),g=!1},d(f){f&&m(e),d&&d.d(),N(o),N(r),k=!1,h()}}}function Z(a){let e,l,s,n,t;return{c(){e=b("div"),e.innerHTML='

Successfully changed the user password.

You can now sign in with your new password.

',l=C(),s=b("button"),s.textContent="Close",p(e,"class","alert alert-success"),p(s,"type","button"),p(s,"class","btn btn-transparent btn-block")},m(o,c){_(o,e,c),_(o,l,c),_(o,s,c),n||(t=S(s,"click",a[7]),n=!0)},p:F,i:F,o:F,d(o){o&&(m(e),m(l),m(s)),n=!1,t()}}}function j(a){let e,l,s;return{c(){e=y("for "),l=b("strong"),s=y(a[4])},m(n,t){_(n,e,t),_(n,l,t),w(l,s)},p(n,t){t&16&&V(s,n[4])},d(n){n&&(m(e),m(l))}}}function x(a){let e,l,s,n,t,o,c,r;return{c(){e=b("label"),l=y("New password"),n=C(),t=b("input"),p(e,"for",s=a[10]),p(t,"type","password"),p(t,"id",o=a[10]),t.required=!0,t.autofocus=!0},m(i,u){_(i,e,u),w(e,l),_(i,n,u),_(i,t,u),R(t,a[0]),t.focus(),c||(r=S(t,"input",a[8]),c=!0)},p(i,u){u&1024&&s!==(s=i[10])&&p(e,"for",s),u&1024&&o!==(o=i[10])&&p(t,"id",o),u&1&&t.value!==i[0]&&R(t,i[0])},d(i){i&&(m(e),m(n),m(t)),c=!1,r()}}}function ee(a){let e,l,s,n,t,o,c,r;return{c(){e=b("label"),l=y("New password confirm"),n=C(),t=b("input"),p(e,"for",s=a[10]),p(t,"type","password"),p(t,"id",o=a[10]),t.required=!0},m(i,u){_(i,e,u),w(e,l),_(i,n,u),_(i,t,u),R(t,a[1]),c||(r=S(t,"input",a[9]),c=!0)},p(i,u){u&1024&&s!==(s=i[10])&&p(e,"for",s),u&1024&&o!==(o=i[10])&&p(t,"id",o),u&2&&t.value!==i[1]&&R(t,i[1])},d(i){i&&(m(e),m(n),m(t)),c=!1,r()}}}function te(a){let e,l,s,n;const t=[Z,X],o=[];function c(r,i){return r[3]?0:1}return e=c(a),l=o[e]=t[e](a),{c(){l.c(),s=Y()},m(r,i){o[e].m(r,i),_(r,s,i),n=!0},p(r,i){let u=e;e=c(r),e===u?o[e].p(r,i):(B(),q(o[u],1,1,()=>{o[u]=null}),D(),l=o[e],l?l.p(r,i):(l=o[e]=t[e](r),l.c()),P(l,1),l.m(s.parentNode,s))},i(r){n||(P(l),n=!0)},o(r){q(l),n=!1},d(r){r&&m(s),o[e].d(r)}}}function se(a){let e,l;return e=new G({props:{nobranding:!0,$$slots:{default:[te]},$$scope:{ctx:a}}}),{c(){H(e.$$.fragment)},m(s,n){L(e,s,n),l=!0},p(s,[n]){const t={};n&2079&&(t.$$scope={dirty:n,ctx:s}),e.$set(t)},i(s){l||(P(e.$$.fragment,s),l=!0)},o(s){q(e.$$.fragment,s),l=!1},d(s){N(e,s)}}}function le(a,e,l){let s,{params:n}=e,t="",o="",c=!1,r=!1;async function i(){if(c)return;l(2,c=!0);const k=new K("../");try{const h=O(n==null?void 0:n.token);await k.collection(h.collectionId).confirmPasswordReset(n==null?void 0:n.token,t,o),l(3,r=!0)}catch(h){Q.error(h)}l(2,c=!1)}const u=()=>window.close();function v(){t=this.value,l(0,t)}function g(){o=this.value,l(1,o)}return a.$$set=k=>{"params"in k&&l(6,n=k.params)},a.$$.update=()=>{a.$$.dirty&64&&l(4,s=W.getJWTPayload(n==null?void 0:n.token).email||"")},[t,o,c,r,s,i,n,u,v,g]}class oe extends z{constructor(e){super(),A(this,e,le,se,E,{params:6})}}export{oe as default}; diff --git a/ui/dist/assets/PageRecordConfirmVerification-DQmD9Mr0.js b/ui/dist/assets/PageRecordConfirmVerification-BZMgKOu2.js similarity index 98% rename from ui/dist/assets/PageRecordConfirmVerification-DQmD9Mr0.js rename to ui/dist/assets/PageRecordConfirmVerification-BZMgKOu2.js index 13a22b09..aba2ae18 100644 --- a/ui/dist/assets/PageRecordConfirmVerification-DQmD9Mr0.js +++ b/ui/dist/assets/PageRecordConfirmVerification-BZMgKOu2.js @@ -1 +1 @@ -import{S as M,i as P,s as R,F as H,c as q,m as N,t as S,a as V,d as F,M as w,g as y,N as j,L as g,n as r,v as a,p as E,h as u,j as v,k as d,q as k,I as m,l as C,o as z}from"./index-rWxFAXsK.js";function A(o){let e,l,n;function t(i,f){return i[4]?K:J}let s=t(o),c=s(o);return{c(){e=u("div"),e.innerHTML='

Invalid or expired verification token.

',l=v(),c.c(),n=g(),d(e,"class","alert alert-danger")},m(i,f){r(i,e,f),r(i,l,f),c.m(i,f),r(i,n,f)},p(i,f){s===(s=t(i))&&c?c.p(i,f):(c.d(1),c=s(i),c&&(c.c(),c.m(n.parentNode,n)))},d(i){i&&(a(e),a(l),a(n)),c.d(i)}}}function B(o){let e,l,n,t,s;return{c(){e=u("div"),e.innerHTML='

Please check your email for the new verification link.

',l=v(),n=u("button"),n.textContent="Close",d(e,"class","alert alert-success"),d(n,"type","button"),d(n,"class","btn btn-transparent btn-block")},m(c,i){r(c,e,i),r(c,l,i),r(c,n,i),t||(s=k(n,"click",o[8]),t=!0)},p:m,d(c){c&&(a(e),a(l),a(n)),t=!1,s()}}}function D(o){let e,l,n,t,s;return{c(){e=u("div"),e.innerHTML='

Successfully verified email address.

',l=v(),n=u("button"),n.textContent="Close",d(e,"class","alert alert-success"),d(n,"type","button"),d(n,"class","btn btn-transparent btn-block")},m(c,i){r(c,e,i),r(c,l,i),r(c,n,i),t||(s=k(n,"click",o[7]),t=!0)},p:m,d(c){c&&(a(e),a(l),a(n)),t=!1,s()}}}function G(o){let e;return{c(){e=u("div"),e.innerHTML='
Please wait...
',d(e,"class","txt-center")},m(l,n){r(l,e,n)},p:m,d(l){l&&a(e)}}}function J(o){let e,l,n;return{c(){e=u("button"),e.textContent="Close",d(e,"type","button"),d(e,"class","btn btn-transparent btn-block")},m(t,s){r(t,e,s),l||(n=k(e,"click",o[9]),l=!0)},p:m,d(t){t&&a(e),l=!1,n()}}}function K(o){let e,l,n,t;return{c(){e=u("button"),l=u("span"),l.textContent="Resend",d(l,"class","txt"),d(e,"type","button"),d(e,"class","btn btn-transparent btn-block"),e.disabled=o[3],C(e,"btn-loading",o[3])},m(s,c){r(s,e,c),z(e,l),n||(t=k(e,"click",o[5]),n=!0)},p(s,c){c&8&&(e.disabled=s[3]),c&8&&C(e,"btn-loading",s[3])},d(s){s&&a(e),n=!1,t()}}}function O(o){let e;function l(s,c){return s[1]?G:s[0]?D:s[2]?B:A}let n=l(o),t=n(o);return{c(){t.c(),e=g()},m(s,c){t.m(s,c),r(s,e,c)},p(s,c){n===(n=l(s))&&t?t.p(s,c):(t.d(1),t=n(s),t&&(t.c(),t.m(e.parentNode,e)))},d(s){s&&a(e),t.d(s)}}}function Q(o){let e,l;return e=new H({props:{nobranding:!0,$$slots:{default:[O]},$$scope:{ctx:o}}}),{c(){q(e.$$.fragment)},m(n,t){N(e,n,t),l=!0},p(n,[t]){const s={};t&2079&&(s.$$scope={dirty:t,ctx:n}),e.$set(s)},i(n){l||(S(e.$$.fragment,n),l=!0)},o(n){V(e.$$.fragment,n),l=!1},d(n){F(e,n)}}}function U(o,e,l){let n,{params:t}=e,s=!1,c=!1,i=!1,f=!1;x();async function x(){if(c)return;l(1,c=!0);const p=new w("../");try{const b=y(t==null?void 0:t.token);await p.collection(b.collectionId).confirmVerification(t==null?void 0:t.token),l(0,s=!0)}catch{l(0,s=!1)}l(1,c=!1)}async function T(){const p=y(t==null?void 0:t.token);if(f||!p.collectionId||!p.email)return;l(3,f=!0);const b=new w("../");try{const _=y(t==null?void 0:t.token);await b.collection(_.collectionId).requestVerification(_.email),l(2,i=!0)}catch(_){E.error(_),l(2,i=!1)}l(3,f=!1)}const h=()=>window.close(),I=()=>window.close(),L=()=>window.close();return o.$$set=p=>{"params"in p&&l(6,t=p.params)},o.$$.update=()=>{o.$$.dirty&64&&l(4,n=(t==null?void 0:t.token)&&j(t.token))},[s,c,i,f,n,T,t,h,I,L]}class X extends M{constructor(e){super(),P(this,e,U,Q,R,{params:6})}}export{X as default}; +import{S as M,i as P,s as R,F as H,c as q,m as N,t as S,a as V,d as F,M as w,g as y,N as j,L as g,n as r,v as a,p as E,h as u,j as v,k as d,q as k,I as m,l as C,o as z}from"./index-C58oTbH7.js";function A(o){let e,l,n;function t(i,f){return i[4]?K:J}let s=t(o),c=s(o);return{c(){e=u("div"),e.innerHTML='

Invalid or expired verification token.

',l=v(),c.c(),n=g(),d(e,"class","alert alert-danger")},m(i,f){r(i,e,f),r(i,l,f),c.m(i,f),r(i,n,f)},p(i,f){s===(s=t(i))&&c?c.p(i,f):(c.d(1),c=s(i),c&&(c.c(),c.m(n.parentNode,n)))},d(i){i&&(a(e),a(l),a(n)),c.d(i)}}}function B(o){let e,l,n,t,s;return{c(){e=u("div"),e.innerHTML='

Please check your email for the new verification link.

',l=v(),n=u("button"),n.textContent="Close",d(e,"class","alert alert-success"),d(n,"type","button"),d(n,"class","btn btn-transparent btn-block")},m(c,i){r(c,e,i),r(c,l,i),r(c,n,i),t||(s=k(n,"click",o[8]),t=!0)},p:m,d(c){c&&(a(e),a(l),a(n)),t=!1,s()}}}function D(o){let e,l,n,t,s;return{c(){e=u("div"),e.innerHTML='

Successfully verified email address.

',l=v(),n=u("button"),n.textContent="Close",d(e,"class","alert alert-success"),d(n,"type","button"),d(n,"class","btn btn-transparent btn-block")},m(c,i){r(c,e,i),r(c,l,i),r(c,n,i),t||(s=k(n,"click",o[7]),t=!0)},p:m,d(c){c&&(a(e),a(l),a(n)),t=!1,s()}}}function G(o){let e;return{c(){e=u("div"),e.innerHTML='
Please wait...
',d(e,"class","txt-center")},m(l,n){r(l,e,n)},p:m,d(l){l&&a(e)}}}function J(o){let e,l,n;return{c(){e=u("button"),e.textContent="Close",d(e,"type","button"),d(e,"class","btn btn-transparent btn-block")},m(t,s){r(t,e,s),l||(n=k(e,"click",o[9]),l=!0)},p:m,d(t){t&&a(e),l=!1,n()}}}function K(o){let e,l,n,t;return{c(){e=u("button"),l=u("span"),l.textContent="Resend",d(l,"class","txt"),d(e,"type","button"),d(e,"class","btn btn-transparent btn-block"),e.disabled=o[3],C(e,"btn-loading",o[3])},m(s,c){r(s,e,c),z(e,l),n||(t=k(e,"click",o[5]),n=!0)},p(s,c){c&8&&(e.disabled=s[3]),c&8&&C(e,"btn-loading",s[3])},d(s){s&&a(e),n=!1,t()}}}function O(o){let e;function l(s,c){return s[1]?G:s[0]?D:s[2]?B:A}let n=l(o),t=n(o);return{c(){t.c(),e=g()},m(s,c){t.m(s,c),r(s,e,c)},p(s,c){n===(n=l(s))&&t?t.p(s,c):(t.d(1),t=n(s),t&&(t.c(),t.m(e.parentNode,e)))},d(s){s&&a(e),t.d(s)}}}function Q(o){let e,l;return e=new H({props:{nobranding:!0,$$slots:{default:[O]},$$scope:{ctx:o}}}),{c(){q(e.$$.fragment)},m(n,t){N(e,n,t),l=!0},p(n,[t]){const s={};t&2079&&(s.$$scope={dirty:t,ctx:n}),e.$set(s)},i(n){l||(S(e.$$.fragment,n),l=!0)},o(n){V(e.$$.fragment,n),l=!1},d(n){F(e,n)}}}function U(o,e,l){let n,{params:t}=e,s=!1,c=!1,i=!1,f=!1;x();async function x(){if(c)return;l(1,c=!0);const p=new w("../");try{const b=y(t==null?void 0:t.token);await p.collection(b.collectionId).confirmVerification(t==null?void 0:t.token),l(0,s=!0)}catch{l(0,s=!1)}l(1,c=!1)}async function T(){const p=y(t==null?void 0:t.token);if(f||!p.collectionId||!p.email)return;l(3,f=!0);const b=new w("../");try{const _=y(t==null?void 0:t.token);await b.collection(_.collectionId).requestVerification(_.email),l(2,i=!0)}catch(_){E.error(_),l(2,i=!1)}l(3,f=!1)}const h=()=>window.close(),I=()=>window.close(),L=()=>window.close();return o.$$set=p=>{"params"in p&&l(6,t=p.params)},o.$$.update=()=>{o.$$.dirty&64&&l(4,n=(t==null?void 0:t.token)&&j(t.token))},[s,c,i,f,n,T,t,h,I,L]}class X extends M{constructor(e){super(),P(this,e,U,Q,R,{params:6})}}export{X as default}; diff --git a/ui/dist/assets/PageSuperuserConfirmPasswordReset-BB-PhJrO.js b/ui/dist/assets/PageSuperuserConfirmPasswordReset-BAZ7jH5f.js similarity index 98% rename from ui/dist/assets/PageSuperuserConfirmPasswordReset-BB-PhJrO.js rename to ui/dist/assets/PageSuperuserConfirmPasswordReset-BAZ7jH5f.js index 6f1aeac1..7c6ecff3 100644 --- a/ui/dist/assets/PageSuperuserConfirmPasswordReset-BB-PhJrO.js +++ b/ui/dist/assets/PageSuperuserConfirmPasswordReset-BAZ7jH5f.js @@ -1,2 +1,2 @@ -import{S as y,i as E,s as G,F as I,c as R,m as H,t as J,a as N,d as T,J as M,f as D,h as _,z as P,j as h,k as f,l as K,n as b,o as c,q as j,u as O,C as Q,D as U,v as w,w as V,p as L,K as X,r as Y,H as Z,A as q}from"./index-rWxFAXsK.js";function W(r){let e,n,s;return{c(){e=P("for "),n=_("strong"),s=P(r[3]),f(n,"class","txt-nowrap")},m(l,t){b(l,e,t),b(l,n,t),c(n,s)},p(l,t){t&8&&Z(s,l[3])},d(l){l&&(w(e),w(n))}}}function x(r){let e,n,s,l,t,i,p,d;return{c(){e=_("label"),n=P("New password"),l=h(),t=_("input"),f(e,"for",s=r[8]),f(t,"type","password"),f(t,"id",i=r[8]),t.required=!0,t.autofocus=!0},m(u,a){b(u,e,a),c(e,n),b(u,l,a),b(u,t,a),q(t,r[0]),t.focus(),p||(d=j(t,"input",r[6]),p=!0)},p(u,a){a&256&&s!==(s=u[8])&&f(e,"for",s),a&256&&i!==(i=u[8])&&f(t,"id",i),a&1&&t.value!==u[0]&&q(t,u[0])},d(u){u&&(w(e),w(l),w(t)),p=!1,d()}}}function ee(r){let e,n,s,l,t,i,p,d;return{c(){e=_("label"),n=P("New password confirm"),l=h(),t=_("input"),f(e,"for",s=r[8]),f(t,"type","password"),f(t,"id",i=r[8]),t.required=!0},m(u,a){b(u,e,a),c(e,n),b(u,l,a),b(u,t,a),q(t,r[1]),p||(d=j(t,"input",r[7]),p=!0)},p(u,a){a&256&&s!==(s=u[8])&&f(e,"for",s),a&256&&i!==(i=u[8])&&f(t,"id",i),a&2&&t.value!==u[1]&&q(t,u[1])},d(u){u&&(w(e),w(l),w(t)),p=!1,d()}}}function te(r){let e,n,s,l,t,i,p,d,u,a,g,S,C,v,k,F,z,m=r[3]&&W(r);return i=new D({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:o})=>({8:o}),({uniqueId:o})=>o?256:0]},$$scope:{ctx:r}}}),d=new D({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:o})=>({8:o}),({uniqueId:o})=>o?256:0]},$$scope:{ctx:r}}}),{c(){e=_("form"),n=_("div"),s=_("h4"),l=P(`Reset your superuser password +import{S as y,i as E,s as G,F as I,c as R,m as H,t as J,a as N,d as T,J as M,f as D,h as _,z as P,j as h,k as f,l as K,n as b,o as c,q as j,u as O,C as Q,D as U,v as w,w as V,p as L,K as X,r as Y,H as Z,A as q}from"./index-C58oTbH7.js";function W(r){let e,n,s;return{c(){e=P("for "),n=_("strong"),s=P(r[3]),f(n,"class","txt-nowrap")},m(l,t){b(l,e,t),b(l,n,t),c(n,s)},p(l,t){t&8&&Z(s,l[3])},d(l){l&&(w(e),w(n))}}}function x(r){let e,n,s,l,t,i,p,d;return{c(){e=_("label"),n=P("New password"),l=h(),t=_("input"),f(e,"for",s=r[8]),f(t,"type","password"),f(t,"id",i=r[8]),t.required=!0,t.autofocus=!0},m(u,a){b(u,e,a),c(e,n),b(u,l,a),b(u,t,a),q(t,r[0]),t.focus(),p||(d=j(t,"input",r[6]),p=!0)},p(u,a){a&256&&s!==(s=u[8])&&f(e,"for",s),a&256&&i!==(i=u[8])&&f(t,"id",i),a&1&&t.value!==u[0]&&q(t,u[0])},d(u){u&&(w(e),w(l),w(t)),p=!1,d()}}}function ee(r){let e,n,s,l,t,i,p,d;return{c(){e=_("label"),n=P("New password confirm"),l=h(),t=_("input"),f(e,"for",s=r[8]),f(t,"type","password"),f(t,"id",i=r[8]),t.required=!0},m(u,a){b(u,e,a),c(e,n),b(u,l,a),b(u,t,a),q(t,r[1]),p||(d=j(t,"input",r[7]),p=!0)},p(u,a){a&256&&s!==(s=u[8])&&f(e,"for",s),a&256&&i!==(i=u[8])&&f(t,"id",i),a&2&&t.value!==u[1]&&q(t,u[1])},d(u){u&&(w(e),w(l),w(t)),p=!1,d()}}}function te(r){let e,n,s,l,t,i,p,d,u,a,g,S,C,v,k,F,z,m=r[3]&&W(r);return i=new D({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:o})=>({8:o}),({uniqueId:o})=>o?256:0]},$$scope:{ctx:r}}}),d=new D({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:o})=>({8:o}),({uniqueId:o})=>o?256:0]},$$scope:{ctx:r}}}),{c(){e=_("form"),n=_("div"),s=_("h4"),l=P(`Reset your superuser password `),m&&m.c(),t=h(),R(i.$$.fragment),p=h(),R(d.$$.fragment),u=h(),a=_("button"),g=_("span"),g.textContent="Set new password",S=h(),C=_("div"),v=_("a"),v.textContent="Back to login",f(s,"class","m-b-xs"),f(n,"class","content txt-center m-b-sm"),f(g,"class","txt"),f(a,"type","submit"),f(a,"class","btn btn-lg btn-block"),a.disabled=r[2],K(a,"btn-loading",r[2]),f(e,"class","m-b-base"),f(v,"href","/login"),f(v,"class","link-hint"),f(C,"class","content txt-center")},m(o,$){b(o,e,$),c(e,n),c(n,s),c(s,l),m&&m.m(s,null),c(e,t),H(i,e,null),c(e,p),H(d,e,null),c(e,u),c(e,a),c(a,g),b(o,S,$),b(o,C,$),c(C,v),k=!0,F||(z=[j(e,"submit",O(r[4])),Q(U.call(null,v))],F=!0)},p(o,$){o[3]?m?m.p(o,$):(m=W(o),m.c(),m.m(s,null)):m&&(m.d(1),m=null);const A={};$&769&&(A.$$scope={dirty:$,ctx:o}),i.$set(A);const B={};$&770&&(B.$$scope={dirty:$,ctx:o}),d.$set(B),(!k||$&4)&&(a.disabled=o[2]),(!k||$&4)&&K(a,"btn-loading",o[2])},i(o){k||(J(i.$$.fragment,o),J(d.$$.fragment,o),k=!0)},o(o){N(i.$$.fragment,o),N(d.$$.fragment,o),k=!1},d(o){o&&(w(e),w(S),w(C)),m&&m.d(),T(i),T(d),F=!1,V(z)}}}function se(r){let e,n;return e=new I({props:{$$slots:{default:[te]},$$scope:{ctx:r}}}),{c(){R(e.$$.fragment)},m(s,l){H(e,s,l),n=!0},p(s,[l]){const t={};l&527&&(t.$$scope={dirty:l,ctx:s}),e.$set(t)},i(s){n||(J(e.$$.fragment,s),n=!0)},o(s){N(e.$$.fragment,s),n=!1},d(s){T(e,s)}}}function le(r,e,n){let s,{params:l}=e,t="",i="",p=!1;async function d(){if(!p){n(2,p=!0);try{await L.collection("_superusers").confirmPasswordReset(l==null?void 0:l.token,t,i),X("Successfully set a new superuser password."),Y("/")}catch(g){L.error(g)}n(2,p=!1)}}function u(){t=this.value,n(0,t)}function a(){i=this.value,n(1,i)}return r.$$set=g=>{"params"in g&&n(5,l=g.params)},r.$$.update=()=>{r.$$.dirty&32&&n(3,s=M.getJWTPayload(l==null?void 0:l.token).email||"")},[t,i,p,s,d,l,u,a]}class ae extends y{constructor(e){super(),E(this,e,le,se,G,{params:5})}}export{ae as default}; diff --git a/ui/dist/assets/PageSuperuserRequestPasswordReset-BFv8SpZS.js b/ui/dist/assets/PageSuperuserRequestPasswordReset-CCVoTQW5.js similarity index 98% rename from ui/dist/assets/PageSuperuserRequestPasswordReset-BFv8SpZS.js rename to ui/dist/assets/PageSuperuserRequestPasswordReset-CCVoTQW5.js index b5ba3db6..79e61e9b 100644 --- a/ui/dist/assets/PageSuperuserRequestPasswordReset-BFv8SpZS.js +++ b/ui/dist/assets/PageSuperuserRequestPasswordReset-CCVoTQW5.js @@ -1 +1 @@ -import{S as M,i as T,s as j,F as z,c as E,m as H,t as w,a as y,d as L,j as v,h as m,k as p,n as g,o as d,C as A,D as B,E as D,G,v as k,p as C,f as I,l as F,q as R,u as N,z as h,H as J,I as P,A as S}from"./index-rWxFAXsK.js";function K(u){let e,s,n,l,t,r,c,_,i,a,b,f;return l=new I({props:{class:"form-field required",name:"email",$$slots:{default:[Q,({uniqueId:o})=>({5:o}),({uniqueId:o})=>o?32:0]},$$scope:{ctx:u}}}),{c(){e=m("form"),s=m("div"),s.innerHTML='

Forgotten superuser password

Enter the email associated with your account and we’ll send you a recovery link:

',n=v(),E(l.$$.fragment),t=v(),r=m("button"),c=m("i"),_=v(),i=m("span"),i.textContent="Send recovery link",p(s,"class","content txt-center m-b-sm"),p(c,"class","ri-mail-send-line"),p(i,"class","txt"),p(r,"type","submit"),p(r,"class","btn btn-lg btn-block"),r.disabled=u[1],F(r,"btn-loading",u[1]),p(e,"class","m-b-base")},m(o,$){g(o,e,$),d(e,s),d(e,n),H(l,e,null),d(e,t),d(e,r),d(r,c),d(r,_),d(r,i),a=!0,b||(f=R(e,"submit",N(u[3])),b=!0)},p(o,$){const q={};$&97&&(q.$$scope={dirty:$,ctx:o}),l.$set(q),(!a||$&2)&&(r.disabled=o[1]),(!a||$&2)&&F(r,"btn-loading",o[1])},i(o){a||(w(l.$$.fragment,o),a=!0)},o(o){y(l.$$.fragment,o),a=!1},d(o){o&&k(e),L(l),b=!1,f()}}}function O(u){let e,s,n,l,t,r,c,_,i;return{c(){e=m("div"),s=m("div"),s.innerHTML='',n=v(),l=m("div"),t=m("p"),r=h("Check "),c=m("strong"),_=h(u[0]),i=h(" for the recovery link."),p(s,"class","icon"),p(c,"class","txt-nowrap"),p(l,"class","content"),p(e,"class","alert alert-success")},m(a,b){g(a,e,b),d(e,s),d(e,n),d(e,l),d(l,t),d(t,r),d(t,c),d(c,_),d(t,i)},p(a,b){b&1&&J(_,a[0])},i:P,o:P,d(a){a&&k(e)}}}function Q(u){let e,s,n,l,t,r,c,_;return{c(){e=m("label"),s=h("Email"),l=v(),t=m("input"),p(e,"for",n=u[5]),p(t,"type","email"),p(t,"id",r=u[5]),t.required=!0,t.autofocus=!0},m(i,a){g(i,e,a),d(e,s),g(i,l,a),g(i,t,a),S(t,u[0]),t.focus(),c||(_=R(t,"input",u[4]),c=!0)},p(i,a){a&32&&n!==(n=i[5])&&p(e,"for",n),a&32&&r!==(r=i[5])&&p(t,"id",r),a&1&&t.value!==i[0]&&S(t,i[0])},d(i){i&&(k(e),k(l),k(t)),c=!1,_()}}}function U(u){let e,s,n,l,t,r,c,_;const i=[O,K],a=[];function b(f,o){return f[2]?0:1}return e=b(u),s=a[e]=i[e](u),{c(){s.c(),n=v(),l=m("div"),t=m("a"),t.textContent="Back to login",p(t,"href","/login"),p(t,"class","link-hint"),p(l,"class","content txt-center")},m(f,o){a[e].m(f,o),g(f,n,o),g(f,l,o),d(l,t),r=!0,c||(_=A(B.call(null,t)),c=!0)},p(f,o){let $=e;e=b(f),e===$?a[e].p(f,o):(D(),y(a[$],1,1,()=>{a[$]=null}),G(),s=a[e],s?s.p(f,o):(s=a[e]=i[e](f),s.c()),w(s,1),s.m(n.parentNode,n))},i(f){r||(w(s),r=!0)},o(f){y(s),r=!1},d(f){f&&(k(n),k(l)),a[e].d(f),c=!1,_()}}}function V(u){let e,s;return e=new z({props:{$$slots:{default:[U]},$$scope:{ctx:u}}}),{c(){E(e.$$.fragment)},m(n,l){H(e,n,l),s=!0},p(n,[l]){const t={};l&71&&(t.$$scope={dirty:l,ctx:n}),e.$set(t)},i(n){s||(w(e.$$.fragment,n),s=!0)},o(n){y(e.$$.fragment,n),s=!1},d(n){L(e,n)}}}function W(u,e,s){let n="",l=!1,t=!1;async function r(){if(!l){s(1,l=!0);try{await C.collection("_superusers").requestPasswordReset(n),s(2,t=!0)}catch(_){C.error(_)}s(1,l=!1)}}function c(){n=this.value,s(0,n)}return[n,l,t,r,c]}class Y extends M{constructor(e){super(),T(this,e,W,V,j,{})}}export{Y as default}; +import{S as M,i as T,s as j,F as z,c as E,m as H,t as w,a as y,d as L,j as v,h as m,k as p,n as g,o as d,C as A,D as B,E as D,G,v as k,p as C,f as I,l as F,q as R,u as N,z as h,H as J,I as P,A as S}from"./index-C58oTbH7.js";function K(u){let e,s,n,l,t,r,c,_,i,a,b,f;return l=new I({props:{class:"form-field required",name:"email",$$slots:{default:[Q,({uniqueId:o})=>({5:o}),({uniqueId:o})=>o?32:0]},$$scope:{ctx:u}}}),{c(){e=m("form"),s=m("div"),s.innerHTML='

Forgotten superuser password

Enter the email associated with your account and we’ll send you a recovery link:

',n=v(),E(l.$$.fragment),t=v(),r=m("button"),c=m("i"),_=v(),i=m("span"),i.textContent="Send recovery link",p(s,"class","content txt-center m-b-sm"),p(c,"class","ri-mail-send-line"),p(i,"class","txt"),p(r,"type","submit"),p(r,"class","btn btn-lg btn-block"),r.disabled=u[1],F(r,"btn-loading",u[1]),p(e,"class","m-b-base")},m(o,$){g(o,e,$),d(e,s),d(e,n),H(l,e,null),d(e,t),d(e,r),d(r,c),d(r,_),d(r,i),a=!0,b||(f=R(e,"submit",N(u[3])),b=!0)},p(o,$){const q={};$&97&&(q.$$scope={dirty:$,ctx:o}),l.$set(q),(!a||$&2)&&(r.disabled=o[1]),(!a||$&2)&&F(r,"btn-loading",o[1])},i(o){a||(w(l.$$.fragment,o),a=!0)},o(o){y(l.$$.fragment,o),a=!1},d(o){o&&k(e),L(l),b=!1,f()}}}function O(u){let e,s,n,l,t,r,c,_,i;return{c(){e=m("div"),s=m("div"),s.innerHTML='',n=v(),l=m("div"),t=m("p"),r=h("Check "),c=m("strong"),_=h(u[0]),i=h(" for the recovery link."),p(s,"class","icon"),p(c,"class","txt-nowrap"),p(l,"class","content"),p(e,"class","alert alert-success")},m(a,b){g(a,e,b),d(e,s),d(e,n),d(e,l),d(l,t),d(t,r),d(t,c),d(c,_),d(t,i)},p(a,b){b&1&&J(_,a[0])},i:P,o:P,d(a){a&&k(e)}}}function Q(u){let e,s,n,l,t,r,c,_;return{c(){e=m("label"),s=h("Email"),l=v(),t=m("input"),p(e,"for",n=u[5]),p(t,"type","email"),p(t,"id",r=u[5]),t.required=!0,t.autofocus=!0},m(i,a){g(i,e,a),d(e,s),g(i,l,a),g(i,t,a),S(t,u[0]),t.focus(),c||(_=R(t,"input",u[4]),c=!0)},p(i,a){a&32&&n!==(n=i[5])&&p(e,"for",n),a&32&&r!==(r=i[5])&&p(t,"id",r),a&1&&t.value!==i[0]&&S(t,i[0])},d(i){i&&(k(e),k(l),k(t)),c=!1,_()}}}function U(u){let e,s,n,l,t,r,c,_;const i=[O,K],a=[];function b(f,o){return f[2]?0:1}return e=b(u),s=a[e]=i[e](u),{c(){s.c(),n=v(),l=m("div"),t=m("a"),t.textContent="Back to login",p(t,"href","/login"),p(t,"class","link-hint"),p(l,"class","content txt-center")},m(f,o){a[e].m(f,o),g(f,n,o),g(f,l,o),d(l,t),r=!0,c||(_=A(B.call(null,t)),c=!0)},p(f,o){let $=e;e=b(f),e===$?a[e].p(f,o):(D(),y(a[$],1,1,()=>{a[$]=null}),G(),s=a[e],s?s.p(f,o):(s=a[e]=i[e](f),s.c()),w(s,1),s.m(n.parentNode,n))},i(f){r||(w(s),r=!0)},o(f){y(s),r=!1},d(f){f&&(k(n),k(l)),a[e].d(f),c=!1,_()}}}function V(u){let e,s;return e=new z({props:{$$slots:{default:[U]},$$scope:{ctx:u}}}),{c(){E(e.$$.fragment)},m(n,l){H(e,n,l),s=!0},p(n,[l]){const t={};l&71&&(t.$$scope={dirty:l,ctx:n}),e.$set(t)},i(n){s||(w(e.$$.fragment,n),s=!0)},o(n){y(e.$$.fragment,n),s=!1},d(n){L(e,n)}}}function W(u,e,s){let n="",l=!1,t=!1;async function r(){if(!l){s(1,l=!0);try{await C.collection("_superusers").requestPasswordReset(n),s(2,t=!0)}catch(_){C.error(_)}s(1,l=!1)}}function c(){n=this.value,s(0,n)}return[n,l,t,r,c]}class Y extends M{constructor(e){super(),T(this,e,W,V,j,{})}}export{Y as default}; diff --git a/ui/dist/assets/PasswordResetDocs-CIs4u0g3.js b/ui/dist/assets/PasswordResetDocs-DsQvQsH3.js similarity index 99% rename from ui/dist/assets/PasswordResetDocs-CIs4u0g3.js rename to ui/dist/assets/PasswordResetDocs-DsQvQsH3.js index a144b7dc..4ac1a1e9 100644 --- a/ui/dist/assets/PasswordResetDocs-CIs4u0g3.js +++ b/ui/dist/assets/PasswordResetDocs-DsQvQsH3.js @@ -1,4 +1,4 @@ -import{S as se,i as ne,s as oe,X as K,h as p,j as S,z as D,k,n as b,o as u,H as X,Y as ee,Z as ye,E as te,_ as Te,G as le,t as G,a as J,v,l as j,q as ae,W as Ee,c as Z,m as Q,d as x,V as qe,$ as fe,J as Ce,p as Oe,a0 as pe}from"./index-rWxFAXsK.js";function me(o,t,e){const n=o.slice();return n[4]=t[e],n}function _e(o,t,e){const n=o.slice();return n[4]=t[e],n}function he(o,t){let e,n=t[4].code+"",d,c,r,a;function f(){return t[3](t[4])}return{key:o,first:null,c(){e=p("button"),d=D(n),c=S(),k(e,"class","tab-item"),j(e,"active",t[1]===t[4].code),this.first=e},m(g,y){b(g,e,y),u(e,d),u(e,c),r||(a=ae(e,"click",f),r=!0)},p(g,y){t=g,y&4&&n!==(n=t[4].code+"")&&X(d,n),y&6&&j(e,"active",t[1]===t[4].code)},d(g){g&&v(e),r=!1,a()}}}function be(o,t){let e,n,d,c;return n=new Ee({props:{content:t[4].body}}),{key:o,first:null,c(){e=p("div"),Z(n.$$.fragment),d=S(),k(e,"class","tab-item"),j(e,"active",t[1]===t[4].code),this.first=e},m(r,a){b(r,e,a),Q(n,e,null),u(e,d),c=!0},p(r,a){t=r;const f={};a&4&&(f.content=t[4].body),n.$set(f),(!c||a&6)&&j(e,"active",t[1]===t[4].code)},i(r){c||(G(n.$$.fragment,r),c=!0)},o(r){J(n.$$.fragment,r),c=!1},d(r){r&&v(e),x(n)}}}function We(o){let t,e,n,d,c,r,a,f=o[0].name+"",g,y,F,C,z,A,L,O,W,T,q,R=[],M=new Map,U,N,h=[],H=new Map,E,P=K(o[2]);const B=l=>l[4].code;for(let l=0;ll[4].code;for(let l=0;lParam Type Description
Required token
String The token from the password reset request email.
Required password
String The new password to set.
Required passwordConfirm
String The new password confirmation.',L=S(),O=p("div"),O.textContent="Responses",W=S(),T=p("div"),q=p("div");for(let l=0;le(1,d=a.code);return o.$$set=a=>{"collection"in a&&e(0,n=a.collection)},e(2,c=[{code:204,body:"null"},{code:400,body:` +import{S as se,i as ne,s as oe,X as K,h as p,j as S,z as D,k,n as b,o as u,H as X,Y as ee,Z as ye,E as te,_ as Te,G as le,t as G,a as J,v,l as j,q as ae,W as Ee,c as Z,m as Q,d as x,V as qe,$ as fe,J as Ce,p as Oe,a0 as pe}from"./index-C58oTbH7.js";function me(o,t,e){const n=o.slice();return n[4]=t[e],n}function _e(o,t,e){const n=o.slice();return n[4]=t[e],n}function he(o,t){let e,n=t[4].code+"",d,c,r,a;function f(){return t[3](t[4])}return{key:o,first:null,c(){e=p("button"),d=D(n),c=S(),k(e,"class","tab-item"),j(e,"active",t[1]===t[4].code),this.first=e},m(g,y){b(g,e,y),u(e,d),u(e,c),r||(a=ae(e,"click",f),r=!0)},p(g,y){t=g,y&4&&n!==(n=t[4].code+"")&&X(d,n),y&6&&j(e,"active",t[1]===t[4].code)},d(g){g&&v(e),r=!1,a()}}}function be(o,t){let e,n,d,c;return n=new Ee({props:{content:t[4].body}}),{key:o,first:null,c(){e=p("div"),Z(n.$$.fragment),d=S(),k(e,"class","tab-item"),j(e,"active",t[1]===t[4].code),this.first=e},m(r,a){b(r,e,a),Q(n,e,null),u(e,d),c=!0},p(r,a){t=r;const f={};a&4&&(f.content=t[4].body),n.$set(f),(!c||a&6)&&j(e,"active",t[1]===t[4].code)},i(r){c||(G(n.$$.fragment,r),c=!0)},o(r){J(n.$$.fragment,r),c=!1},d(r){r&&v(e),x(n)}}}function We(o){let t,e,n,d,c,r,a,f=o[0].name+"",g,y,F,C,z,A,L,O,W,T,q,R=[],M=new Map,U,N,h=[],H=new Map,E,P=K(o[2]);const B=l=>l[4].code;for(let l=0;ll[4].code;for(let l=0;lParam Type Description
Required token
String The token from the password reset request email.
Required password
String The new password to set.
Required passwordConfirm
String The new password confirmation.',L=S(),O=p("div"),O.textContent="Responses",W=S(),T=p("div"),q=p("div");for(let l=0;le(1,d=a.code);return o.$$set=a=>{"collection"in a&&e(0,n=a.collection)},e(2,c=[{code:204,body:"null"},{code:400,body:` { "code": 400, "message": "An error occurred while validating the submitted data.", diff --git a/ui/dist/assets/RealtimeApiDocs-BoGCX4-9.js b/ui/dist/assets/RealtimeApiDocs-BC7IwiaY.js similarity index 99% rename from ui/dist/assets/RealtimeApiDocs-BoGCX4-9.js rename to ui/dist/assets/RealtimeApiDocs-BC7IwiaY.js index 6cf479e2..77470f58 100644 --- a/ui/dist/assets/RealtimeApiDocs-BoGCX4-9.js +++ b/ui/dist/assets/RealtimeApiDocs-BC7IwiaY.js @@ -1,4 +1,4 @@ -import{S as re,i as ae,s as be,V as pe,W as ue,J as P,h as p,z as y,j as a,c as se,k as u,n as s,o as I,m as ne,H as me,t as ie,a as ce,v as n,d as le,p as de}from"./index-rWxFAXsK.js";function he(o){var B,U,W,H,L,A,T,j,q,J,M,N;let i,m,c=o[0].name+"",b,d,k,h,D,f,_,l,S,$,C,g,E,v,w,r,R;return l=new pe({props:{js:` +import{S as re,i as ae,s as be,V as pe,W as ue,J as P,h as p,z as y,j as a,c as se,k as u,n as s,o as I,m as ne,H as me,t as ie,a as ce,v as n,d as le,p as de}from"./index-C58oTbH7.js";function he(o){var B,U,W,H,L,A,T,j,q,J,M,N;let i,m,c=o[0].name+"",b,d,k,h,D,f,_,l,S,$,C,g,E,v,w,r,R;return l=new pe({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[1]}'); diff --git a/ui/dist/assets/UpdateApiDocs-DiOtUnmN.js b/ui/dist/assets/UpdateApiDocs-Qjcnv2Ln.js similarity index 99% rename from ui/dist/assets/UpdateApiDocs-DiOtUnmN.js rename to ui/dist/assets/UpdateApiDocs-Qjcnv2Ln.js index 3b39b151..954f18fe 100644 --- a/ui/dist/assets/UpdateApiDocs-DiOtUnmN.js +++ b/ui/dist/assets/UpdateApiDocs-Qjcnv2Ln.js @@ -1,4 +1,4 @@ -import{S as Ot,i as St,s as Mt,V as $t,J as x,X as ie,W as Tt,h as i,z as h,j as f,c as ve,k,n as o,o as n,m as we,H as te,Y as Je,Z as bt,E as qt,_ as Rt,G as Ht,t as he,a as ye,v as r,d as Ce,p as Dt,l as Te,q as Lt,I as de}from"./index-rWxFAXsK.js";import{F as Pt}from"./FieldsQueryParam-DmBOgcIi.js";function mt(d,e,t){const a=d.slice();return a[10]=e[t],a}function _t(d,e,t){const a=d.slice();return a[10]=e[t],a}function ht(d,e,t){const a=d.slice();return a[15]=e[t],a}function yt(d){let e;return{c(){e=i("p"),e.innerHTML=`Note that in case of a password change all previously issued tokens for the current record +import{S as Ot,i as St,s as Mt,V as $t,J as x,X as ie,W as Tt,h as i,z as h,j as f,c as ve,k,n as o,o as n,m as we,H as te,Y as Je,Z as bt,E as qt,_ as Rt,G as Ht,t as he,a as ye,v as r,d as Ce,p as Dt,l as Te,q as Lt,I as de}from"./index-C58oTbH7.js";import{F as Pt}from"./FieldsQueryParam-B-V1imBW.js";function mt(d,e,t){const a=d.slice();return a[10]=e[t],a}function _t(d,e,t){const a=d.slice();return a[10]=e[t],a}function ht(d,e,t){const a=d.slice();return a[15]=e[t],a}function yt(d){let e;return{c(){e=i("p"),e.innerHTML=`Note that in case of a password change all previously issued tokens for the current record will be automatically invalidated and if you want your user to remain signed in you need to reauthenticate manually after the update call.`},m(t,a){o(t,e,a)},d(t){t&&r(e)}}}function kt(d){let e;return{c(){e=i("p"),e.innerHTML="Requires superuser Authorization:TOKEN header",k(e,"class","txt-hint txt-sm txt-right")},m(t,a){o(t,e,a)},d(t){t&&r(e)}}}function gt(d){let e,t,a,m,p,c,u,b,O,T,M,H,S,E,q,D,J,I,$,R,L,g,v,w;function z(_,C){var le,W,ne;return C&1&&(b=null),b==null&&(b=!!((ne=(W=(le=_[0])==null?void 0:le.fields)==null?void 0:W.find(Qt))!=null&&ne.required)),b?jt:Ft}let Q=z(d,-1),F=Q(d);return{c(){e=i("tr"),e.innerHTML='Auth specific fields',t=f(),a=i("tr"),a.innerHTML=`
Optional email
String The auth record email address.
diff --git a/ui/dist/assets/VerificationDocs-CP0Ct84F.js b/ui/dist/assets/VerificationDocs-12SqmFuG.js similarity index 99% rename from ui/dist/assets/VerificationDocs-CP0Ct84F.js rename to ui/dist/assets/VerificationDocs-12SqmFuG.js index 4e1dcfb3..0d8881aa 100644 --- a/ui/dist/assets/VerificationDocs-CP0Ct84F.js +++ b/ui/dist/assets/VerificationDocs-12SqmFuG.js @@ -1,4 +1,4 @@ -import{S as le,i as ne,s as ie,X as F,h as m,j as y,z as M,k as v,n as b,o as d,H as W,Y as x,Z as Te,E as ee,_ as qe,G as te,t as L,a as U,v as h,l as H,q as oe,W as Ce,c as Y,m as Z,d as Q,V as Ve,$ as fe,J as Ae,p as Ie,a0 as de}from"./index-rWxFAXsK.js";function ue(s,t,e){const o=s.slice();return o[4]=t[e],o}function me(s,t,e){const o=s.slice();return o[4]=t[e],o}function pe(s,t){let e,o=t[4].code+"",f,c,r,a;function u(){return t[3](t[4])}return{key:s,first:null,c(){e=m("button"),f=M(o),c=y(),v(e,"class","tab-item"),H(e,"active",t[1]===t[4].code),this.first=e},m(g,q){b(g,e,q),d(e,f),d(e,c),r||(a=oe(e,"click",u),r=!0)},p(g,q){t=g,q&4&&o!==(o=t[4].code+"")&&W(f,o),q&6&&H(e,"active",t[1]===t[4].code)},d(g){g&&h(e),r=!1,a()}}}function _e(s,t){let e,o,f,c;return o=new Ce({props:{content:t[4].body}}),{key:s,first:null,c(){e=m("div"),Y(o.$$.fragment),f=y(),v(e,"class","tab-item"),H(e,"active",t[1]===t[4].code),this.first=e},m(r,a){b(r,e,a),Z(o,e,null),d(e,f),c=!0},p(r,a){t=r;const u={};a&4&&(u.content=t[4].body),o.$set(u),(!c||a&6)&&H(e,"active",t[1]===t[4].code)},i(r){c||(L(o.$$.fragment,r),c=!0)},o(r){U(o.$$.fragment,r),c=!1},d(r){r&&h(e),Q(o)}}}function Pe(s){let t,e,o,f,c,r,a,u=s[0].name+"",g,q,D,P,j,R,B,E,N,C,V,$=[],z=new Map,K,I,p=[],T=new Map,A,_=F(s[2]);const J=l=>l[4].code;for(let l=0;l<_.length;l+=1){let i=me(s,_,l),n=J(i);z.set(n,$[l]=pe(n,i))}let O=F(s[2]);const G=l=>l[4].code;for(let l=0;lParam Type Description
Required token
String The token from the verification request email.',B=y(),E=m("div"),E.textContent="Responses",N=y(),C=m("div"),V=m("div");for(let l=0;l<$.length;l+=1)$[l].c();K=y(),I=m("div");for(let l=0;le(1,f=a.code);return s.$$set=a=>{"collection"in a&&e(0,o=a.collection)},e(2,c=[{code:204,body:"null"},{code:400,body:` +import{S as le,i as ne,s as ie,X as F,h as m,j as y,z as M,k as v,n as b,o as d,H as W,Y as x,Z as Te,E as ee,_ as qe,G as te,t as L,a as U,v as h,l as H,q as oe,W as Ce,c as Y,m as Z,d as Q,V as Ve,$ as fe,J as Ae,p as Ie,a0 as de}from"./index-C58oTbH7.js";function ue(s,t,e){const o=s.slice();return o[4]=t[e],o}function me(s,t,e){const o=s.slice();return o[4]=t[e],o}function pe(s,t){let e,o=t[4].code+"",f,c,r,a;function u(){return t[3](t[4])}return{key:s,first:null,c(){e=m("button"),f=M(o),c=y(),v(e,"class","tab-item"),H(e,"active",t[1]===t[4].code),this.first=e},m(g,q){b(g,e,q),d(e,f),d(e,c),r||(a=oe(e,"click",u),r=!0)},p(g,q){t=g,q&4&&o!==(o=t[4].code+"")&&W(f,o),q&6&&H(e,"active",t[1]===t[4].code)},d(g){g&&h(e),r=!1,a()}}}function _e(s,t){let e,o,f,c;return o=new Ce({props:{content:t[4].body}}),{key:s,first:null,c(){e=m("div"),Y(o.$$.fragment),f=y(),v(e,"class","tab-item"),H(e,"active",t[1]===t[4].code),this.first=e},m(r,a){b(r,e,a),Z(o,e,null),d(e,f),c=!0},p(r,a){t=r;const u={};a&4&&(u.content=t[4].body),o.$set(u),(!c||a&6)&&H(e,"active",t[1]===t[4].code)},i(r){c||(L(o.$$.fragment,r),c=!0)},o(r){U(o.$$.fragment,r),c=!1},d(r){r&&h(e),Q(o)}}}function Pe(s){let t,e,o,f,c,r,a,u=s[0].name+"",g,q,D,P,j,R,B,E,N,C,V,$=[],z=new Map,K,I,p=[],T=new Map,A,_=F(s[2]);const J=l=>l[4].code;for(let l=0;l<_.length;l+=1){let i=me(s,_,l),n=J(i);z.set(n,$[l]=pe(n,i))}let O=F(s[2]);const G=l=>l[4].code;for(let l=0;lParam Type Description
Required token
String The token from the verification request email.',B=y(),E=m("div"),E.textContent="Responses",N=y(),C=m("div"),V=m("div");for(let l=0;l<$.length;l+=1)$[l].c();K=y(),I=m("div");for(let l=0;le(1,f=a.code);return s.$$set=a=>{"collection"in a&&e(0,o=a.collection)},e(2,c=[{code:204,body:"null"},{code:400,body:` { "code": 400, "message": "An error occurred while validating the submitted data.", diff --git a/ui/dist/assets/ViewApiDocs-DZ9ip2ya.js b/ui/dist/assets/ViewApiDocs-DL4sWQDZ.js similarity index 98% rename from ui/dist/assets/ViewApiDocs-DZ9ip2ya.js rename to ui/dist/assets/ViewApiDocs-DL4sWQDZ.js index 6d8426c6..8d10a0d4 100644 --- a/ui/dist/assets/ViewApiDocs-DZ9ip2ya.js +++ b/ui/dist/assets/ViewApiDocs-DL4sWQDZ.js @@ -1,4 +1,4 @@ -import{S as lt,i as st,s as nt,V as ot,W as tt,X as K,h as o,z as _,j as b,c as W,k as m,n as r,o as l,m as X,H as ve,Y as Qe,Z as at,E as it,_ as rt,G as dt,t as U,a as V,v as d,d as Y,J as Ke,p as ct,l as Z,q as pt}from"./index-rWxFAXsK.js";import{F as ut}from"./FieldsQueryParam-DmBOgcIi.js";function We(a,s,n){const i=a.slice();return i[6]=s[n],i}function Xe(a,s,n){const i=a.slice();return i[6]=s[n],i}function Ye(a){let s;return{c(){s=o("p"),s.innerHTML="Requires superuser Authorization:TOKEN header",m(s,"class","txt-hint txt-sm txt-right")},m(n,i){r(n,s,i)},d(n){n&&d(s)}}}function Ze(a,s){let n,i,v;function p(){return s[5](s[6])}return{key:a,first:null,c(){n=o("button"),n.textContent=`${s[6].code} `,m(n,"class","tab-item"),Z(n,"active",s[2]===s[6].code),this.first=n},m(c,f){r(c,n,f),i||(v=pt(n,"click",p),i=!0)},p(c,f){s=c,f&20&&Z(n,"active",s[2]===s[6].code)},d(c){c&&d(n),i=!1,v()}}}function et(a,s){let n,i,v,p;return i=new tt({props:{content:s[6].body}}),{key:a,first:null,c(){n=o("div"),W(i.$$.fragment),v=b(),m(n,"class","tab-item"),Z(n,"active",s[2]===s[6].code),this.first=n},m(c,f){r(c,n,f),X(i,n,null),l(n,v),p=!0},p(c,f){s=c,(!p||f&20)&&Z(n,"active",s[2]===s[6].code)},i(c){p||(U(i.$$.fragment,c),p=!0)},o(c){V(i.$$.fragment,c),p=!1},d(c){c&&d(n),Y(i)}}}function ft(a){var ze,Ge;let s,n,i=a[0].name+"",v,p,c,f,w,C,ee,z=a[0].name+"",te,$e,le,F,se,S,ne,$,G,ye,J,T,we,oe,N=a[0].name+"",ae,Ce,ie,Fe,re,q,de,x,ce,A,pe,R,ue,Re,H,O,fe,Oe,be,De,h,Pe,E,Te,Ee,Be,me,Se,_e,qe,xe,Ae,he,He,Ie,B,ke,I,ge,D,M,y=[],Me=new Map,Le,L,k=[],je=new Map,P;F=new ot({props:{js:` +import{S as lt,i as st,s as nt,V as ot,W as tt,X as K,h as o,z as _,j as b,c as W,k as m,n as r,o as l,m as X,H as ve,Y as Qe,Z as at,E as it,_ as rt,G as dt,t as U,a as V,v as d,d as Y,J as Ke,p as ct,l as Z,q as pt}from"./index-C58oTbH7.js";import{F as ut}from"./FieldsQueryParam-B-V1imBW.js";function We(a,s,n){const i=a.slice();return i[6]=s[n],i}function Xe(a,s,n){const i=a.slice();return i[6]=s[n],i}function Ye(a){let s;return{c(){s=o("p"),s.innerHTML="Requires superuser Authorization:TOKEN header",m(s,"class","txt-hint txt-sm txt-right")},m(n,i){r(n,s,i)},d(n){n&&d(s)}}}function Ze(a,s){let n,i,v;function p(){return s[5](s[6])}return{key:a,first:null,c(){n=o("button"),n.textContent=`${s[6].code} `,m(n,"class","tab-item"),Z(n,"active",s[2]===s[6].code),this.first=n},m(c,f){r(c,n,f),i||(v=pt(n,"click",p),i=!0)},p(c,f){s=c,f&20&&Z(n,"active",s[2]===s[6].code)},d(c){c&&d(n),i=!1,v()}}}function et(a,s){let n,i,v,p;return i=new tt({props:{content:s[6].body}}),{key:a,first:null,c(){n=o("div"),W(i.$$.fragment),v=b(),m(n,"class","tab-item"),Z(n,"active",s[2]===s[6].code),this.first=n},m(c,f){r(c,n,f),X(i,n,null),l(n,v),p=!0},p(c,f){s=c,(!p||f&20)&&Z(n,"active",s[2]===s[6].code)},i(c){p||(U(i.$$.fragment,c),p=!0)},o(c){V(i.$$.fragment,c),p=!1},d(c){c&&d(n),Y(i)}}}function ft(a){var ze,Ge;let s,n,i=a[0].name+"",v,p,c,f,w,C,ee,z=a[0].name+"",te,$e,le,F,se,S,ne,$,G,ye,J,T,we,oe,N=a[0].name+"",ae,Ce,ie,Fe,re,q,de,x,ce,A,pe,R,ue,Re,H,O,fe,Oe,be,De,h,Pe,E,Te,Ee,Be,me,Se,_e,qe,xe,Ae,he,He,Ie,B,ke,I,ge,D,M,y=[],Me=new Map,Le,L,k=[],je=new Map,P;F=new ot({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${a[3]}'); diff --git a/ui/dist/assets/index-C-PlLH2L.js b/ui/dist/assets/index-C-PlLH2L.js deleted file mode 100644 index 5eae058d..00000000 --- a/ui/dist/assets/index-C-PlLH2L.js +++ /dev/null @@ -1,14 +0,0 @@ -class F{lineAt(t){if(t<0||t>this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,e,i){[t,e]=Ge(this,t,e);let n=[];return this.decompose(0,t,n,2),i.length&&i.decompose(0,i.length,n,3),this.decompose(e,this.length,n,1),Gt.from(n,this.length-(e-t)+i.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,e=this.length){[t,e]=Ge(this,t,e);let i=[];return this.decompose(t,e,i,0),Gt.from(i,e-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let e=this.scanIdentical(t,1),i=this.length-this.scanIdentical(t,-1),n=new yi(this),r=new yi(t);for(let o=e,l=e;;){if(n.next(o),r.next(o),o=0,n.lineBreak!=r.lineBreak||n.done!=r.done||n.value!=r.value)return!1;if(l+=n.value.length,n.done||l>=i)return!0}}iter(t=1){return new yi(this,t)}iterRange(t,e=this.length){return new Ll(this,t,e)}iterLines(t,e){let i;if(t==null)i=this.iter();else{e==null&&(e=this.lines+1);let n=this.line(t).from;i=this.iterRange(n,Math.max(n,e==this.lines+1?this.length:e<=1?0:this.line(e-1).to))}return new El(i)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}constructor(){}static of(t){if(t.length==0)throw new RangeError("A document must have at least one line");return t.length==1&&!t[0]?F.empty:t.length<=32?new _(t):Gt.from(_.split(t,[]))}}class _ extends F{constructor(t,e=Cc(t)){super(),this.text=t,this.length=e}get lines(){return this.text.length}get children(){return null}lineInner(t,e,i,n){for(let r=0;;r++){let o=this.text[r],l=n+o.length;if((e?i:l)>=t)return new Ac(n,l,i,o);n=l+1,i++}}decompose(t,e,i,n){let r=t<=0&&e>=this.length?this:new _(Jr(this.text,t,e),Math.min(e,this.length)-Math.max(0,t));if(n&1){let o=i.pop(),l=hn(r.text,o.text.slice(),0,r.length);if(l.length<=32)i.push(new _(l,o.length+r.length));else{let a=l.length>>1;i.push(new _(l.slice(0,a)),new _(l.slice(a)))}}else i.push(r)}replace(t,e,i){if(!(i instanceof _))return super.replace(t,e,i);[t,e]=Ge(this,t,e);let n=hn(this.text,hn(i.text,Jr(this.text,0,t)),e),r=this.length+i.length-(e-t);return n.length<=32?new _(n,r):Gt.from(_.split(n,[]),r)}sliceString(t,e=this.length,i=` -`){[t,e]=Ge(this,t,e);let n="";for(let r=0,o=0;r<=e&&ot&&o&&(n+=i),tr&&(n+=l.slice(Math.max(0,t-r),e-r)),r=a+1}return n}flatten(t){for(let e of this.text)t.push(e)}scanIdentical(){return 0}static split(t,e){let i=[],n=-1;for(let r of t)i.push(r),n+=r.length+1,i.length==32&&(e.push(new _(i,n)),i=[],n=-1);return n>-1&&e.push(new _(i,n)),e}}class Gt extends F{constructor(t,e){super(),this.children=t,this.length=e,this.lines=0;for(let i of t)this.lines+=i.lines}lineInner(t,e,i,n){for(let r=0;;r++){let o=this.children[r],l=n+o.length,a=i+o.lines-1;if((e?a:l)>=t)return o.lineInner(t,e,i,n);n=l+1,i=a+1}}decompose(t,e,i,n){for(let r=0,o=0;o<=e&&r=o){let c=n&((o<=t?1:0)|(a>=e?2:0));o>=t&&a<=e&&!c?i.push(l):l.decompose(t-o,e-o,i,c)}o=a+1}}replace(t,e,i){if([t,e]=Ge(this,t,e),i.lines=r&&e<=l){let a=o.replace(t-r,e-r,i),c=this.lines-o.lines+a.lines;if(a.lines>4&&a.lines>c>>6){let h=this.children.slice();return h[n]=a,new Gt(h,this.length-(e-t)+i.length)}return super.replace(r,l,a)}r=l+1}return super.replace(t,e,i)}sliceString(t,e=this.length,i=` -`){[t,e]=Ge(this,t,e);let n="";for(let r=0,o=0;rt&&r&&(n+=i),to&&(n+=l.sliceString(t-o,e-o,i)),o=a+1}return n}flatten(t){for(let e of this.children)e.flatten(t)}scanIdentical(t,e){if(!(t instanceof Gt))return 0;let i=0,[n,r,o,l]=e>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;n+=e,r+=e){if(n==o||r==l)return i;let a=this.children[n],c=t.children[r];if(a!=c)return i+a.scanIdentical(c,e);i+=a.length+1}}static from(t,e=t.reduce((i,n)=>i+n.length+1,-1)){let i=0;for(let d of t)i+=d.lines;if(i<32){let d=[];for(let p of t)p.flatten(d);return new _(d,e)}let n=Math.max(32,i>>5),r=n<<1,o=n>>1,l=[],a=0,c=-1,h=[];function f(d){let p;if(d.lines>r&&d instanceof Gt)for(let g of d.children)f(g);else d.lines>o&&(a>o||!a)?(u(),l.push(d)):d instanceof _&&a&&(p=h[h.length-1])instanceof _&&d.lines+p.lines<=32?(a+=d.lines,c+=d.length+1,h[h.length-1]=new _(p.text.concat(d.text),p.length+1+d.length)):(a+d.lines>n&&u(),a+=d.lines,c+=d.length+1,h.push(d))}function u(){a!=0&&(l.push(h.length==1?h[0]:Gt.from(h,c)),c=-1,a=h.length=0)}for(let d of t)f(d);return u(),l.length==1?l[0]:new Gt(l,e)}}F.empty=new _([""],0);function Cc(s){let t=-1;for(let e of s)t+=e.length+1;return t}function hn(s,t,e=0,i=1e9){for(let n=0,r=0,o=!0;r=e&&(a>i&&(l=l.slice(0,i-n)),n0?1:(t instanceof _?t.text.length:t.children.length)<<1]}nextInner(t,e){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,n=this.nodes[i],r=this.offsets[i],o=r>>1,l=n instanceof _?n.text.length:n.children.length;if(o==(e>0?l:0)){if(i==0)return this.done=!0,this.value="",this;e>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((r&1)==(e>0?0:1)){if(this.offsets[i]+=e,t==0)return this.lineBreak=!0,this.value=` -`,this;t--}else if(n instanceof _){let a=n.text[o+(e<0?-1:0)];if(this.offsets[i]+=e,a.length>Math.max(0,t))return this.value=t==0?a:e>0?a.slice(t):a.slice(0,a.length-t),this;t-=a.length}else{let a=n.children[o+(e<0?-1:0)];t>a.length?(t-=a.length,this.offsets[i]+=e):(e<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(e>0?1:(a instanceof _?a.text.length:a.children.length)<<1))}}}next(t=0){return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}class Ll{constructor(t,e,i){this.value="",this.done=!1,this.cursor=new yi(t,e>i?-1:1),this.pos=e>i?t.length:0,this.from=Math.min(e,i),this.to=Math.max(e,i)}nextInner(t,e){if(e<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,e<0?this.pos-this.to:this.from-this.pos);let i=e<0?this.pos-this.from:this.to-this.pos;t>i&&(t=i),i-=t;let{value:n}=this.cursor.next(t);return this.pos+=(n.length+t)*e,this.value=n.length<=i?n:e<0?n.slice(n.length-i):n.slice(0,i),this.done=!this.value,this}next(t=0){return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class El{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:e,lineBreak:i,value:n}=this.inner.next(t);return e&&this.afterBreak?(this.value="",this.afterBreak=!1):e?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=n,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(F.prototype[Symbol.iterator]=function(){return this.iter()},yi.prototype[Symbol.iterator]=Ll.prototype[Symbol.iterator]=El.prototype[Symbol.iterator]=function(){return this});class Ac{constructor(t,e,i,n){this.from=t,this.to=e,this.number=i,this.text=n}get length(){return this.to-this.from}}function Ge(s,t,e){return t=Math.max(0,Math.min(s.length,t)),[t,Math.max(t,Math.min(s.length,e))]}let ze="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(s=>s?parseInt(s,36):1);for(let s=1;ss)return ze[t-1]<=s;return!1}function Yr(s){return s>=127462&&s<=127487}const Xr=8205;function ot(s,t,e=!0,i=!0){return(e?Il:Dc)(s,t,i)}function Il(s,t,e){if(t==s.length)return t;t&&Nl(s.charCodeAt(t))&&Fl(s.charCodeAt(t-1))&&t--;let i=st(s,t);for(t+=Bt(i);t=0&&Yr(st(s,o));)r++,o-=2;if(r%2==0)break;t+=2}else break}return t}function Dc(s,t,e){for(;t>0;){let i=Il(s,t-2,e);if(i=56320&&s<57344}function Fl(s){return s>=55296&&s<56320}function st(s,t){let e=s.charCodeAt(t);if(!Fl(e)||t+1==s.length)return e;let i=s.charCodeAt(t+1);return Nl(i)?(e-55296<<10)+(i-56320)+65536:e}function fr(s){return s<=65535?String.fromCharCode(s):(s-=65536,String.fromCharCode((s>>10)+55296,(s&1023)+56320))}function Bt(s){return s<65536?1:2}const ms=/\r\n?|\n/;var ht=function(s){return s[s.Simple=0]="Simple",s[s.TrackDel=1]="TrackDel",s[s.TrackBefore=2]="TrackBefore",s[s.TrackAfter=3]="TrackAfter",s}(ht||(ht={}));class Qt{constructor(t){this.sections=t}get length(){let t=0;for(let e=0;et)return r+(t-n);r+=l}else{if(i!=ht.Simple&&c>=t&&(i==ht.TrackDel&&nt||i==ht.TrackBefore&&nt))return null;if(c>t||c==t&&e<0&&!l)return t==n||e<0?r:r+a;r+=a}n=c}if(t>n)throw new RangeError(`Position ${t} is out of range for changeset of length ${n}`);return r}touchesRange(t,e=t){for(let i=0,n=0;i=0&&n<=e&&l>=t)return ne?"cover":!0;n=l}return!1}toString(){let t="";for(let e=0;e=0?":"+n:"")}return t}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(e=>typeof e!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Qt(t)}static create(t){return new Qt(t)}}class tt extends Qt{constructor(t,e){super(t),this.inserted=e}apply(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return ys(this,(e,i,n,r,o)=>t=t.replace(n,n+(i-e),o),!1),t}mapDesc(t,e=!1){return bs(this,t,e,!0)}invert(t){let e=this.sections.slice(),i=[];for(let n=0,r=0;n=0){e[n]=l,e[n+1]=o;let a=n>>1;for(;i.length0&&ce(i,e,r.text),r.forward(h),l+=h}let c=t[o++];for(;l>1].toJSON()))}return t}static of(t,e,i){let n=[],r=[],o=0,l=null;function a(h=!1){if(!h&&!n.length)return;ou||f<0||u>e)throw new RangeError(`Invalid change range ${f} to ${u} (in doc of length ${e})`);let p=d?typeof d=="string"?F.of(d.split(i||ms)):d:F.empty,g=p.length;if(f==u&&g==0)return;fo&&at(n,f-o,-1),at(n,u-f,g),ce(r,n,p),o=u}}return c(t),a(!l),l}static empty(t){return new tt(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");let e=[],i=[];for(let n=0;nl&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(r.length==1)e.push(r[0],0);else{for(;i.length=0&&e<=0&&e==s[n+1]?s[n]+=t:t==0&&s[n]==0?s[n+1]+=e:i?(s[n]+=t,s[n+1]+=e):s.push(t,e)}function ce(s,t,e){if(e.length==0)return;let i=t.length-2>>1;if(i>1])),!(e||o==s.sections.length||s.sections[o+1]<0);)l=s.sections[o++],a=s.sections[o++];t(n,c,r,h,f),n=c,r=h}}}function bs(s,t,e,i=!1){let n=[],r=i?[]:null,o=new Si(s),l=new Si(t);for(let a=-1;;)if(o.ins==-1&&l.ins==-1){let c=Math.min(o.len,l.len);at(n,c,-1),o.forward(c),l.forward(c)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len=0&&a=0){let c=0,h=o.len;for(;h;)if(l.ins==-1){let f=Math.min(h,l.len);c+=f,h-=f,l.forward(f)}else if(l.ins==0&&l.lena||o.ins>=0&&o.len>a)&&(l||i.length>c),r.forward2(a),o.forward(a)}}}}class Si{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i>1;return e>=t.length?F.empty:t[e]}textBit(t){let{inserted:e}=this.set,i=this.i-2>>1;return i>=e.length&&!t?F.empty:e[i].slice(this.off,t==null?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){this.ins==-1?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class ke{constructor(t,e,i){this.from=t,this.to=e,this.flags=i}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let t=this.flags&7;return t==7?null:t}get goalColumn(){let t=this.flags>>6;return t==16777215?void 0:t}map(t,e=-1){let i,n;return this.empty?i=n=t.mapPos(this.from,e):(i=t.mapPos(this.from,1),n=t.mapPos(this.to,-1)),i==this.from&&n==this.to?this:new ke(i,n,this.flags)}extend(t,e=t){if(t<=this.anchor&&e>=this.anchor)return b.range(t,e);let i=Math.abs(t-this.anchor)>Math.abs(e-this.anchor)?t:e;return b.range(this.anchor,i)}eq(t,e=!1){return this.anchor==t.anchor&&this.head==t.head&&(!e||!this.empty||this.assoc==t.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return b.range(t.anchor,t.head)}static create(t,e,i){return new ke(t,e,i)}}class b{constructor(t,e){this.ranges=t,this.mainIndex=e}map(t,e=-1){return t.empty?this:b.create(this.ranges.map(i=>i.map(t,e)),this.mainIndex)}eq(t,e=!1){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(let i=0;it.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!="number"||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new b(t.ranges.map(e=>ke.fromJSON(e)),t.main)}static single(t,e=t){return new b([b.range(t,e)],0)}static create(t,e=0){if(t.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,n=0;nt?8:0)|r)}static normalized(t,e=0){let i=t[e];t.sort((n,r)=>n.from-r.from),e=t.indexOf(i);for(let n=1;nr.head?b.range(a,l):b.range(l,a))}}return new b(t,e)}}function Hl(s,t){for(let e of s.ranges)if(e.to>t)throw new RangeError("Selection points outside of document")}let ur=0;class T{constructor(t,e,i,n,r){this.combine=t,this.compareInput=e,this.compare=i,this.isStatic=n,this.id=ur++,this.default=t([]),this.extensions=typeof r=="function"?r(this):r}get reader(){return this}static define(t={}){return new T(t.combine||(e=>e),t.compareInput||((e,i)=>e===i),t.compare||(t.combine?(e,i)=>e===i:dr),!!t.static,t.enables)}of(t){return new cn([],this,0,t)}compute(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new cn(t,this,1,e)}computeN(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new cn(t,this,2,e)}from(t,e){return e||(e=i=>i),this.compute([t],i=>e(i.field(t)))}}function dr(s,t){return s==t||s.length==t.length&&s.every((e,i)=>e===t[i])}class cn{constructor(t,e,i,n){this.dependencies=t,this.facet=e,this.type=i,this.value=n,this.id=ur++}dynamicSlot(t){var e;let i=this.value,n=this.facet.compareInput,r=this.id,o=t[r]>>1,l=this.type==2,a=!1,c=!1,h=[];for(let f of this.dependencies)f=="doc"?a=!0:f=="selection"?c=!0:((e=t[f.id])!==null&&e!==void 0?e:1)&1||h.push(t[f.id]);return{create(f){return f.values[o]=i(f),1},update(f,u){if(a&&u.docChanged||c&&(u.docChanged||u.selection)||xs(f,h)){let d=i(f);if(l?!_r(d,f.values[o],n):!n(d,f.values[o]))return f.values[o]=d,1}return 0},reconfigure:(f,u)=>{let d,p=u.config.address[r];if(p!=null){let g=bn(u,p);if(this.dependencies.every(m=>m instanceof T?u.facet(m)===f.facet(m):m instanceof yt?u.field(m,!1)==f.field(m,!1):!0)||(l?_r(d=i(f),g,n):n(d=i(f),g)))return f.values[o]=g,0}else d=i(f);return f.values[o]=d,1}}}}function _r(s,t,e){if(s.length!=t.length)return!1;for(let i=0;is[a.id]),n=e.map(a=>a.type),r=i.filter(a=>!(a&1)),o=s[t.id]>>1;function l(a){let c=[];for(let h=0;hi===n),t);return t.provide&&(e.provides=t.provide(e)),e}create(t){let e=t.facet(Qr).find(i=>i.field==this);return((e==null?void 0:e.create)||this.createF)(t)}slot(t){let e=t[this.id]>>1;return{create:i=>(i.values[e]=this.create(i),1),update:(i,n)=>{let r=i.values[e],o=this.updateF(r,n);return this.compareF(r,o)?0:(i.values[e]=o,1)},reconfigure:(i,n)=>n.config.address[this.id]!=null?(i.values[e]=n.field(this),0):(i.values[e]=this.create(i),1)}}init(t){return[this,Qr.of({field:this,create:t})]}get extension(){return this}}const Se={lowest:4,low:3,default:2,high:1,highest:0};function oi(s){return t=>new Wl(t,s)}const ye={highest:oi(Se.highest),high:oi(Se.high),default:oi(Se.default),low:oi(Se.low),lowest:oi(Se.lowest)};class Wl{constructor(t,e){this.inner=t,this.prec=e}}class Hn{of(t){return new ws(this,t)}reconfigure(t){return Hn.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class ws{constructor(t,e){this.compartment=t,this.inner=e}}class yn{constructor(t,e,i,n,r,o){for(this.base=t,this.compartments=e,this.dynamicSlots=i,this.address=n,this.staticValues=r,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(t,e,i){let n=[],r=Object.create(null),o=new Map;for(let u of Tc(t,e,o))u instanceof yt?n.push(u):(r[u.facet.id]||(r[u.facet.id]=[])).push(u);let l=Object.create(null),a=[],c=[];for(let u of n)l[u.id]=c.length<<1,c.push(d=>u.slot(d));let h=i==null?void 0:i.config.facets;for(let u in r){let d=r[u],p=d[0].facet,g=h&&h[u]||[];if(d.every(m=>m.type==0))if(l[p.id]=a.length<<1|1,dr(g,d))a.push(i.facet(p));else{let m=p.combine(d.map(y=>y.value));a.push(i&&p.compare(m,i.facet(p))?i.facet(p):m)}else{for(let m of d)m.type==0?(l[m.id]=a.length<<1|1,a.push(m.value)):(l[m.id]=c.length<<1,c.push(y=>m.dynamicSlot(y)));l[p.id]=c.length<<1,c.push(m=>Oc(m,p,d))}}let f=c.map(u=>u(l));return new yn(t,o,f,l,a,r)}}function Tc(s,t,e){let i=[[],[],[],[],[]],n=new Map;function r(o,l){let a=n.get(o);if(a!=null){if(a<=l)return;let c=i[a].indexOf(o);c>-1&&i[a].splice(c,1),o instanceof ws&&e.delete(o.compartment)}if(n.set(o,l),Array.isArray(o))for(let c of o)r(c,l);else if(o instanceof ws){if(e.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=t.get(o.compartment)||o.inner;e.set(o.compartment,c),r(c,l)}else if(o instanceof Wl)r(o.inner,o.prec);else if(o instanceof yt)i[l].push(o),o.provides&&r(o.provides,l);else if(o instanceof cn)i[l].push(o),o.facet.extensions&&r(o.facet.extensions,Se.default);else{let c=o.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);r(c,l)}}return r(s,Se.default),i.reduce((o,l)=>o.concat(l))}function bi(s,t){if(t&1)return 2;let e=t>>1,i=s.status[e];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;s.status[e]=4;let n=s.computeSlot(s,s.config.dynamicSlots[e]);return s.status[e]=2|n}function bn(s,t){return t&1?s.config.staticValues[t>>1]:s.values[t>>1]}const zl=T.define(),Ss=T.define({combine:s=>s.some(t=>t),static:!0}),ql=T.define({combine:s=>s.length?s[0]:void 0,static:!0}),Kl=T.define(),$l=T.define(),jl=T.define(),Ul=T.define({combine:s=>s.length?s[0]:!1});class re{constructor(t,e){this.type=t,this.value=e}static define(){return new Bc}}class Bc{of(t){return new re(this,t)}}class Pc{constructor(t){this.map=t}of(t){return new N(this,t)}}class N{constructor(t,e){this.type=t,this.value=e}map(t){let e=this.type.map(this.value,t);return e===void 0?void 0:e==this.value?this:new N(this.type,e)}is(t){return this.type==t}static define(t={}){return new Pc(t.map||(e=>e))}static mapEffects(t,e){if(!t.length)return t;let i=[];for(let n of t){let r=n.map(e);r&&i.push(r)}return i}}N.reconfigure=N.define();N.appendConfig=N.define();class Z{constructor(t,e,i,n,r,o){this.startState=t,this.changes=e,this.selection=i,this.effects=n,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,i&&Hl(i,e.newLength),r.some(l=>l.type==Z.time)||(this.annotations=r.concat(Z.time.of(Date.now())))}static create(t,e,i,n,r,o){return new Z(t,e,i,n,r,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(t){for(let e of this.annotations)if(e.type==t)return e.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let e=this.annotation(Z.userEvent);return!!(e&&(e==t||e.length>t.length&&e.slice(0,t.length)==t&&e[t.length]=="."))}}Z.time=re.define();Z.userEvent=re.define();Z.addToHistory=re.define();Z.remote=re.define();function Rc(s,t){let e=[];for(let i=0,n=0;;){let r,o;if(i=s[i]))r=s[i++],o=s[i++];else if(n=0;n--){let r=i[n](s);r instanceof Z?s=r:Array.isArray(r)&&r.length==1&&r[0]instanceof Z?s=r[0]:s=Jl(t,qe(r),!1)}return s}function Ec(s){let t=s.startState,e=t.facet(jl),i=s;for(let n=e.length-1;n>=0;n--){let r=e[n](s);r&&Object.keys(r).length&&(i=Gl(i,ks(t,r,s.changes.newLength),!0))}return i==s?s:Z.create(t,s.changes,s.selection,i.effects,i.annotations,i.scrollIntoView)}const Ic=[];function qe(s){return s==null?Ic:Array.isArray(s)?s:[s]}var J=function(s){return s[s.Word=0]="Word",s[s.Space=1]="Space",s[s.Other=2]="Other",s}(J||(J={}));const Nc=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let vs;try{vs=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function Fc(s){if(vs)return vs.test(s);for(let t=0;t"€"&&(e.toUpperCase()!=e.toLowerCase()||Nc.test(e)))return!0}return!1}function Vc(s){return t=>{if(!/\S/.test(t))return J.Space;if(Fc(t))return J.Word;for(let e=0;e-1)return J.Word;return J.Other}}class H{constructor(t,e,i,n,r,o){this.config=t,this.doc=e,this.selection=i,this.values=n,this.status=t.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let l=0;ln.set(c,a)),e=null),n.set(l.value.compartment,l.value.extension)):l.is(N.reconfigure)?(e=null,i=l.value):l.is(N.appendConfig)&&(e=null,i=qe(i).concat(l.value));let r;e?r=t.startState.values.slice():(e=yn.resolve(i,n,this),r=new H(e,this.doc,this.selection,e.dynamicSlots.map(()=>null),(a,c)=>c.reconfigure(a,this),null).values);let o=t.startState.facet(Ss)?t.newSelection:t.newSelection.asSingle();new H(e,t.newDoc,o,r,(l,a)=>a.update(l,t),t)}replaceSelection(t){return typeof t=="string"&&(t=this.toText(t)),this.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:t},range:b.cursor(e.from+t.length)}))}changeByRange(t){let e=this.selection,i=t(e.ranges[0]),n=this.changes(i.changes),r=[i.range],o=qe(i.effects);for(let l=1;lo.spec.fromJSON(l,a)))}}return H.create({doc:t.doc,selection:b.fromJSON(t.selection),extensions:e.extensions?n.concat([e.extensions]):n})}static create(t={}){let e=yn.resolve(t.extensions||[],new Map),i=t.doc instanceof F?t.doc:F.of((t.doc||"").split(e.staticFacet(H.lineSeparator)||ms)),n=t.selection?t.selection instanceof b?t.selection:b.single(t.selection.anchor,t.selection.head):b.single(0);return Hl(n,i.length),e.staticFacet(Ss)||(n=n.asSingle()),new H(e,i,n,e.dynamicSlots.map(()=>null),(r,o)=>o.create(r),null)}get tabSize(){return this.facet(H.tabSize)}get lineBreak(){return this.facet(H.lineSeparator)||` -`}get readOnly(){return this.facet(Ul)}phrase(t,...e){for(let i of this.facet(H.phrases))if(Object.prototype.hasOwnProperty.call(i,t)){t=i[t];break}return e.length&&(t=t.replace(/\$(\$|\d*)/g,(i,n)=>{if(n=="$")return"$";let r=+(n||1);return!r||r>e.length?i:e[r-1]})),t}languageDataAt(t,e,i=-1){let n=[];for(let r of this.facet(zl))for(let o of r(this,e,i))Object.prototype.hasOwnProperty.call(o,t)&&n.push(o[t]);return n}charCategorizer(t){return Vc(this.languageDataAt("wordChars",t).join(""))}wordAt(t){let{text:e,from:i,length:n}=this.doc.lineAt(t),r=this.charCategorizer(t),o=t-i,l=t-i;for(;o>0;){let a=ot(e,o,!1);if(r(e.slice(a,o))!=J.Word)break;o=a}for(;ls.length?s[0]:4});H.lineSeparator=ql;H.readOnly=Ul;H.phrases=T.define({compare(s,t){let e=Object.keys(s),i=Object.keys(t);return e.length==i.length&&e.every(n=>s[n]==t[n])}});H.languageData=zl;H.changeFilter=Kl;H.transactionFilter=$l;H.transactionExtender=jl;Hn.reconfigure=N.define();function Ee(s,t,e={}){let i={};for(let n of s)for(let r of Object.keys(n)){let o=n[r],l=i[r];if(l===void 0)i[r]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(e,r))i[r]=e[r](l,o);else throw new Error("Config merge conflict for field "+r)}for(let n in t)i[n]===void 0&&(i[n]=t[n]);return i}class De{eq(t){return this==t}range(t,e=t){return Cs.create(t,e,this)}}De.prototype.startSide=De.prototype.endSide=0;De.prototype.point=!1;De.prototype.mapMode=ht.TrackDel;let Cs=class Yl{constructor(t,e,i){this.from=t,this.to=e,this.value=i}static create(t,e,i){return new Yl(t,e,i)}};function As(s,t){return s.from-t.from||s.value.startSide-t.value.startSide}class pr{constructor(t,e,i,n){this.from=t,this.to=e,this.value=i,this.maxPoint=n}get length(){return this.to[this.to.length-1]}findIndex(t,e,i,n=0){let r=i?this.to:this.from;for(let o=n,l=r.length;;){if(o==l)return o;let a=o+l>>1,c=r[a]-t||(i?this.value[a].endSide:this.value[a].startSide)-e;if(a==o)return c>=0?o:l;c>=0?l=a:o=a+1}}between(t,e,i,n){for(let r=this.findIndex(e,-1e9,!0),o=this.findIndex(i,1e9,!1,r);rd||u==d&&c.startSide>0&&c.endSide<=0)continue;(d-u||c.endSide-c.startSide)<0||(o<0&&(o=u),c.point&&(l=Math.max(l,d-u)),i.push(c),n.push(u-o),r.push(d-o))}return{mapped:i.length?new pr(n,r,i,l):null,pos:o}}}class K{constructor(t,e,i,n){this.chunkPos=t,this.chunk=e,this.nextLayer=i,this.maxPoint=n}static create(t,e,i,n){return new K(t,e,i,n)}get length(){let t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let t=this.nextLayer.size;for(let e of this.chunk)t+=e.value.length;return t}chunkEnd(t){return this.chunkPos[t]+this.chunk[t].length}update(t){let{add:e=[],sort:i=!1,filterFrom:n=0,filterTo:r=this.length}=t,o=t.filter;if(e.length==0&&!o)return this;if(i&&(e=e.slice().sort(As)),this.isEmpty)return e.length?K.of(e):this;let l=new Xl(this,null,-1).goto(0),a=0,c=[],h=new Oe;for(;l.value||a=0){let f=e[a++];h.addInner(f.from,f.to,f.value)||c.push(f)}else l.rangeIndex==1&&l.chunkIndexthis.chunkEnd(l.chunkIndex)||rl.to||r=r&&t<=r+o.length&&o.between(r,t-r,e-r,i)===!1)return}this.nextLayer.between(t,e,i)}}iter(t=0){return ki.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,e=0){return ki.from(t).goto(e)}static compare(t,e,i,n,r=-1){let o=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),l=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),a=Zr(o,l,i),c=new li(o,a,r),h=new li(l,a,r);i.iterGaps((f,u,d)=>to(c,f,h,u,d,n)),i.empty&&i.length==0&&to(c,0,h,0,0,n)}static eq(t,e,i=0,n){n==null&&(n=999999999);let r=t.filter(h=>!h.isEmpty&&e.indexOf(h)<0),o=e.filter(h=>!h.isEmpty&&t.indexOf(h)<0);if(r.length!=o.length)return!1;if(!r.length)return!0;let l=Zr(r,o),a=new li(r,l,0).goto(i),c=new li(o,l,0).goto(i);for(;;){if(a.to!=c.to||!Ms(a.active,c.active)||a.point&&(!c.point||!a.point.eq(c.point)))return!1;if(a.to>n)return!0;a.next(),c.next()}}static spans(t,e,i,n,r=-1){let o=new li(t,null,r).goto(e),l=e,a=o.openStart;for(;;){let c=Math.min(o.to,i);if(o.point){let h=o.activeForPoint(o.to),f=o.pointFroml&&(n.span(l,c,o.active,a),a=o.openEnd(c));if(o.to>i)return a+(o.point&&o.to>i?1:0);l=o.to,o.next()}}static of(t,e=!1){let i=new Oe;for(let n of t instanceof Cs?[t]:e?Hc(t):t)i.add(n.from,n.to,n.value);return i.finish()}static join(t){if(!t.length)return K.empty;let e=t[t.length-1];for(let i=t.length-2;i>=0;i--)for(let n=t[i];n!=K.empty;n=n.nextLayer)e=new K(n.chunkPos,n.chunk,e,Math.max(n.maxPoint,e.maxPoint));return e}}K.empty=new K([],[],null,-1);function Hc(s){if(s.length>1)for(let t=s[0],e=1;e0)return s.slice().sort(As);t=i}return s}K.empty.nextLayer=K.empty;class Oe{finishChunk(t){this.chunks.push(new pr(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,t&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(t,e,i){this.addInner(t,e,i)||(this.nextLayer||(this.nextLayer=new Oe)).add(t,e,i)}addInner(t,e,i){let n=t-this.lastTo||i.startSide-this.last.endSide;if(n<=0&&(t-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return n<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(e-this.chunkStart),this.last=i,this.lastFrom=t,this.lastTo=e,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,e-t)),!0)}addChunk(t,e){if((t-this.lastTo||e.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,e.maxPoint),this.chunks.push(e),this.chunkPos.push(t);let i=e.value.length-1;return this.last=e.value[i],this.lastFrom=e.from[i]+t,this.lastTo=e.to[i]+t,!0}finish(){return this.finishInner(K.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return t;let e=K.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,e}}function Zr(s,t,e){let i=new Map;for(let r of s)for(let o=0;o=this.minPoint)break}}setRangeIndex(t){if(t==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=i&&n.push(new Xl(o,e,i,r));return n.length==1?n[0]:new ki(n)}get startSide(){return this.value?this.value.startSide:0}goto(t,e=-1e9){for(let i of this.heap)i.goto(t,e);for(let i=this.heap.length>>1;i>=0;i--)Xn(this.heap,i);return this.next(),this}forward(t,e){for(let i of this.heap)i.forward(t,e);for(let i=this.heap.length>>1;i>=0;i--)Xn(this.heap,i);(this.to-t||this.value.endSide-e)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let t=this.heap[0];this.from=t.from,this.to=t.to,this.value=t.value,this.rank=t.rank,t.value&&t.next(),Xn(this.heap,0)}}}function Xn(s,t){for(let e=s[t];;){let i=(t<<1)+1;if(i>=s.length)break;let n=s[i];if(i+1=0&&(n=s[i+1],i++),e.compare(n)<0)break;s[i]=e,s[t]=n,t=i}}class li{constructor(t,e,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=ki.from(t,e,i)}goto(t,e=-1e9){return this.cursor.goto(t,e),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=e,this.openStart=-1,this.next(),this}forward(t,e){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-e)<0;)this.removeActive(this.minActive);this.cursor.forward(t,e)}removeActive(t){qi(this.active,t),qi(this.activeTo,t),qi(this.activeRank,t),this.minActive=eo(this.active,this.activeTo)}addActive(t){let e=0,{value:i,to:n,rank:r}=this.cursor;for(;e0;)e++;Ki(this.active,e,i),Ki(this.activeTo,e,n),Ki(this.activeRank,e,r),t&&Ki(t,e,this.cursor.from),this.minActive=eo(this.active,this.activeTo)}next(){let t=this.to,e=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let n=this.minActive;if(n>-1&&(this.activeTo[n]-this.cursor.from||this.active[n].endSide-this.cursor.startSide)<0){if(this.activeTo[n]>t){this.to=this.activeTo[n],this.endSide=this.active[n].endSide;break}this.removeActive(n),i&&qi(i,n)}else if(this.cursor.value)if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let r=this.cursor.value;if(!r.point)this.addActive(i),this.cursor.next();else if(e&&this.cursor.to==this.to&&this.cursor.from=0&&i[n]=0&&!(this.activeRank[i]t||this.activeTo[i]==t&&this.active[i].endSide>=this.point.endSide)&&e.push(this.active[i]);return e.reverse()}openEnd(t){let e=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>t;i--)e++;return e}}function to(s,t,e,i,n,r){s.goto(t),e.goto(i);let o=i+n,l=i,a=i-t;for(;;){let c=s.to+a-e.to||s.endSide-e.endSide,h=c<0?s.to+a:e.to,f=Math.min(h,o);if(s.point||e.point?s.point&&e.point&&(s.point==e.point||s.point.eq(e.point))&&Ms(s.activeForPoint(s.to),e.activeForPoint(e.to))||r.comparePoint(l,f,s.point,e.point):f>l&&!Ms(s.active,e.active)&&r.compareRange(l,f,s.active,e.active),h>o)break;l=h,c<=0&&s.next(),c>=0&&e.next()}}function Ms(s,t){if(s.length!=t.length)return!1;for(let e=0;e=t;i--)s[i+1]=s[i];s[t]=e}function eo(s,t){let e=-1,i=1e9;for(let n=0;n=t)return n;if(n==s.length)break;r+=s.charCodeAt(n)==9?e-r%e:1,n=ot(s,n)}return i===!0?-1:s.length}const Os="ͼ",io=typeof Symbol>"u"?"__"+Os:Symbol.for(Os),Ts=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),no=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class de{constructor(t,e){this.rules=[];let{finish:i}=e||{};function n(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function r(o,l,a,c){let h=[],f=/^@(\w+)\b/.exec(o[0]),u=f&&f[1]=="keyframes";if(f&&l==null)return a.push(o[0]+";");for(let d in l){let p=l[d];if(/&/.test(d))r(d.split(/,\s*/).map(g=>o.map(m=>g.replace(/&/,m))).reduce((g,m)=>g.concat(m)),p,a);else if(p&&typeof p=="object"){if(!f)throw new RangeError("The value of a property ("+d+") should be a primitive value.");r(n(d),p,h,u)}else p!=null&&h.push(d.replace(/_.*/,"").replace(/[A-Z]/g,g=>"-"+g.toLowerCase())+": "+p+";")}(h.length||u)&&a.push((i&&!f&&!c?o.map(i):o).join(", ")+" {"+h.join(" ")+"}")}for(let o in t)r(n(o),t[o],this.rules)}getRules(){return this.rules.join(` -`)}static newName(){let t=no[io]||1;return no[io]=t+1,Os+t.toString(36)}static mount(t,e,i){let n=t[Ts],r=i&&i.nonce;n?r&&n.setNonce(r):n=new Wc(t,r),n.mount(Array.isArray(e)?e:[e],t)}}let so=new Map;class Wc{constructor(t,e){let i=t.ownerDocument||t,n=i.defaultView;if(!t.head&&t.adoptedStyleSheets&&n.CSSStyleSheet){let r=so.get(i);if(r)return t[Ts]=r;this.sheet=new n.CSSStyleSheet,so.set(i,this)}else this.styleTag=i.createElement("style"),e&&this.styleTag.setAttribute("nonce",e);this.modules=[],t[Ts]=this}mount(t,e){let i=this.sheet,n=0,r=0;for(let o=0;o-1&&(this.modules.splice(a,1),r--,a=-1),a==-1){if(this.modules.splice(r++,0,l),i)for(let c=0;c",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},zc=typeof navigator<"u"&&/Mac/.test(navigator.platform),qc=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var rt=0;rt<10;rt++)pe[48+rt]=pe[96+rt]=String(rt);for(var rt=1;rt<=24;rt++)pe[rt+111]="F"+rt;for(var rt=65;rt<=90;rt++)pe[rt]=String.fromCharCode(rt+32),vi[rt]=String.fromCharCode(rt);for(var _n in pe)vi.hasOwnProperty(_n)||(vi[_n]=pe[_n]);function Kc(s){var t=zc&&s.metaKey&&s.shiftKey&&!s.ctrlKey&&!s.altKey||qc&&s.shiftKey&&s.key&&s.key.length==1||s.key=="Unidentified",e=!t&&s.key||(s.shiftKey?vi:pe)[s.keyCode]||s.key||"Unidentified";return e=="Esc"&&(e="Escape"),e=="Del"&&(e="Delete"),e=="Left"&&(e="ArrowLeft"),e=="Up"&&(e="ArrowUp"),e=="Right"&&(e="ArrowRight"),e=="Down"&&(e="ArrowDown"),e}function Ci(s){let t;return s.nodeType==11?t=s.getSelection?s:s.ownerDocument:t=s,t.getSelection()}function Bs(s,t){return t?s==t||s.contains(t.nodeType!=1?t.parentNode:t):!1}function fn(s,t){if(!t.anchorNode)return!1;try{return Bs(s,t.anchorNode)}catch{return!1}}function Je(s){return s.nodeType==3?Be(s,0,s.nodeValue.length).getClientRects():s.nodeType==1?s.getClientRects():[]}function xi(s,t,e,i){return e?ro(s,t,e,i,-1)||ro(s,t,e,i,1):!1}function Te(s){for(var t=0;;t++)if(s=s.previousSibling,!s)return t}function xn(s){return s.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(s.nodeName)}function ro(s,t,e,i,n){for(;;){if(s==e&&t==i)return!0;if(t==(n<0?0:Zt(s))){if(s.nodeName=="DIV")return!1;let r=s.parentNode;if(!r||r.nodeType!=1)return!1;t=Te(s)+(n<0?0:1),s=r}else if(s.nodeType==1){if(s=s.childNodes[t+(n<0?-1:0)],s.nodeType==1&&s.contentEditable=="false")return!1;t=n<0?Zt(s):0}else return!1}}function Zt(s){return s.nodeType==3?s.nodeValue.length:s.childNodes.length}function Ei(s,t){let e=t?s.left:s.right;return{left:e,right:e,top:s.top,bottom:s.bottom}}function $c(s){let t=s.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:s.innerWidth,top:0,bottom:s.innerHeight}}function _l(s,t){let e=t.width/s.offsetWidth,i=t.height/s.offsetHeight;return(e>.995&&e<1.005||!isFinite(e)||Math.abs(t.width-s.offsetWidth)<1)&&(e=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(t.height-s.offsetHeight)<1)&&(i=1),{scaleX:e,scaleY:i}}function jc(s,t,e,i,n,r,o,l){let a=s.ownerDocument,c=a.defaultView||window;for(let h=s,f=!1;h&&!f;)if(h.nodeType==1){let u,d=h==a.body,p=1,g=1;if(d)u=$c(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(h).position)&&(f=!0),h.scrollHeight<=h.clientHeight&&h.scrollWidth<=h.clientWidth){h=h.assignedSlot||h.parentNode;continue}let x=h.getBoundingClientRect();({scaleX:p,scaleY:g}=_l(h,x)),u={left:x.left,right:x.left+h.clientWidth*p,top:x.top,bottom:x.top+h.clientHeight*g}}let m=0,y=0;if(n=="nearest")t.top0&&t.bottom>u.bottom+y&&(y=t.bottom-u.bottom+y+o)):t.bottom>u.bottom&&(y=t.bottom-u.bottom+o,e<0&&t.top-y0&&t.right>u.right+m&&(m=t.right-u.right+m+r)):t.right>u.right&&(m=t.right-u.right+r,e<0&&t.leftn.clientHeight&&(i=n),!e&&n.scrollWidth>n.clientWidth&&(e=n),n=n.assignedSlot||n.parentNode;else if(n.nodeType==11)n=n.host;else break;return{x:e,y:i}}class Gc{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}setRange(t){let{anchorNode:e,focusNode:i}=t;this.set(e,Math.min(t.anchorOffset,e?Zt(e):0),i,Math.min(t.focusOffset,i?Zt(i):0))}set(t,e,i,n){this.anchorNode=t,this.anchorOffset=e,this.focusNode=i,this.focusOffset=n}}let Fe=null;function Ql(s){if(s.setActive)return s.setActive();if(Fe)return s.focus(Fe);let t=[];for(let e=s;e&&(t.push(e,e.scrollTop,e.scrollLeft),e!=e.ownerDocument);e=e.parentNode);if(s.focus(Fe==null?{get preventScroll(){return Fe={preventScroll:!0},!0}}:void 0),!Fe){Fe=!1;for(let e=0;eMath.max(1,s.scrollHeight-s.clientHeight-4)}function ea(s,t){for(let e=s,i=t;;){if(e.nodeType==3&&i>0)return{node:e,offset:i};if(e.nodeType==1&&i>0){if(e.contentEditable=="false")return null;e=e.childNodes[i-1],i=Zt(e)}else if(e.parentNode&&!xn(e))i=Te(e),e=e.parentNode;else return null}}function ia(s,t){for(let e=s,i=t;;){if(e.nodeType==3&&ie)return f.domBoundsAround(t,e,c);if(u>=t&&n==-1&&(n=a,r=c),c>e&&f.dom.parentNode==this.dom){o=a,l=h;break}h=u,c=u+f.breakAfter}return{from:r,to:l<0?i+this.length:l,startDOM:(n?this.children[n-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o=0?this.children[o].dom:null}}markDirty(t=!1){this.flags|=2,this.markParentsDirty(t)}markParentsDirty(t){for(let e=this.parent;e;e=e.parent){if(t&&(e.flags|=2),e.flags&1)return;e.flags|=1,t=!1}}setParent(t){this.parent!=t&&(this.parent=t,this.flags&7&&this.markParentsDirty(!0))}setDOM(t){this.dom!=t&&(this.dom&&(this.dom.cmView=null),this.dom=t,t.cmView=this)}get rootView(){for(let t=this;;){let e=t.parent;if(!e)return t;t=e}}replaceChildren(t,e,i=gr){this.markDirty();for(let n=t;nthis.pos||t==this.pos&&(e>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=t-this.pos,this;let i=this.children[--this.i];this.pos-=i.length+i.breakAfter}}}function sa(s,t,e,i,n,r,o,l,a){let{children:c}=s,h=c.length?c[t]:null,f=r.length?r[r.length-1]:null,u=f?f.breakAfter:o;if(!(t==i&&h&&!o&&!u&&r.length<2&&h.merge(e,n,r.length?f:null,e==0,l,a))){if(i0&&(!o&&r.length&&h.merge(e,h.length,r[0],!1,l,0)?h.breakAfter=r.shift().breakAfter:(e2);var D={mac:co||/Mac/.test(bt.platform),windows:/Win/.test(bt.platform),linux:/Linux|X11/.test(bt.platform),ie:Wn,ie_version:oa?Ps.documentMode||6:Ls?+Ls[1]:Rs?+Rs[1]:0,gecko:ao,gecko_version:ao?+(/Firefox\/(\d+)/.exec(bt.userAgent)||[0,0])[1]:0,chrome:!!Qn,chrome_version:Qn?+Qn[1]:0,ios:co,android:/Android\b/.test(bt.userAgent),webkit:ho,safari:la,webkit_version:ho?+(/\bAppleWebKit\/(\d+)/.exec(bt.userAgent)||[0,0])[1]:0,tabSize:Ps.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const Xc=256;class Vt extends ${constructor(t){super(),this.text=t}get length(){return this.text.length}createDOM(t){this.setDOM(t||document.createTextNode(this.text))}sync(t,e){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text)}reuseDOM(t){t.nodeType==3&&this.createDOM(t)}merge(t,e,i){return this.flags&8||i&&(!(i instanceof Vt)||this.length-(e-t)+i.length>Xc||i.flags&8)?!1:(this.text=this.text.slice(0,t)+(i?i.text:"")+this.text.slice(e),this.markDirty(),!0)}split(t){let e=new Vt(this.text.slice(t));return this.text=this.text.slice(0,t),this.markDirty(),e.flags|=this.flags&8,e}localPosFromDOM(t,e){return t==this.dom?e:e?this.text.length:0}domAtPos(t){return new ct(this.dom,t)}domBoundsAround(t,e,i){return{from:i,to:i+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(t,e){return _c(this.dom,t,e)}}class se extends ${constructor(t,e=[],i=0){super(),this.mark=t,this.children=e,this.length=i;for(let n of e)n.setParent(this)}setAttrs(t){if(Zl(t),this.mark.class&&(t.className=this.mark.class),this.mark.attrs)for(let e in this.mark.attrs)t.setAttribute(e,this.mark.attrs[e]);return t}canReuseDOM(t){return super.canReuseDOM(t)&&!((this.flags|t.flags)&8)}reuseDOM(t){t.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(t),this.flags|=6)}sync(t,e){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(t,e)}merge(t,e,i,n,r,o){return i&&(!(i instanceof se&&i.mark.eq(this.mark))||t&&r<=0||et&&e.push(i=t&&(n=r),i=a,r++}let o=this.length-t;return this.length=t,n>-1&&(this.children.length=n,this.markDirty()),new se(this.mark,e,o)}domAtPos(t){return aa(this,t)}coordsAt(t,e){return ca(this,t,e)}}function _c(s,t,e){let i=s.nodeValue.length;t>i&&(t=i);let n=t,r=t,o=0;t==0&&e<0||t==i&&e>=0?D.chrome||D.gecko||(t?(n--,o=1):r=0)?0:l.length-1];return D.safari&&!o&&a.width==0&&(a=Array.prototype.find.call(l,c=>c.width)||a),o?Ei(a,o<0):a||null}class ve extends ${static create(t,e,i){return new ve(t,e,i)}constructor(t,e,i){super(),this.widget=t,this.length=e,this.side=i,this.prevWidget=null}split(t){let e=ve.create(this.widget,this.length-t,this.side);return this.length-=t,e}sync(t){(!this.dom||!this.widget.updateDOM(this.dom,t))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(t)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(t,e,i,n,r,o){return i&&(!(i instanceof ve)||!this.widget.compare(i.widget)||t>0&&r<=0||e0)?ct.before(this.dom):ct.after(this.dom,t==this.length)}domBoundsAround(){return null}coordsAt(t,e){let i=this.widget.coordsAt(this.dom,t,e);if(i)return i;let n=this.dom.getClientRects(),r=null;if(!n.length)return null;let o=this.side?this.side<0:t>0;for(let l=o?n.length-1:0;r=n[l],!(t>0?l==0:l==n.length-1||r.top0?ct.before(this.dom):ct.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(t){return this.dom.getBoundingClientRect()}get overrideDOMText(){return F.empty}get isHidden(){return!0}}Vt.prototype.children=ve.prototype.children=Ye.prototype.children=gr;function aa(s,t){let e=s.dom,{children:i}=s,n=0;for(let r=0;nr&&t0;r--){let o=i[r-1];if(o.dom.parentNode==e)return o.domAtPos(o.length)}for(let r=n;r0&&t instanceof se&&n.length&&(i=n[n.length-1])instanceof se&&i.mark.eq(t.mark)?ha(i,t.children[0],e-1):(n.push(t),t.setParent(s)),s.length+=t.length}function ca(s,t,e){let i=null,n=-1,r=null,o=-1;function l(c,h){for(let f=0,u=0;f=h&&(d.children.length?l(d,h-u):(!r||r.isHidden&&e>0)&&(p>h||u==p&&d.getSide()>0)?(r=d,o=h-u):(u-1?1:0)!=n.length-(e&&n.indexOf(e)>-1?1:0))return!1;for(let r of i)if(r!=e&&(n.indexOf(r)==-1||s[r]!==t[r]))return!1;return!0}function Is(s,t,e){let i=!1;if(t)for(let n in t)e&&n in e||(i=!0,n=="style"?s.style.cssText="":s.removeAttribute(n));if(e)for(let n in e)t&&t[n]==e[n]||(i=!0,n=="style"?s.style.cssText=e[n]:s.setAttribute(n,e[n]));return i}function Zc(s){let t=Object.create(null);for(let e=0;e0?3e8:-4e8:e>0?1e8:-1e8,new ge(t,e,e,i,t.widget||null,!1)}static replace(t){let e=!!t.block,i,n;if(t.isBlockGap)i=-5e8,n=4e8;else{let{start:r,end:o}=fa(t,e);i=(r?e?-3e8:-1:5e8)-1,n=(o?e?2e8:1:-6e8)+1}return new ge(t,i,n,e,t.widget||null,!0)}static line(t){return new Ni(t)}static set(t,e=!1){return K.of(t,e)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}P.none=K.empty;class Ii extends P{constructor(t){let{start:e,end:i}=fa(t);super(e?-1:5e8,i?1:-6e8,null,t),this.tagName=t.tagName||"span",this.class=t.class||"",this.attrs=t.attributes||null}eq(t){var e,i;return this==t||t instanceof Ii&&this.tagName==t.tagName&&(this.class||((e=this.attrs)===null||e===void 0?void 0:e.class))==(t.class||((i=t.attrs)===null||i===void 0?void 0:i.class))&&wn(this.attrs,t.attrs,"class")}range(t,e=t){if(t>=e)throw new RangeError("Mark decorations may not be empty");return super.range(t,e)}}Ii.prototype.point=!1;class Ni extends P{constructor(t){super(-2e8,-2e8,null,t)}eq(t){return t instanceof Ni&&this.spec.class==t.spec.class&&wn(this.spec.attributes,t.spec.attributes)}range(t,e=t){if(e!=t)throw new RangeError("Line decoration ranges must be zero-length");return super.range(t,e)}}Ni.prototype.mapMode=ht.TrackBefore;Ni.prototype.point=!0;class ge extends P{constructor(t,e,i,n,r,o){super(e,i,r,t),this.block=n,this.isReplace=o,this.mapMode=n?e<=0?ht.TrackBefore:ht.TrackAfter:ht.TrackDel}get type(){return this.startSide!=this.endSide?Mt.WidgetRange:this.startSide<=0?Mt.WidgetBefore:Mt.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof ge&&tf(this.widget,t.widget)&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(t,e=t){if(this.isReplace&&(t>e||t==e&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&e!=t)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(t,e)}}ge.prototype.point=!0;function fa(s,t=!1){let{inclusiveStart:e,inclusiveEnd:i}=s;return e==null&&(e=s.inclusive),i==null&&(i=s.inclusive),{start:e??t,end:i??t}}function tf(s,t){return s==t||!!(s&&t&&s.compare(t))}function Ns(s,t,e,i=0){let n=e.length-1;n>=0&&e[n]+i>=s?e[n]=Math.max(e[n],t):e.push(s,t)}class Q extends ${constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(t,e,i,n,r,o){if(i){if(!(i instanceof Q))return!1;this.dom||i.transferDOM(this)}return n&&this.setDeco(i?i.attrs:null),ra(this,t,e,i?i.children.slice():[],r,o),!0}split(t){let e=new Q;if(e.breakAfter=this.breakAfter,this.length==0)return e;let{i,off:n}=this.childPos(t);n&&(e.append(this.children[i].split(n),0),this.children[i].merge(n,this.children[i].length,null,!1,0,0),i++);for(let r=i;r0&&this.children[i-1].length==0;)this.children[--i].destroy();return this.children.length=i,this.markDirty(),this.length=t,e}transferDOM(t){this.dom&&(this.markDirty(),t.setDOM(this.dom),t.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(t){wn(this.attrs,t)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=t)}append(t,e){ha(this,t,e)}addLineDeco(t){let e=t.spec.attributes,i=t.spec.class;e&&(this.attrs=Es(e,this.attrs||{})),i&&(this.attrs=Es({class:i},this.attrs||{}))}domAtPos(t){return aa(this,t)}reuseDOM(t){t.nodeName=="DIV"&&(this.setDOM(t),this.flags|=6)}sync(t,e){var i;this.dom?this.flags&4&&(Zl(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(Is(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(t,e);let n=this.dom.lastChild;for(;n&&$.get(n)instanceof se;)n=n.lastChild;if(!n||!this.length||n.nodeName!="BR"&&((i=$.get(n))===null||i===void 0?void 0:i.isEditable)==!1&&(!D.ios||!this.children.some(r=>r instanceof Vt))){let r=document.createElement("BR");r.cmIgnore=!0,this.dom.appendChild(r)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let t=0,e;for(let i of this.children){if(!(i instanceof Vt)||/[^ -~]/.test(i.text))return null;let n=Je(i.dom);if(n.length!=1)return null;t+=n[0].width,e=n[0].height}return t?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:t/this.length,textHeight:e}:null}coordsAt(t,e){let i=ca(this,t,e);if(!this.children.length&&i&&this.parent){let{heightOracle:n}=this.parent.view.viewState,r=i.bottom-i.top;if(Math.abs(r-n.lineHeight)<2&&n.textHeight=e){if(r instanceof Q)return r;if(o>e)break}n=o+r.breakAfter}return null}}class ie extends ${constructor(t,e,i){super(),this.widget=t,this.length=e,this.deco=i,this.breakAfter=0,this.prevWidget=null}merge(t,e,i,n,r,o){return i&&(!(i instanceof ie)||!this.widget.compare(i.widget)||t>0&&r<=0||e0}}class Fs extends Ie{constructor(t){super(),this.height=t}toDOM(){let t=document.createElement("div");return t.className="cm-gap",this.updateDOM(t),t}eq(t){return t.height==this.height}updateDOM(t){return t.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class wi{constructor(t,e,i,n){this.doc=t,this.pos=e,this.end=i,this.disallowBlockEffectsFor=n,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=t.iter(),this.skip=e}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let t=this.content[this.content.length-1];return!(t.breakAfter||t instanceof ie&&t.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new Q),this.atCursorPos=!0),this.curLine}flushBuffer(t=this.bufferMarks){this.pendingBuffer&&(this.curLine.append($i(new Ye(-1),t),t.length),this.pendingBuffer=0)}addBlockWidget(t){this.flushBuffer(),this.curLine=null,this.content.push(t)}finish(t){this.pendingBuffer&&t<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(t&&this.content.length&&this.content[this.content.length-1]instanceof ie)&&this.getLine()}buildText(t,e,i){for(;t>0;){if(this.textOff==this.text.length){let{value:r,lineBreak:o,done:l}=this.cursor.next(this.skip);if(this.skip=0,l)throw new Error("Ran out of text content when drawing inline views");if(o){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,t--;continue}else this.text=r,this.textOff=0}let n=Math.min(this.text.length-this.textOff,t,512);this.flushBuffer(e.slice(e.length-i)),this.getLine().append($i(new Vt(this.text.slice(this.textOff,this.textOff+n)),e),i),this.atCursorPos=!0,this.textOff+=n,t-=n,i=0}}span(t,e,i,n){this.buildText(e-t,i,n),this.pos=e,this.openStart<0&&(this.openStart=n)}point(t,e,i,n,r,o){if(this.disallowBlockEffectsFor[o]&&i instanceof ge){if(i.block)throw new RangeError("Block decorations may not be specified via plugins");if(e>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let l=e-t;if(i instanceof ge)if(i.block)i.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new ie(i.widget||Xe.block,l,i));else{let a=ve.create(i.widget||Xe.inline,l,l?0:i.startSide),c=this.atCursorPos&&!a.isEditable&&r<=n.length&&(t0),h=!a.isEditable&&(tn.length||i.startSide<=0),f=this.getLine();this.pendingBuffer==2&&!c&&!a.isEditable&&(this.pendingBuffer=0),this.flushBuffer(n),c&&(f.append($i(new Ye(1),n),r),r=n.length+Math.max(0,r-n.length)),f.append($i(a,n),r),this.atCursorPos=h,this.pendingBuffer=h?tn.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=n.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(i);l&&(this.textOff+l<=this.text.length?this.textOff+=l:(this.skip+=l-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=e),this.openStart<0&&(this.openStart=r)}static build(t,e,i,n,r){let o=new wi(t,e,i,r);return o.openEnd=K.spans(n,e,i,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}}function $i(s,t){for(let e of t)s=new se(e,[s],s.length);return s}class Xe extends Ie{constructor(t){super(),this.tag=t}eq(t){return t.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(t){return t.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}Xe.inline=new Xe("span");Xe.block=new Xe("div");var X=function(s){return s[s.LTR=0]="LTR",s[s.RTL=1]="RTL",s}(X||(X={}));const Pe=X.LTR,mr=X.RTL;function ua(s){let t=[];for(let e=0;e=e){if(l.level==i)return o;(r<0||(n!=0?n<0?l.frome:t[r].level>l.level))&&(r=o)}}if(r<0)throw new RangeError("Index out of range");return r}}function pa(s,t){if(s.length!=t.length)return!1;for(let e=0;e=0;g-=3)if(Kt[g+1]==-d){let m=Kt[g+2],y=m&2?n:m&4?m&1?r:n:0;y&&(q[f]=q[Kt[g]]=y),l=g;break}}else{if(Kt.length==189)break;Kt[l++]=f,Kt[l++]=u,Kt[l++]=a}else if((p=q[f])==2||p==1){let g=p==n;a=g?0:1;for(let m=l-3;m>=0;m-=3){let y=Kt[m+2];if(y&2)break;if(g)Kt[m+2]|=2;else{if(y&4)break;Kt[m+2]|=4}}}}}function lf(s,t,e,i){for(let n=0,r=i;n<=e.length;n++){let o=n?e[n-1].to:s,l=na;)p==m&&(p=e[--g].from,m=g?e[g-1].to:s),q[--p]=d;a=h}else r=c,a++}}}function Hs(s,t,e,i,n,r,o){let l=i%2?2:1;if(i%2==n%2)for(let a=t,c=0;aa&&o.push(new fe(a,g.from,d));let m=g.direction==Pe!=!(d%2);Ws(s,m?i+1:i,n,g.inner,g.from,g.to,o),a=g.to}p=g.to}else{if(p==e||(h?q[p]!=l:q[p]==l))break;p++}u?Hs(s,a,p,i+1,n,u,o):at;){let h=!0,f=!1;if(!c||a>r[c-1].to){let g=q[a-1];g!=l&&(h=!1,f=g==16)}let u=!h&&l==1?[]:null,d=h?i:i+1,p=a;t:for(;;)if(c&&p==r[c-1].to){if(f)break t;let g=r[--c];if(!h)for(let m=g.from,y=c;;){if(m==t)break t;if(y&&r[y-1].to==m)m=r[--y].from;else{if(q[m-1]==l)break t;break}}if(u)u.push(g);else{g.toq.length;)q[q.length]=256;let i=[],n=t==Pe?0:1;return Ws(s,n,n,e,0,s.length,i),i}function ga(s){return[new fe(0,s,0)]}let ma="";function hf(s,t,e,i,n){var r;let o=i.head-s.from,l=fe.find(t,o,(r=i.bidiLevel)!==null&&r!==void 0?r:-1,i.assoc),a=t[l],c=a.side(n,e);if(o==c){let u=l+=n?1:-1;if(u<0||u>=t.length)return null;a=t[l=u],o=a.side(!n,e),c=a.side(n,e)}let h=ot(s.text,o,a.forward(n,e));(ha.to)&&(h=c),ma=s.text.slice(Math.min(o,h),Math.max(o,h));let f=l==(n?t.length-1:0)?null:t[l+(n?1:-1)];return f&&h==c&&f.level+(n?0:1)s.some(t=>t)}),Ca=T.define({combine:s=>s.some(t=>t)}),Aa=T.define();class $e{constructor(t,e="nearest",i="nearest",n=5,r=5,o=!1){this.range=t,this.y=e,this.x=i,this.yMargin=n,this.xMargin=r,this.isSnapshot=o}map(t){return t.empty?this:new $e(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new $e(b.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const ji=N.define({map:(s,t)=>s.map(t)}),Ma=N.define();function At(s,t,e){let i=s.facet(wa);i.length?i[0](t):window.onerror?window.onerror(String(t),e,void 0,void 0,t):e?console.error(e+":",t):console.error(t)}const ae=T.define({combine:s=>s.length?s[0]:!0});let ff=0;const ui=T.define();class ut{constructor(t,e,i,n,r){this.id=t,this.create=e,this.domEventHandlers=i,this.domEventObservers=n,this.extension=r(this)}static define(t,e){const{eventHandlers:i,eventObservers:n,provide:r,decorations:o}=e||{};return new ut(ff++,t,i,n,l=>{let a=[ui.of(l)];return o&&a.push(Ai.of(c=>{let h=c.plugin(l);return h?o(h):P.none})),r&&a.push(r(l)),a})}static fromClass(t,e){return ut.define(i=>new t(i),e)}}class Zn{constructor(t){this.spec=t,this.mustUpdate=null,this.value=null}update(t){if(this.value){if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(i){if(At(e.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(t)}catch(e){At(t.state,e,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(t){var e;if(!((e=this.value)===null||e===void 0)&&e.destroy)try{this.value.destroy()}catch(i){At(t.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const Da=T.define(),xr=T.define(),Ai=T.define(),Oa=T.define(),wr=T.define(),Ta=T.define();function uo(s,t){let e=s.state.facet(Ta);if(!e.length)return e;let i=e.map(r=>r instanceof Function?r(s):r),n=[];return K.spans(i,t.from,t.to,{point(){},span(r,o,l,a){let c=r-t.from,h=o-t.from,f=n;for(let u=l.length-1;u>=0;u--,a--){let d=l[u].spec.bidiIsolate,p;if(d==null&&(d=cf(t.text,c,h)),a>0&&f.length&&(p=f[f.length-1]).to==c&&p.direction==d)p.to=h,f=p.inner;else{let g={from:c,to:h,direction:d,inner:[]};f.push(g),f=g.inner}}}}),n}const Ba=T.define();function Sr(s){let t=0,e=0,i=0,n=0;for(let r of s.state.facet(Ba)){let o=r(s);o&&(o.left!=null&&(t=Math.max(t,o.left)),o.right!=null&&(e=Math.max(e,o.right)),o.top!=null&&(i=Math.max(i,o.top)),o.bottom!=null&&(n=Math.max(n,o.bottom)))}return{left:t,right:e,top:i,bottom:n}}const di=T.define();class It{constructor(t,e,i,n){this.fromA=t,this.toA=e,this.fromB=i,this.toB=n}join(t){return new It(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(t){let e=t.length,i=this;for(;e>0;e--){let n=t[e-1];if(!(n.fromA>i.toA)){if(n.toAh)break;r+=2}if(!a)return i;new It(a.fromA,a.toA,a.fromB,a.toB).addToSet(i),o=a.toA,l=a.toB}}}class Sn{constructor(t,e,i){this.view=t,this.state=e,this.transactions=i,this.flags=0,this.startState=t.state,this.changes=tt.empty(this.startState.doc.length);for(let r of i)this.changes=this.changes.compose(r.changes);let n=[];this.changes.iterChangedRanges((r,o,l,a)=>n.push(new It(r,o,l,a))),this.changedRanges=n}static create(t,e,i){return new Sn(t,e,i)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(t=>t.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class po extends ${get length(){return this.view.state.doc.length}constructor(t){super(),this.view=t,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=P.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(t.contentDOM),this.children=[new Q],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new It(0,0,0,t.state.doc.length)],0,null)}update(t){var e;let i=t.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:c,toA:h})=>hthis.minWidthTo)?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(t);let n=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((e=this.domChanged)===null||e===void 0)&&e.newSel?n=this.domChanged.newSel.head:!bf(t.changes,this.hasComposition)&&!t.selectionSet&&(n=t.state.selection.main.head));let r=n>-1?df(this.view,t.changes,n):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:c,to:h}=this.hasComposition;i=new It(c,h,t.changes.mapPos(c,-1),t.changes.mapPos(h,1)).addToSet(i.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(D.ie||D.chrome)&&!r&&t&&t.state.doc.lines!=t.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.updateDeco(),a=mf(o,l,t.changes);return i=It.extendWithRanges(i,a),!(this.flags&7)&&i.length==0?!1:(this.updateInner(i,t.startState.doc.length,r),t.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(t,e,i){this.view.viewState.mustMeasureContent=!0,this.updateChildren(t,e,i);let{observer:n}=this.view;n.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let o=D.chrome||D.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,o),this.flags&=-8,o&&(o.written||n.selectionRange.focusNode!=o.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(o=>o.flags&=-9);let r=[];if(this.view.viewport.from||this.view.viewport.to=0?n[o]:null;if(!l)break;let{fromA:a,toA:c,fromB:h,toB:f}=l,u,d,p,g;if(i&&i.range.fromBh){let k=wi.build(this.view.state.doc,h,i.range.fromB,this.decorations,this.dynamicDecorationMap),w=wi.build(this.view.state.doc,i.range.toB,f,this.decorations,this.dynamicDecorationMap);d=k.breakAtStart,p=k.openStart,g=w.openEnd;let v=this.compositionView(i);w.breakAtStart?v.breakAfter=1:w.content.length&&v.merge(v.length,v.length,w.content[0],!1,w.openStart,0)&&(v.breakAfter=w.content[0].breakAfter,w.content.shift()),k.content.length&&v.merge(0,0,k.content[k.content.length-1],!0,0,k.openEnd)&&k.content.pop(),u=k.content.concat(v).concat(w.content)}else({content:u,breakAtStart:d,openStart:p,openEnd:g}=wi.build(this.view.state.doc,h,f,this.decorations,this.dynamicDecorationMap));let{i:m,off:y}=r.findPos(c,1),{i:x,off:S}=r.findPos(a,-1);sa(this,x,S,m,y,u,d,p,g)}i&&this.fixCompositionDOM(i)}updateEditContextFormatting(t){this.editContextFormatting=this.editContextFormatting.map(t.changes);for(let e of t.transactions)for(let i of e.effects)i.is(Ma)&&(this.editContextFormatting=i.value)}compositionView(t){let e=new Vt(t.text.nodeValue);e.flags|=8;for(let{deco:n}of t.marks)e=new se(n,[e],e.length);let i=new Q;return i.append(e,0),i}fixCompositionDOM(t){let e=(r,o)=>{o.flags|=8|(o.children.some(a=>a.flags&7)?1:0),this.markedForComposition.add(o);let l=$.get(r);l&&l!=o&&(l.dom=null),o.setDOM(r)},i=this.childPos(t.range.fromB,1),n=this.children[i.i];e(t.line,n);for(let r=t.marks.length-1;r>=-1;r--)i=n.childPos(i.off,1),n=n.children[i.i],e(r>=0?t.marks[r].node:t.text,n)}updateSelection(t=!1,e=!1){(t||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let i=this.view.root.activeElement,n=i==this.dom,r=!n&&fn(this.dom,this.view.observer.selectionRange)&&!(i&&this.dom.contains(i));if(!(n||e||r))return;let o=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(l.anchor)),c=l.empty?a:this.moveToLine(this.domAtPos(l.head));if(D.gecko&&l.empty&&!this.hasComposition&&uf(a)){let f=document.createTextNode("");this.view.observer.ignore(()=>a.node.insertBefore(f,a.node.childNodes[a.offset]||null)),a=c=new ct(f,0),o=!0}let h=this.view.observer.selectionRange;(o||!h.focusNode||(!xi(a.node,a.offset,h.anchorNode,h.anchorOffset)||!xi(c.node,c.offset,h.focusNode,h.focusOffset))&&!this.suppressWidgetCursorChange(h,l))&&(this.view.observer.ignore(()=>{D.android&&D.chrome&&this.dom.contains(h.focusNode)&&yf(h.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let f=Ci(this.view.root);if(f)if(l.empty){if(D.gecko){let u=pf(a.node,a.offset);if(u&&u!=3){let d=(u==1?ea:ia)(a.node,a.offset);d&&(a=new ct(d.node,d.offset))}}f.collapse(a.node,a.offset),l.bidiLevel!=null&&f.caretBidiLevel!==void 0&&(f.caretBidiLevel=l.bidiLevel)}else if(f.extend){f.collapse(a.node,a.offset);try{f.extend(c.node,c.offset)}catch{}}else{let u=document.createRange();l.anchor>l.head&&([a,c]=[c,a]),u.setEnd(c.node,c.offset),u.setStart(a.node,a.offset),f.removeAllRanges(),f.addRange(u)}r&&this.view.root.activeElement==this.dom&&(this.dom.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(a,c)),this.impreciseAnchor=a.precise?null:new ct(h.anchorNode,h.anchorOffset),this.impreciseHead=c.precise?null:new ct(h.focusNode,h.focusOffset)}suppressWidgetCursorChange(t,e){return this.hasComposition&&e.empty&&xi(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)&&this.posFromDOM(t.focusNode,t.focusOffset)==e.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:t}=this,e=t.state.selection.main,i=Ci(t.root),{anchorNode:n,anchorOffset:r}=t.observer.selectionRange;if(!i||!e.empty||!e.assoc||!i.modify)return;let o=Q.find(this,e.head);if(!o)return;let l=o.posAtStart;if(e.head==l||e.head==l+o.length)return;let a=this.coordsAt(e.head,-1),c=this.coordsAt(e.head,1);if(!a||!c||a.bottom>c.top)return;let h=this.domAtPos(e.head+e.assoc);i.collapse(h.node,h.offset),i.modify("move",e.assoc<0?"forward":"backward","lineboundary"),t.observer.readSelectionRange();let f=t.observer.selectionRange;t.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=e.from&&i.collapse(n,r)}moveToLine(t){let e=this.dom,i;if(t.node!=e)return t;for(let n=t.offset;!i&&n=0;n--){let r=$.get(e.childNodes[n]);r instanceof Q&&(i=r.domAtPos(r.length))}return i?new ct(i.node,i.offset,!0):t}nearest(t){for(let e=t;e;){let i=$.get(e);if(i&&i.rootView==this)return i;e=e.parentNode}return null}posFromDOM(t,e){let i=this.nearest(t);if(!i)throw new RangeError("Trying to find position for a DOM position outside of the document");return i.localPosFromDOM(t,e)+i.posAtStart}domAtPos(t){let{i:e,off:i}=this.childCursor().findPos(t,-1);for(;e=0;o--){let l=this.children[o],a=r-l.breakAfter,c=a-l.length;if(at||l.covers(1))&&(!i||l instanceof Q&&!(i instanceof Q&&e>=0)))i=l,n=c;else if(i&&c==t&&a==t&&l instanceof ie&&Math.abs(e)<2){if(l.deco.startSide<0)break;o&&(i=null)}r=c}return i?i.coordsAt(t-n,e):null}coordsForChar(t){let{i:e,off:i}=this.childPos(t,1),n=this.children[e];if(!(n instanceof Q))return null;for(;n.children.length;){let{i:l,off:a}=n.childPos(i,1);for(;;l++){if(l==n.children.length)return null;if((n=n.children[l]).length)break}i=a}if(!(n instanceof Vt))return null;let r=ot(n.text,i);if(r==i)return null;let o=Be(n.dom,i,r).getClientRects();for(let l=0;lMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==X.LTR;for(let c=0,h=0;hn)break;if(c>=i){let d=f.dom.getBoundingClientRect();if(e.push(d.height),o){let p=f.dom.lastChild,g=p?Je(p):[];if(g.length){let m=g[g.length-1],y=a?m.right-d.left:d.right-m.left;y>l&&(l=y,this.minWidth=r,this.minWidthFrom=c,this.minWidthTo=u)}}}c=u+f.breakAfter}return e}textDirectionAt(t){let{i:e}=this.childPos(t,1);return getComputedStyle(this.children[e].dom).direction=="rtl"?X.RTL:X.LTR}measureTextSize(){for(let r of this.children)if(r instanceof Q){let o=r.measureTextSize();if(o)return o}let t=document.createElement("div"),e,i,n;return t.className="cm-line",t.style.width="99999px",t.style.position="absolute",t.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(t);let r=Je(t.firstChild)[0];e=t.getBoundingClientRect().height,i=r?r.width/27:7,n=r?r.height:e,t.remove()}),{lineHeight:e,charWidth:i,textHeight:n}}childCursor(t=this.length){let e=this.children.length;return e&&(t-=this.children[--e].length),new na(this.children,t,e)}computeBlockGapDeco(){let t=[],e=this.view.viewState;for(let i=0,n=0;;n++){let r=n==e.viewports.length?null:e.viewports[n],o=r?r.from-1:this.length;if(o>i){let l=(e.lineBlockAt(o).bottom-e.lineBlockAt(i).top)/this.view.scaleY;t.push(P.replace({widget:new Fs(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!r)break;i=r.to+1}return P.set(t)}updateDeco(){let t=1,e=this.view.state.facet(Ai).map(r=>(this.dynamicDecorationMap[t++]=typeof r=="function")?r(this.view):r),i=!1,n=this.view.state.facet(Oa).map((r,o)=>{let l=typeof r=="function";return l&&(i=!0),l?r(this.view):r});for(n.length&&(this.dynamicDecorationMap[t++]=i,e.push(K.join(n))),this.decorations=[this.editContextFormatting,...e,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];te.anchor?-1:1),n;if(!i)return;!e.empty&&(n=this.coordsAt(e.anchor,e.anchor>e.head?-1:1))&&(i={left:Math.min(i.left,n.left),top:Math.min(i.top,n.top),right:Math.max(i.right,n.right),bottom:Math.max(i.bottom,n.bottom)});let r=Sr(this.view),o={left:i.left-r.left,top:i.top-r.top,right:i.right+r.right,bottom:i.bottom+r.bottom},{offsetWidth:l,offsetHeight:a}=this.view.scrollDOM;jc(this.view.scrollDOM,o,e.head{it.from&&(e=!0)}),e}function xf(s,t,e=1){let i=s.charCategorizer(t),n=s.doc.lineAt(t),r=t-n.from;if(n.length==0)return b.cursor(t);r==0?e=1:r==n.length&&(e=-1);let o=r,l=r;e<0?o=ot(n.text,r,!1):l=ot(n.text,r);let a=i(n.text.slice(o,l));for(;o>0;){let c=ot(n.text,o,!1);if(i(n.text.slice(c,o))!=a)break;o=c}for(;ls?t.left-s:Math.max(0,s-t.right)}function Sf(s,t){return t.top>s?t.top-s:Math.max(0,s-t.bottom)}function ts(s,t){return s.topt.top+1}function go(s,t){return ts.bottom?{top:s.top,left:s.left,right:s.right,bottom:t}:s}function qs(s,t,e){let i,n,r,o,l=!1,a,c,h,f;for(let p=s.firstChild;p;p=p.nextSibling){let g=Je(p);for(let m=0;mS||o==S&&r>x){i=p,n=y,r=x,o=S;let k=S?e0?m0)}x==0?e>y.bottom&&(!h||h.bottomy.top)&&(c=p,f=y):h&&ts(h,y)?h=mo(h,y.bottom):f&&ts(f,y)&&(f=go(f,y.top))}}if(h&&h.bottom>=e?(i=a,n=h):f&&f.top<=e&&(i=c,n=f),!i)return{node:s,offset:0};let u=Math.max(n.left,Math.min(n.right,t));if(i.nodeType==3)return yo(i,u,e);if(l&&i.contentEditable!="false")return qs(i,u,e);let d=Array.prototype.indexOf.call(s.childNodes,i)+(t>=(n.left+n.right)/2?1:0);return{node:s,offset:d}}function yo(s,t,e){let i=s.nodeValue.length,n=-1,r=1e9,o=0;for(let l=0;le?h.top-e:e-h.bottom)-1;if(h.left-1<=t&&h.right+1>=t&&f=(h.left+h.right)/2,d=u;if((D.chrome||D.gecko)&&Be(s,l).getBoundingClientRect().left==h.right&&(d=!u),f<=0)return{node:s,offset:l+(d?1:0)};n=l+(d?1:0),r=f}}}return{node:s,offset:n>-1?n:o>0?s.nodeValue.length:0}}function Ra(s,t,e,i=-1){var n,r;let o=s.contentDOM.getBoundingClientRect(),l=o.top+s.viewState.paddingTop,a,{docHeight:c}=s.viewState,{x:h,y:f}=t,u=f-l;if(u<0)return 0;if(u>c)return s.state.doc.length;for(let k=s.viewState.heightOracle.textHeight/2,w=!1;a=s.elementAtHeight(u),a.type!=Mt.Text;)for(;u=i>0?a.bottom+k:a.top-k,!(u>=0&&u<=c);){if(w)return e?null:0;w=!0,i=-i}f=l+u;let d=a.from;if(ds.viewport.to)return s.viewport.to==s.state.doc.length?s.state.doc.length:e?null:bo(s,o,a,h,f);let p=s.dom.ownerDocument,g=s.root.elementFromPoint?s.root:p,m=g.elementFromPoint(h,f);m&&!s.contentDOM.contains(m)&&(m=null),m||(h=Math.max(o.left+1,Math.min(o.right-1,h)),m=g.elementFromPoint(h,f),m&&!s.contentDOM.contains(m)&&(m=null));let y,x=-1;if(m&&((n=s.docView.nearest(m))===null||n===void 0?void 0:n.isEditable)!=!1){if(p.caretPositionFromPoint){let k=p.caretPositionFromPoint(h,f);k&&({offsetNode:y,offset:x}=k)}else if(p.caretRangeFromPoint){let k=p.caretRangeFromPoint(h,f);k&&({startContainer:y,startOffset:x}=k,(!s.contentDOM.contains(y)||D.safari&&kf(y,x,h)||D.chrome&&vf(y,x,h))&&(y=void 0))}y&&(x=Math.min(Zt(y),x))}if(!y||!s.docView.dom.contains(y)){let k=Q.find(s.docView,d);if(!k)return u>a.top+a.height/2?a.to:a.from;({node:y,offset:x}=qs(k.dom,h,f))}let S=s.docView.nearest(y);if(!S)return null;if(S.isWidget&&((r=S.dom)===null||r===void 0?void 0:r.nodeType)==1){let k=S.dom.getBoundingClientRect();return t.ys.defaultLineHeight*1.5){let l=s.viewState.heightOracle.textHeight,a=Math.floor((n-e.top-(s.defaultLineHeight-l)*.5)/l);r+=a*s.viewState.heightOracle.lineLength}let o=s.state.sliceDoc(e.from,e.to);return e.from+Ds(o,r,s.state.tabSize)}function kf(s,t,e){let i;if(s.nodeType!=3||t!=(i=s.nodeValue.length))return!1;for(let n=s.nextSibling;n;n=n.nextSibling)if(n.nodeType!=1||n.nodeName!="BR")return!1;return Be(s,i-1,i).getBoundingClientRect().left>e}function vf(s,t,e){if(t!=0)return!1;for(let n=s;;){let r=n.parentNode;if(!r||r.nodeType!=1||r.firstChild!=n)return!1;if(r.classList.contains("cm-line"))break;n=r}let i=s.nodeType==1?s.getBoundingClientRect():Be(s,0,Math.max(s.nodeValue.length,1)).getBoundingClientRect();return e-i.left>5}function Ks(s,t){let e=s.lineBlockAt(t);if(Array.isArray(e.type)){for(let i of e.type)if(i.to>t||i.to==t&&(i.to==e.to||i.type==Mt.Text))return i}return e}function Cf(s,t,e,i){let n=Ks(s,t.head),r=!i||n.type!=Mt.Text||!(s.lineWrapping||n.widgetLineBreaks)?null:s.coordsAtPos(t.assoc<0&&t.head>n.from?t.head-1:t.head);if(r){let o=s.dom.getBoundingClientRect(),l=s.textDirectionAt(n.from),a=s.posAtCoords({x:e==(l==X.LTR)?o.right-1:o.left+1,y:(r.top+r.bottom)/2});if(a!=null)return b.cursor(a,e?-1:1)}return b.cursor(e?n.to:n.from,e?-1:1)}function xo(s,t,e,i){let n=s.state.doc.lineAt(t.head),r=s.bidiSpans(n),o=s.textDirectionAt(n.from);for(let l=t,a=null;;){let c=hf(n,r,o,l,e),h=ma;if(!c){if(n.number==(e?s.state.doc.lines:1))return l;h=` -`,n=s.state.doc.line(n.number+(e?1:-1)),r=s.bidiSpans(n),c=s.visualLineSide(n,!e)}if(a){if(!a(h))return l}else{if(!i)return c;a=i(h)}l=c}}function Af(s,t,e){let i=s.state.charCategorizer(t),n=i(e);return r=>{let o=i(r);return n==J.Space&&(n=o),n==o}}function Mf(s,t,e,i){let n=t.head,r=e?1:-1;if(n==(e?s.state.doc.length:0))return b.cursor(n,t.assoc);let o=t.goalColumn,l,a=s.contentDOM.getBoundingClientRect(),c=s.coordsAtPos(n,t.assoc||-1),h=s.documentTop;if(c)o==null&&(o=c.left-a.left),l=r<0?c.top:c.bottom;else{let d=s.viewState.lineBlockAt(n);o==null&&(o=Math.min(a.right-a.left,s.defaultCharacterWidth*(n-d.from))),l=(r<0?d.top:d.bottom)+h}let f=a.left+o,u=i??s.viewState.heightOracle.textHeight>>1;for(let d=0;;d+=10){let p=l+(u+d)*r,g=Ra(s,{x:f,y:p},!1,r);if(pa.bottom||(r<0?gn)){let m=s.docView.coordsForChar(g),y=!m||p{if(t>r&&tn(s)),e.from,t.head>e.from?-1:1);return i==e.from?e:b.cursor(i,ir)&&this.lineBreak(),n=o}return this.findPointBefore(i,e),this}readTextNode(t){let e=t.nodeValue;for(let i of this.points)i.node==t&&(i.pos=this.text.length+Math.min(i.offset,e.length));for(let i=0,n=this.lineSeparator?null:/\r\n?|\n/g;;){let r=-1,o=1,l;if(this.lineSeparator?(r=e.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(l=n.exec(e))&&(r=l.index,o=l[0].length),this.append(e.slice(i,r<0?e.length:r)),r<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==t&&a.pos>this.text.length&&(a.pos-=o-1);i=r+o}}readNode(t){if(t.cmIgnore)return;let e=$.get(t),i=e&&e.overrideDOMText;if(i!=null){this.findPointInside(t,i.length);for(let n=i.iter();!n.next().done;)n.lineBreak?this.lineBreak():this.append(n.value)}else t.nodeType==3?this.readTextNode(t):t.nodeName=="BR"?t.nextSibling&&this.lineBreak():t.nodeType==1&&this.readRange(t.firstChild,null)}findPointBefore(t,e){for(let i of this.points)i.node==t&&t.childNodes[i.offset]==e&&(i.pos=this.text.length)}findPointInside(t,e){for(let i of this.points)(t.nodeType==3?i.node==t:t.contains(i.node))&&(i.pos=this.text.length+(Of(t,i.node,i.offset)?e:0))}}function Of(s,t,e){for(;;){if(!t||e-1;let{impreciseHead:r,impreciseAnchor:o}=t.docView;if(t.state.readOnly&&e>-1)this.newSel=null;else if(e>-1&&(this.bounds=t.docView.domBoundsAround(e,i,0))){let l=r||o?[]:Rf(t),a=new Df(l,t.state);a.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=a.text,this.newSel=Lf(l,this.bounds.from)}else{let l=t.observer.selectionRange,a=r&&r.node==l.focusNode&&r.offset==l.focusOffset||!Bs(t.contentDOM,l.focusNode)?t.state.selection.main.head:t.docView.posFromDOM(l.focusNode,l.focusOffset),c=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!Bs(t.contentDOM,l.anchorNode)?t.state.selection.main.anchor:t.docView.posFromDOM(l.anchorNode,l.anchorOffset),h=t.viewport;if((D.ios||D.chrome)&&t.state.selection.main.empty&&a!=c&&(h.from>0||h.toDate.now()-100?s.inputState.lastKeyCode:-1;if(t.bounds){let{from:o,to:l}=t.bounds,a=n.from,c=null;(r===8||D.android&&t.text.length=n.from&&e.to<=n.to&&(e.from!=n.from||e.to!=n.to)&&n.to-n.from-(e.to-e.from)<=4?e={from:n.from,to:n.to,insert:s.state.doc.slice(n.from,e.from).append(e.insert).append(s.state.doc.slice(e.to,n.to))}:(D.mac||D.android)&&e&&e.from==e.to&&e.from==n.head-1&&/^\. ?$/.test(e.insert.toString())&&s.contentDOM.getAttribute("autocorrect")=="off"?(i&&e.insert.length==2&&(i=b.single(i.main.anchor-1,i.main.head-1)),e={from:n.from,to:n.to,insert:F.of([" "])}):D.chrome&&e&&e.from==e.to&&e.from==n.head&&e.insert.toString()==` - `&&s.lineWrapping&&(i&&(i=b.single(i.main.anchor-1,i.main.head-1)),e={from:n.from,to:n.to,insert:F.of([" "])}),e)return kr(s,e,i,r);if(i&&!i.main.eq(n)){let o=!1,l="select";return s.inputState.lastSelectionTime>Date.now()-50&&(s.inputState.lastSelectionOrigin=="select"&&(o=!0),l=s.inputState.lastSelectionOrigin),s.dispatch({selection:i,scrollIntoView:o,userEvent:l}),!0}else return!1}function kr(s,t,e,i=-1){if(D.ios&&s.inputState.flushIOSKey(t))return!0;let n=s.state.selection.main;if(D.android&&(t.to==n.to&&(t.from==n.from||t.from==n.from-1&&s.state.sliceDoc(t.from,n.from)==" ")&&t.insert.length==1&&t.insert.lines==2&&Ke(s.contentDOM,"Enter",13)||(t.from==n.from-1&&t.to==n.to&&t.insert.length==0||i==8&&t.insert.lengthn.head)&&Ke(s.contentDOM,"Backspace",8)||t.from==n.from&&t.to==n.to+1&&t.insert.length==0&&Ke(s.contentDOM,"Delete",46)))return!0;let r=t.insert.toString();s.inputState.composing>=0&&s.inputState.composing++;let o,l=()=>o||(o=Bf(s,t,e));return s.state.facet(Sa).some(a=>a(s,t.from,t.to,r,l))||s.dispatch(l()),!0}function Bf(s,t,e){let i,n=s.state,r=n.selection.main;if(t.from>=r.from&&t.to<=r.to&&t.to-t.from>=(r.to-r.from)/3&&(!e||e.main.empty&&e.main.from==t.from+t.insert.length)&&s.inputState.composing<0){let l=r.fromt.to?n.sliceDoc(t.to,r.to):"";i=n.replaceSelection(s.state.toText(l+t.insert.sliceString(0,void 0,s.state.lineBreak)+a))}else{let l=n.changes(t),a=e&&e.main.to<=l.newLength?e.main:void 0;if(n.selection.ranges.length>1&&s.inputState.composing>=0&&t.to<=r.to&&t.to>=r.to-10){let c=s.state.sliceDoc(t.from,t.to),h,f=e&&Pa(s,e.main.head);if(f){let p=t.insert.length-(t.to-t.from);h={from:f.from,to:f.to-p}}else h=s.state.doc.lineAt(r.head);let u=r.to-t.to,d=r.to-r.from;i=n.changeByRange(p=>{if(p.from==r.from&&p.to==r.to)return{changes:l,range:a||p.map(l)};let g=p.to-u,m=g-c.length;if(p.to-p.from!=d||s.state.sliceDoc(m,g)!=c||p.to>=h.from&&p.from<=h.to)return{range:p};let y=n.changes({from:m,to:g,insert:t.insert}),x=p.to-r.to;return{changes:y,range:a?b.range(Math.max(0,a.anchor+x),Math.max(0,a.head+x)):p.map(y)}})}else i={changes:l,selection:a&&n.selection.replaceRange(a)}}let o="input.type";return(s.composing||s.inputState.compositionPendingChange&&s.inputState.compositionEndedAt>Date.now()-50)&&(s.inputState.compositionPendingChange=!1,o+=".compose",s.inputState.compositionFirstChange&&(o+=".start",s.inputState.compositionFirstChange=!1)),n.update(i,{userEvent:o,scrollIntoView:!0})}function Pf(s,t,e,i){let n=Math.min(s.length,t.length),r=0;for(;r0&&l>0&&s.charCodeAt(o-1)==t.charCodeAt(l-1);)o--,l--;if(i=="end"){let a=Math.max(0,r-Math.min(o,l));e-=o+a-r}if(o=o?r-e:0;r-=a,l=r+(l-o),o=r}else if(l=l?r-e:0;r-=a,o=r+(o-l),l=r}return{from:r,toA:o,toB:l}}function Rf(s){let t=[];if(s.root.activeElement!=s.contentDOM)return t;let{anchorNode:e,anchorOffset:i,focusNode:n,focusOffset:r}=s.observer.selectionRange;return e&&(t.push(new wo(e,i)),(n!=e||r!=i)&&t.push(new wo(n,r))),t}function Lf(s,t){if(s.length==0)return null;let e=s[0].pos,i=s.length==2?s[1].pos:e;return e>-1&&i>-1?b.single(e+t,i+t):null}class Ef{setSelectionOrigin(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now()}constructor(t){this.view=t,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=t.hasFocus,D.safari&&t.contentDOM.addEventListener("input",()=>null),D.gecko&&Xf(t.contentDOM.ownerDocument)}handleEvent(t){!qf(this.view,t)||this.ignoreDuringComposition(t)||t.type=="keydown"&&this.keydown(t)||this.runHandlers(t.type,t)}runHandlers(t,e){let i=this.handlers[t];if(i){for(let n of i.observers)n(this.view,e);for(let n of i.handlers){if(e.defaultPrevented)break;if(n(this.view,e)){e.preventDefault();break}}}}ensureHandlers(t){let e=If(t),i=this.handlers,n=this.view.contentDOM;for(let r in e)if(r!="scroll"){let o=!e[r].handlers.length,l=i[r];l&&o!=!l.handlers.length&&(n.removeEventListener(r,this.handleEvent),l=null),l||n.addEventListener(r,this.handleEvent,{passive:o})}for(let r in i)r!="scroll"&&!e[r]&&n.removeEventListener(r,this.handleEvent);this.handlers=e}keydown(t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),t.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&t.keyCode!=27&&Ia.indexOf(t.keyCode)<0&&(this.tabFocusMode=-1),D.android&&D.chrome&&!t.synthetic&&(t.keyCode==13||t.keyCode==8))return this.view.observer.delayAndroidKey(t.key,t.keyCode),!0;let e;return D.ios&&!t.synthetic&&!t.altKey&&!t.metaKey&&((e=Ea.find(i=>i.keyCode==t.keyCode))&&!t.ctrlKey||Nf.indexOf(t.key)>-1&&t.ctrlKey&&!t.shiftKey)?(this.pendingIOSKey=e||t,setTimeout(()=>this.flushIOSKey(),250),!0):(t.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(t){let e=this.pendingIOSKey;return!e||e.key=="Enter"&&t&&t.from0?!0:D.safari&&!D.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(t){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=t}update(t){this.view.observer.update(t),this.mouseSelection&&this.mouseSelection.update(t),this.draggedContent&&t.docChanged&&(this.draggedContent=this.draggedContent.map(t.changes)),t.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function So(s,t){return(e,i)=>{try{return t.call(s,i,e)}catch(n){At(e.state,n)}}}function If(s){let t=Object.create(null);function e(i){return t[i]||(t[i]={observers:[],handlers:[]})}for(let i of s){let n=i.spec;if(n&&n.domEventHandlers)for(let r in n.domEventHandlers){let o=n.domEventHandlers[r];o&&e(r).handlers.push(So(i.value,o))}if(n&&n.domEventObservers)for(let r in n.domEventObservers){let o=n.domEventObservers[r];o&&e(r).observers.push(So(i.value,o))}}for(let i in Ht)e(i).handlers.push(Ht[i]);for(let i in Nt)e(i).observers.push(Nt[i]);return t}const Ea=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Nf="dthko",Ia=[16,17,18,20,91,92,224,225],Ui=6;function Gi(s){return Math.max(0,s)*.7+8}function Ff(s,t){return Math.max(Math.abs(s.clientX-t.clientX),Math.abs(s.clientY-t.clientY))}class Vf{constructor(t,e,i,n){this.view=t,this.startEvent=e,this.style=i,this.mustSelect=n,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=e,this.scrollParents=Uc(t.contentDOM),this.atoms=t.state.facet(wr).map(o=>o(t));let r=t.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=e.shiftKey,this.multiple=t.state.facet(H.allowMultipleSelections)&&Hf(t,e),this.dragging=zf(t,e)&&Va(e)==1?null:!1}start(t){this.dragging===!1&&this.select(t)}move(t){if(t.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&Ff(this.startEvent,t)<10)return;this.select(this.lastEvent=t);let e=0,i=0,n=0,r=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:n,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:r,bottom:l}=this.scrollParents.y.getBoundingClientRect());let a=Sr(this.view);t.clientX-a.left<=n+Ui?e=-Gi(n-t.clientX):t.clientX+a.right>=o-Ui&&(e=Gi(t.clientX-o)),t.clientY-a.top<=r+Ui?i=-Gi(r-t.clientY):t.clientY+a.bottom>=l-Ui&&(i=Gi(t.clientY-l)),this.setScrollSpeed(e,i)}up(t){this.dragging==null&&this.select(this.lastEvent),this.dragging||t.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(t,e){this.scrollSpeed={x:t,y:e},t||e?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:t,y:e}=this.scrollSpeed;t&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=t,t=0),e&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=e,e=0),(t||e)&&this.view.win.scrollBy(t,e),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(t){let e=null;for(let i=0;ie.isUserEvent("input.type"))?this.destroy():this.style.update(t)&&setTimeout(()=>this.select(this.lastEvent),20)}}function Hf(s,t){let e=s.state.facet(ya);return e.length?e[0](t):D.mac?t.metaKey:t.ctrlKey}function Wf(s,t){let e=s.state.facet(ba);return e.length?e[0](t):D.mac?!t.altKey:!t.ctrlKey}function zf(s,t){let{main:e}=s.state.selection;if(e.empty)return!1;let i=Ci(s.root);if(!i||i.rangeCount==0)return!0;let n=i.getRangeAt(0).getClientRects();for(let r=0;r=t.clientX&&o.top<=t.clientY&&o.bottom>=t.clientY)return!0}return!1}function qf(s,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let e=t.target,i;e!=s.contentDOM;e=e.parentNode)if(!e||e.nodeType==11||(i=$.get(e))&&i.ignoreEvent(t))return!1;return!0}const Ht=Object.create(null),Nt=Object.create(null),Na=D.ie&&D.ie_version<15||D.ios&&D.webkit_version<604;function Kf(s){let t=s.dom.parentNode;if(!t)return;let e=t.appendChild(document.createElement("textarea"));e.style.cssText="position: fixed; left: -10000px; top: 10px",e.focus(),setTimeout(()=>{s.focus(),e.remove(),Fa(s,e.value)},50)}function zn(s,t,e){for(let i of s.facet(t))e=i(e,s);return e}function Fa(s,t){t=zn(s.state,yr,t);let{state:e}=s,i,n=1,r=e.toText(t),o=r.lines==e.selection.ranges.length;if($s!=null&&e.selection.ranges.every(a=>a.empty)&&$s==r.toString()){let a=-1;i=e.changeByRange(c=>{let h=e.doc.lineAt(c.from);if(h.from==a)return{range:c};a=h.from;let f=e.toText((o?r.line(n++).text:t)+e.lineBreak);return{changes:{from:h.from,insert:f},range:b.cursor(c.from+f.length)}})}else o?i=e.changeByRange(a=>{let c=r.line(n++);return{changes:{from:a.from,to:a.to,insert:c.text},range:b.cursor(a.from+c.length)}}):i=e.replaceSelection(r);s.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}Nt.scroll=s=>{s.inputState.lastScrollTop=s.scrollDOM.scrollTop,s.inputState.lastScrollLeft=s.scrollDOM.scrollLeft};Ht.keydown=(s,t)=>(s.inputState.setSelectionOrigin("select"),t.keyCode==27&&s.inputState.tabFocusMode!=0&&(s.inputState.tabFocusMode=Date.now()+2e3),!1);Nt.touchstart=(s,t)=>{s.inputState.lastTouchTime=Date.now(),s.inputState.setSelectionOrigin("select.pointer")};Nt.touchmove=s=>{s.inputState.setSelectionOrigin("select.pointer")};Ht.mousedown=(s,t)=>{if(s.observer.flush(),s.inputState.lastTouchTime>Date.now()-2e3)return!1;let e=null;for(let i of s.state.facet(xa))if(e=i(s,t),e)break;if(!e&&t.button==0&&(e=Uf(s,t)),e){let i=!s.hasFocus;s.inputState.startMouseSelection(new Vf(s,t,e,i)),i&&s.observer.ignore(()=>{Ql(s.contentDOM);let r=s.root.activeElement;r&&!r.contains(s.contentDOM)&&r.blur()});let n=s.inputState.mouseSelection;if(n)return n.start(t),n.dragging===!1}return!1};function ko(s,t,e,i){if(i==1)return b.cursor(t,e);if(i==2)return xf(s.state,t,e);{let n=Q.find(s.docView,t),r=s.state.doc.lineAt(n?n.posAtEnd:t),o=n?n.posAtStart:r.from,l=n?n.posAtEnd:r.to;return lt>=e.top&&t<=e.bottom&&s>=e.left&&s<=e.right;function $f(s,t,e,i){let n=Q.find(s.docView,t);if(!n)return 1;let r=t-n.posAtStart;if(r==0)return 1;if(r==n.length)return-1;let o=n.coordsAt(r,-1);if(o&&vo(e,i,o))return-1;let l=n.coordsAt(r,1);return l&&vo(e,i,l)?1:o&&o.bottom>=i?-1:1}function Co(s,t){let e=s.posAtCoords({x:t.clientX,y:t.clientY},!1);return{pos:e,bias:$f(s,e,t.clientX,t.clientY)}}const jf=D.ie&&D.ie_version<=11;let Ao=null,Mo=0,Do=0;function Va(s){if(!jf)return s.detail;let t=Ao,e=Do;return Ao=s,Do=Date.now(),Mo=!t||e>Date.now()-400&&Math.abs(t.clientX-s.clientX)<2&&Math.abs(t.clientY-s.clientY)<2?(Mo+1)%3:1}function Uf(s,t){let e=Co(s,t),i=Va(t),n=s.state.selection;return{update(r){r.docChanged&&(e.pos=r.changes.mapPos(e.pos),n=n.map(r.changes))},get(r,o,l){let a=Co(s,r),c,h=ko(s,a.pos,a.bias,i);if(e.pos!=a.pos&&!o){let f=ko(s,e.pos,e.bias,i),u=Math.min(f.from,h.from),d=Math.max(f.to,h.to);h=u1&&(c=Gf(n,a.pos))?c:l?n.addRange(h):b.create([h])}}}function Gf(s,t){for(let e=0;e=t)return b.create(s.ranges.slice(0,e).concat(s.ranges.slice(e+1)),s.mainIndex==e?0:s.mainIndex-(s.mainIndex>e?1:0))}return null}Ht.dragstart=(s,t)=>{let{selection:{main:e}}=s.state;if(t.target.draggable){let n=s.docView.nearest(t.target);if(n&&n.isWidget){let r=n.posAtStart,o=r+n.length;(r>=e.to||o<=e.from)&&(e=b.range(r,o))}}let{inputState:i}=s;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=e,t.dataTransfer&&(t.dataTransfer.setData("Text",zn(s.state,br,s.state.sliceDoc(e.from,e.to))),t.dataTransfer.effectAllowed="copyMove"),!1};Ht.dragend=s=>(s.inputState.draggedContent=null,!1);function Oo(s,t,e,i){if(e=zn(s.state,yr,e),!e)return;let n=s.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:r}=s.inputState,o=i&&r&&Wf(s,t)?{from:r.from,to:r.to}:null,l={from:n,insert:e},a=s.state.changes(o?[o,l]:l);s.focus(),s.dispatch({changes:a,selection:{anchor:a.mapPos(n,-1),head:a.mapPos(n,1)},userEvent:o?"move.drop":"input.drop"}),s.inputState.draggedContent=null}Ht.drop=(s,t)=>{if(!t.dataTransfer)return!1;if(s.state.readOnly)return!0;let e=t.dataTransfer.files;if(e&&e.length){let i=Array(e.length),n=0,r=()=>{++n==e.length&&Oo(s,t,i.filter(o=>o!=null).join(s.state.lineBreak),!1)};for(let o=0;o{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[o]=l.result),r()},l.readAsText(e[o])}return!0}else{let i=t.dataTransfer.getData("Text");if(i)return Oo(s,t,i,!0),!0}return!1};Ht.paste=(s,t)=>{if(s.state.readOnly)return!0;s.observer.flush();let e=Na?null:t.clipboardData;return e?(Fa(s,e.getData("text/plain")||e.getData("text/uri-list")),!0):(Kf(s),!1)};function Jf(s,t){let e=s.dom.parentNode;if(!e)return;let i=e.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=t,i.focus(),i.selectionEnd=t.length,i.selectionStart=0,setTimeout(()=>{i.remove(),s.focus()},50)}function Yf(s){let t=[],e=[],i=!1;for(let n of s.selection.ranges)n.empty||(t.push(s.sliceDoc(n.from,n.to)),e.push(n));if(!t.length){let n=-1;for(let{from:r}of s.selection.ranges){let o=s.doc.lineAt(r);o.number>n&&(t.push(o.text),e.push({from:o.from,to:Math.min(s.doc.length,o.to+1)})),n=o.number}i=!0}return{text:zn(s,br,t.join(s.lineBreak)),ranges:e,linewise:i}}let $s=null;Ht.copy=Ht.cut=(s,t)=>{let{text:e,ranges:i,linewise:n}=Yf(s.state);if(!e&&!n)return!1;$s=n?e:null,t.type=="cut"&&!s.state.readOnly&&s.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let r=Na?null:t.clipboardData;return r?(r.clearData(),r.setData("text/plain",e),!0):(Jf(s,e),!1)};const Ha=re.define();function Wa(s,t){let e=[];for(let i of s.facet(ka)){let n=i(s,t);n&&e.push(n)}return e?s.update({effects:e,annotations:Ha.of(!0)}):null}function za(s){setTimeout(()=>{let t=s.hasFocus;if(t!=s.inputState.notifiedFocused){let e=Wa(s.state,t);e?s.dispatch(e):s.update([])}},10)}Nt.focus=s=>{s.inputState.lastFocusTime=Date.now(),!s.scrollDOM.scrollTop&&(s.inputState.lastScrollTop||s.inputState.lastScrollLeft)&&(s.scrollDOM.scrollTop=s.inputState.lastScrollTop,s.scrollDOM.scrollLeft=s.inputState.lastScrollLeft),za(s)};Nt.blur=s=>{s.observer.clearSelectionRange(),za(s)};Nt.compositionstart=Nt.compositionupdate=s=>{s.observer.editContext||(s.inputState.compositionFirstChange==null&&(s.inputState.compositionFirstChange=!0),s.inputState.composing<0&&(s.inputState.composing=0))};Nt.compositionend=s=>{s.observer.editContext||(s.inputState.composing=-1,s.inputState.compositionEndedAt=Date.now(),s.inputState.compositionPendingKey=!0,s.inputState.compositionPendingChange=s.observer.pendingRecords().length>0,s.inputState.compositionFirstChange=null,D.chrome&&D.android?s.observer.flushSoon():s.inputState.compositionPendingChange?Promise.resolve().then(()=>s.observer.flush()):setTimeout(()=>{s.inputState.composing<0&&s.docView.hasComposition&&s.update([])},50))};Nt.contextmenu=s=>{s.inputState.lastContextMenu=Date.now()};Ht.beforeinput=(s,t)=>{var e,i;if(t.inputType=="insertReplacementText"&&s.observer.editContext){let r=(e=t.dataTransfer)===null||e===void 0?void 0:e.getData("text/plain"),o=t.getTargetRanges();if(r&&o.length){let l=o[0],a=s.posAtDOM(l.startContainer,l.startOffset),c=s.posAtDOM(l.endContainer,l.endOffset);return kr(s,{from:a,to:c,insert:s.state.toText(r)},null),!0}}let n;if(D.chrome&&D.android&&(n=Ea.find(r=>r.inputType==t.inputType))&&(s.observer.delayAndroidKey(n.key,n.keyCode),n.key=="Backspace"||n.key=="Delete")){let r=((i=window.visualViewport)===null||i===void 0?void 0:i.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>r+10&&s.hasFocus&&(s.contentDOM.blur(),s.focus())},100)}return D.ios&&t.inputType=="deleteContentForward"&&s.observer.flushSoon(),D.safari&&t.inputType=="insertText"&&s.inputState.composing>=0&&setTimeout(()=>Nt.compositionend(s,t),20),!1};const To=new Set;function Xf(s){To.has(s)||(To.add(s),s.addEventListener("copy",()=>{}),s.addEventListener("cut",()=>{}))}const Bo=["pre-wrap","normal","pre-line","break-spaces"];let _e=!1;function Po(){_e=!1}class _f{constructor(t){this.lineWrapping=t,this.doc=F.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(t,e){let i=this.doc.lineAt(e).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((e-t-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(t){return this.lineWrapping?(1+Math.max(0,Math.ceil((t-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(t){return this.doc=t,this}mustRefreshForWrapping(t){return Bo.indexOf(t)>-1!=this.lineWrapping}mustRefreshForHeights(t){let e=!1;for(let i=0;i-1,a=Math.round(e)!=Math.round(this.lineHeight)||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=e,this.charWidth=i,this.textHeight=n,this.lineLength=r,a){this.heightSamples={};for(let c=0;c0}set outdated(t){this.flags=(t?2:0)|this.flags&-3}setHeight(t){this.height!=t&&(Math.abs(this.height-t)>dn&&(_e=!0),this.height=t)}replace(t,e,i){return gt.of(i)}decomposeLeft(t,e){e.push(this)}decomposeRight(t,e){e.push(this)}applyChanges(t,e,i,n){let r=this,o=i.doc;for(let l=n.length-1;l>=0;l--){let{fromA:a,toA:c,fromB:h,toB:f}=n[l],u=r.lineAt(a,G.ByPosNoHeight,i.setDoc(e),0,0),d=u.to>=c?u:r.lineAt(c,G.ByPosNoHeight,i,0,0);for(f+=d.to-c,c=d.to;l>0&&u.from<=n[l-1].toA;)a=n[l-1].fromA,h=n[l-1].fromB,l--,ar*2){let l=t[e-1];l.break?t.splice(--e,1,l.left,null,l.right):t.splice(--e,1,l.left,l.right),i+=1+l.break,n-=l.size}else if(r>n*2){let l=t[i];l.break?t.splice(i,1,l.left,null,l.right):t.splice(i,1,l.left,l.right),i+=2+l.break,r-=l.size}else break;else if(n=r&&o(this.blockAt(0,i,n,r))}updateHeight(t,e=0,i=!1,n){return n&&n.from<=e&&n.more&&this.setHeight(n.heights[n.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Ct extends qa{constructor(t,e){super(t,e,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(t,e,i,n){return new Jt(n,this.length,i,this.height,this.breaks)}replace(t,e,i){let n=i[0];return i.length==1&&(n instanceof Ct||n instanceof nt&&n.flags&4)&&Math.abs(this.length-n.length)<10?(n instanceof nt?n=new Ct(n.length,this.height):n.height=this.height,this.outdated||(n.outdated=!1),n):gt.of(i)}updateHeight(t,e=0,i=!1,n){return n&&n.from<=e&&n.more?this.setHeight(n.heights[n.index++]):(i||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,t.heightForLine(this.length-this.collapsed))+this.breaks*t.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class nt extends gt{constructor(t){super(t,0)}heightMetrics(t,e){let i=t.doc.lineAt(e).number,n=t.doc.lineAt(e+this.length).number,r=n-i+1,o,l=0;if(t.lineWrapping){let a=Math.min(this.height,t.lineHeight*r);o=a/r,this.length>r+1&&(l=(this.height-a)/(this.length-r-1))}else o=this.height/r;return{firstLine:i,lastLine:n,perLine:o,perChar:l}}blockAt(t,e,i,n){let{firstLine:r,lastLine:o,perLine:l,perChar:a}=this.heightMetrics(e,n);if(e.lineWrapping){let c=n+(t0){let r=i[i.length-1];r instanceof nt?i[i.length-1]=new nt(r.length+n):i.push(null,new nt(n-1))}if(t>0){let r=i[0];r instanceof nt?i[0]=new nt(t+r.length):i.unshift(new nt(t-1),null)}return gt.of(i)}decomposeLeft(t,e){e.push(new nt(t-1),null)}decomposeRight(t,e){e.push(null,new nt(this.length-t-1))}updateHeight(t,e=0,i=!1,n){let r=e+this.length;if(n&&n.from<=e+this.length&&n.more){let o=[],l=Math.max(e,n.from),a=-1;for(n.from>e&&o.push(new nt(n.from-e-1).updateHeight(t,e));l<=r&&n.more;){let h=t.doc.lineAt(l).length;o.length&&o.push(null);let f=n.heights[n.index++];a==-1?a=f:Math.abs(f-a)>=dn&&(a=-2);let u=new Ct(h,f);u.outdated=!1,o.push(u),l+=h+1}l<=r&&o.push(null,new nt(r-l).updateHeight(t,l));let c=gt.of(o);return(a<0||Math.abs(c.height-this.height)>=dn||Math.abs(a-this.heightMetrics(t,e).perLine)>=dn)&&(_e=!0),kn(this,c)}else(i||this.outdated)&&(this.setHeight(t.heightForGap(e,e+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class Zf extends gt{constructor(t,e,i){super(t.length+e+i.length,t.height+i.height,e|(t.outdated||i.outdated?2:0)),this.left=t,this.right=i,this.size=t.size+i.size}get break(){return this.flags&1}blockAt(t,e,i,n){let r=i+this.left.height;return tl))return c;let h=e==G.ByPosNoHeight?G.ByPosNoHeight:G.ByPos;return a?c.join(this.right.lineAt(l,h,i,o,l)):this.left.lineAt(l,h,i,n,r).join(c)}forEachLine(t,e,i,n,r,o){let l=n+this.left.height,a=r+this.left.length+this.break;if(this.break)t=a&&this.right.forEachLine(t,e,i,l,a,o);else{let c=this.lineAt(a,G.ByPos,i,n,r);t=t&&c.from<=e&&o(c),e>c.to&&this.right.forEachLine(c.to+1,e,i,l,a,o)}}replace(t,e,i){let n=this.left.length+this.break;if(ethis.left.length)return this.balanced(this.left,this.right.replace(t-n,e-n,i));let r=[];t>0&&this.decomposeLeft(t,r);let o=r.length;for(let l of i)r.push(l);if(t>0&&Ro(r,o-1),e=i&&e.push(null)),t>i&&this.right.decomposeLeft(t-i,e)}decomposeRight(t,e){let i=this.left.length,n=i+this.break;if(t>=n)return this.right.decomposeRight(t-n,e);t2*e.size||e.size>2*t.size?gt.of(this.break?[t,null,e]:[t,e]):(this.left=kn(this.left,t),this.right=kn(this.right,e),this.setHeight(t.height+e.height),this.outdated=t.outdated||e.outdated,this.size=t.size+e.size,this.length=t.length+this.break+e.length,this)}updateHeight(t,e=0,i=!1,n){let{left:r,right:o}=this,l=e+r.length+this.break,a=null;return n&&n.from<=e+r.length&&n.more?a=r=r.updateHeight(t,e,i,n):r.updateHeight(t,e,i),n&&n.from<=l+o.length&&n.more?a=o=o.updateHeight(t,l,i,n):o.updateHeight(t,l,i),a?this.balanced(r,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function Ro(s,t){let e,i;s[t]==null&&(e=s[t-1])instanceof nt&&(i=s[t+1])instanceof nt&&s.splice(t-1,3,new nt(e.length+1+i.length))}const tu=5;class vr{constructor(t,e){this.pos=t,this.oracle=e,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(t,e){if(this.lineStart>-1){let i=Math.min(e,this.lineEnd),n=this.nodes[this.nodes.length-1];n instanceof Ct?n.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new Ct(i-this.pos,-1)),this.writtenTo=i,e>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=e}point(t,e,i){if(t=tu)&&this.addLineDeco(n,r,o)}else e>t&&this.span(t,e);this.lineEnd>-1&&this.lineEnd-1)return;let{from:t,to:e}=this.oracle.doc.lineAt(this.pos);this.lineStart=t,this.lineEnd=e,this.writtenTot&&this.nodes.push(new Ct(this.pos-t,-1)),this.writtenTo=this.pos}blankContent(t,e){let i=new nt(e-t);return this.oracle.doc.lineAt(t).to==e&&(i.flags|=4),i}ensureLine(){this.enterLine();let t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof Ct)return t;let e=new Ct(0,-1);return this.nodes.push(e),e}addBlock(t){this.enterLine();let e=t.deco;e&&e.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,e&&e.endSide>0&&(this.covering=t)}addLineDeco(t,e,i){let n=this.ensureLine();n.length+=i,n.collapsed+=i,n.widgetHeight=Math.max(n.widgetHeight,t),n.breaks+=e,this.writtenTo=this.pos=this.pos+i}finish(t){let e=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(e instanceof Ct)&&!this.isCovered?this.nodes.push(new Ct(0,-1)):(this.writtenToh.clientHeight||h.scrollWidth>h.clientWidth)&&f.overflow!="visible"){let u=h.getBoundingClientRect();r=Math.max(r,u.left),o=Math.min(o,u.right),l=Math.max(l,u.top),a=Math.min(c==s.parentNode?n.innerHeight:a,u.bottom)}c=f.position=="absolute"||f.position=="fixed"?h.offsetParent:h.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:r-e.left,right:Math.max(r,o)-e.left,top:l-(e.top+t),bottom:Math.max(l,a)-(e.top+t)}}function su(s,t){let e=s.getBoundingClientRect();return{left:0,right:e.right-e.left,top:t,bottom:e.bottom-(e.top+t)}}class is{constructor(t,e,i,n){this.from=t,this.to=e,this.size=i,this.displaySize=n}static same(t,e){if(t.length!=e.length)return!1;for(let i=0;itypeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new _f(e),this.stateDeco=t.facet(Ai).filter(i=>typeof i!="function"),this.heightMap=gt.empty().applyChanges(this.stateDeco,F.empty,this.heightOracle.setDoc(t.doc),[new It(0,0,0,t.doc.length)]);for(let i=0;i<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());i++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=P.set(this.lineGaps.map(i=>i.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let t=[this.viewport],{main:e}=this.state.selection;for(let i=0;i<=1;i++){let n=i?e.head:e.anchor;if(!t.some(({from:r,to:o})=>n>=r&&n<=o)){let{from:r,to:o}=this.lineBlockAt(n);t.push(new Ji(r,o))}}return this.viewports=t.sort((i,n)=>i.from-n.from),this.updateScaler()}updateScaler(){let t=this.scaler;return this.scaler=this.heightMap.height<=7e6?Eo:new Cr(this.heightOracle,this.heightMap,this.viewports),t.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,t=>{this.viewportLines.push(gi(t,this.scaler))})}update(t,e=null){this.state=t.state;let i=this.stateDeco;this.stateDeco=this.state.facet(Ai).filter(h=>typeof h!="function");let n=t.changedRanges,r=It.extendWithRanges(n,eu(i,this.stateDeco,t?t.changes:tt.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);Po(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),r),(this.heightMap.height!=o||_e)&&(t.flags|=2),l?(this.scrollAnchorPos=t.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let a=r.length?this.mapViewport(this.viewport,t.changes):this.viewport;(e&&(e.range.heada.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,e));let c=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,t.flags|=this.updateForViewport(),(c||!t.changes.empty||t.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes))),t.flags|=this.computeVisibleRanges(),e&&(this.scrollTarget=e),!this.mustEnforceCursorAssoc&&t.selectionSet&&t.view.lineWrapping&&t.state.selection.main.empty&&t.state.selection.main.assoc&&!t.state.facet(Ca)&&(this.mustEnforceCursorAssoc=!0)}measure(t){let e=t.contentDOM,i=window.getComputedStyle(e),n=this.heightOracle,r=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?X.RTL:X.LTR;let o=this.heightOracle.mustRefreshForWrapping(r),l=e.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let c=0,h=0;if(l.width&&l.height){let{scaleX:k,scaleY:w}=_l(e,l);(k>.005&&Math.abs(this.scaleX-k)>.005||w>.005&&Math.abs(this.scaleY-w)>.005)&&(this.scaleX=k,this.scaleY=w,c|=8,o=a=!0)}let f=(parseInt(i.paddingTop)||0)*this.scaleY,u=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=u)&&(this.paddingTop=f,this.paddingBottom=u,c|=10),this.editorWidth!=t.scrollDOM.clientWidth&&(n.lineWrapping&&(a=!0),this.editorWidth=t.scrollDOM.clientWidth,c|=8);let d=t.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=d&&(this.scrollAnchorHeight=-1,this.scrollTop=d),this.scrolledToBottom=ta(t.scrollDOM);let p=(this.printing?su:nu)(e,this.paddingTop),g=p.top-this.pixelViewport.top,m=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let y=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(y!=this.inView&&(this.inView=y,y&&(a=!0)),!this.inView&&!this.scrollTarget)return 0;let x=l.width;if((this.contentDOMWidth!=x||this.editorHeight!=t.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=t.scrollDOM.clientHeight,c|=8),a){let k=t.docView.measureVisibleLineHeights(this.viewport);if(n.mustRefreshForHeights(k)&&(o=!0),o||n.lineWrapping&&Math.abs(x-this.contentDOMWidth)>n.charWidth){let{lineHeight:w,charWidth:v,textHeight:A}=t.docView.measureTextSize();o=w>0&&n.refresh(r,w,v,A,x/v,k),o&&(t.docView.minWidth=0,c|=8)}g>0&&m>0?h=Math.max(g,m):g<0&&m<0&&(h=Math.min(g,m)),Po();for(let w of this.viewports){let v=w.from==this.viewport.from?k:t.docView.measureVisibleLineHeights(w);this.heightMap=(o?gt.empty().applyChanges(this.stateDeco,F.empty,this.heightOracle,[new It(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(n,0,o,new Qf(w.from,v))}_e&&(c|=2)}let S=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return S&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(h,this.scrollTarget),c|=this.updateForViewport()),(c&2||S)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,t)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,t.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(t,e){let i=.5-Math.max(-.5,Math.min(.5,t/1e3/2)),n=this.heightMap,r=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,a=new Ji(n.lineAt(o-i*1e3,G.ByHeight,r,0,0).from,n.lineAt(l+(1-i)*1e3,G.ByHeight,r,0,0).to);if(e){let{head:c}=e.range;if(ca.to){let h=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=n.lineAt(c,G.ByPos,r,0,0),u;e.y=="center"?u=(f.top+f.bottom)/2-h/2:e.y=="start"||e.y=="nearest"&&c=l+Math.max(10,Math.min(i,250)))&&n>o-2*1e3&&r>1,o=n<<1;if(this.defaultTextDirection!=X.LTR&&!i)return[];let l=[],a=(h,f,u,d)=>{if(f-hh&&yy.from>=u.from&&y.to<=u.to&&Math.abs(y.from-h)y.fromx));if(!m){if(fS.from<=f&&S.to>=f)){let S=e.moveToLineBoundary(b.cursor(f),!1,!0).head;S>h&&(f=S)}let y=this.gapSize(u,h,f,d),x=i||y<2e6?y:2e6;m=new is(h,f,y,x)}l.push(m)},c=h=>{if(h.length2e6)for(let v of t)v.from>=h.from&&v.fromh.from&&a(h.from,d,h,f),pe.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let e=[];K.spans(t,this.viewport.from,this.viewport.to,{span(n,r){e.push({from:n,to:r})},point(){}},20);let i=e.length!=this.visibleRanges.length||this.visibleRanges.some((n,r)=>n.from!=e[r].from||n.to!=e[r].to);return this.visibleRanges=e,i?4:0}lineBlockAt(t){return t>=this.viewport.from&&t<=this.viewport.to&&this.viewportLines.find(e=>e.from<=t&&e.to>=t)||gi(this.heightMap.lineAt(t,G.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(t){return t>=this.viewportLines[0].top&&t<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(e=>e.top<=t&&e.bottom>=t)||gi(this.heightMap.lineAt(this.scaler.fromDOM(t),G.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(t){let e=this.lineBlockAtHeight(t+8);return e.from>=this.viewport.from||this.viewportLines[0].top-t>200?e:this.viewportLines[0]}elementAtHeight(t){return gi(this.heightMap.blockAt(this.scaler.fromDOM(t),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Ji{constructor(t,e){this.from=t,this.to=e}}function ou(s,t,e){let i=[],n=s,r=0;return K.spans(e,s,t,{span(){},point(o,l){o>n&&(i.push({from:n,to:o}),r+=o-n),n=l}},20),n=1)return t[t.length-1].to;let i=Math.floor(s*e);for(let n=0;;n++){let{from:r,to:o}=t[n],l=o-r;if(i<=l)return r+i;i-=l}}function Xi(s,t){let e=0;for(let{from:i,to:n}of s.ranges){if(t<=n){e+=t-i;break}e+=n-i}return e/s.total}function lu(s,t){for(let e of s)if(t(e))return e}const Eo={toDOM(s){return s},fromDOM(s){return s},scale:1,eq(s){return s==this}};class Cr{constructor(t,e,i){let n=0,r=0,o=0;this.viewports=i.map(({from:l,to:a})=>{let c=e.lineAt(l,G.ByPos,t,0,0).top,h=e.lineAt(a,G.ByPos,t,0,0).bottom;return n+=h-c,{from:l,to:a,top:c,bottom:h,domTop:0,domBottom:0}}),this.scale=(7e6-n)/(e.height-n);for(let l of this.viewports)l.domTop=o+(l.top-r)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),r=l.bottom}toDOM(t){for(let e=0,i=0,n=0;;e++){let r=ee.from==t.viewports[i].from&&e.to==t.viewports[i].to):!1}}function gi(s,t){if(t.scale==1)return s;let e=t.toDOM(s.top),i=t.toDOM(s.bottom);return new Jt(s.from,s.length,e,i-e,Array.isArray(s._content)?s._content.map(n=>gi(n,t)):s._content)}const _i=T.define({combine:s=>s.join(" ")}),js=T.define({combine:s=>s.indexOf(!0)>-1}),Us=de.newName(),Ka=de.newName(),$a=de.newName(),ja={"&light":"."+Ka,"&dark":"."+$a};function Gs(s,t,e){return new de(t,{finish(i){return/&/.test(i)?i.replace(/&\w*/,n=>{if(n=="&")return s;if(!e||!e[n])throw new RangeError(`Unsupported selector: ${n}`);return e[n]}):s+" "+i}})}const au=Gs("."+Us,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},ja),hu={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},ns=D.ie&&D.ie_version<=11;class cu{constructor(t){this.view=t,this.active=!1,this.editContext=null,this.selectionRange=new Gc,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=t.contentDOM,this.observer=new MutationObserver(e=>{for(let i of e)this.queue.push(i);(D.ie&&D.ie_version<=11||D.ios&&t.composing)&&e.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&t.constructor.EDIT_CONTEXT!==!1&&!(D.chrome&&D.chrome_version<126)&&(this.editContext=new uu(t),t.state.facet(ae)&&(t.contentDOM.editContext=this.editContext.editContext)),ns&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var e;((e=this.view.docView)===null||e===void 0?void 0:e.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(e=>{e.length>0&&e[e.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(t){this.view.inputState.runHandlers("scroll",t),this.intersecting&&this.view.measure()}onScroll(t){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(t)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(t){(t.type=="change"||!t.type)&&!t.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(t){if(this.gapIntersection&&(t.length!=this.gaps.length||this.gaps.some((e,i)=>e!=t[i]))){this.gapIntersection.disconnect();for(let e of t)this.gapIntersection.observe(e);this.gaps=t}}onSelectionChange(t){let e=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,n=this.selectionRange;if(i.state.facet(ae)?i.root.activeElement!=this.dom:!fn(this.dom,n))return;let r=n.anchorNode&&i.docView.nearest(n.anchorNode);if(r&&r.ignoreEvent(t)){e||(this.selectionChanged=!1);return}(D.ie&&D.ie_version<=11||D.android&&D.chrome)&&!i.state.selection.main.empty&&n.focusNode&&xi(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:t}=this,e=Ci(t.root);if(!e)return!1;let i=D.safari&&t.root.nodeType==11&&t.root.activeElement==this.dom&&fu(this.view,e)||e;if(!i||this.selectionRange.eq(i))return!1;let n=fn(this.dom,i);return n&&!this.selectionChanged&&t.inputState.lastFocusTime>Date.now()-200&&t.inputState.lastTouchTime{let r=this.delayedAndroidKey;r&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=r.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&r.force&&Ke(this.dom,r.key,r.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(n)}(!this.delayedAndroidKey||t=="Enter")&&(this.delayedAndroidKey={key:t,keyCode:e,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}processRecords(){let t=this.pendingRecords();t.length&&(this.queue=[]);let e=-1,i=-1,n=!1;for(let r of t){let o=this.readMutation(r);o&&(o.typeOver&&(n=!0),e==-1?{from:e,to:i}=o:(e=Math.min(o.from,e),i=Math.max(o.to,i)))}return{from:e,to:i,typeOver:n}}readChange(){let{from:t,to:e,typeOver:i}=this.processRecords(),n=this.selectionChanged&&fn(this.dom,this.selectionRange);if(t<0&&!n)return null;t>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let r=new Tf(this.view,t,e,i);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r}flush(t=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;t&&this.readSelectionRange();let e=this.readChange();if(!e)return this.view.requestMeasure(),!1;let i=this.view.state,n=La(this.view,e);return this.view.state==i&&(e.domChanged||e.newSel&&!e.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),n}readMutation(t){let e=this.view.docView.nearest(t.target);if(!e||e.ignoreMutation(t))return null;if(e.markDirty(t.type=="attributes"),t.type=="attributes"&&(e.flags|=4),t.type=="childList"){let i=Io(e,t.previousSibling||t.target.previousSibling,-1),n=Io(e,t.nextSibling||t.target.nextSibling,1);return{from:i?e.posAfter(i):e.posAtStart,to:n?e.posBefore(n):e.posAtEnd,typeOver:!1}}else return t.type=="characterData"?{from:e.posAtStart,to:e.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}:null}setWindow(t){t!=this.win&&(this.removeWindowListeners(this.win),this.win=t,this.addWindowListeners(this.win))}addWindowListeners(t){t.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):t.addEventListener("beforeprint",this.onPrint),t.addEventListener("scroll",this.onScroll),t.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(t){t.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):t.removeEventListener("beforeprint",this.onPrint),t.document.removeEventListener("selectionchange",this.onSelectionChange)}update(t){this.editContext&&(this.editContext.update(t),t.startState.facet(ae)!=t.state.facet(ae)&&(t.view.contentDOM.editContext=t.state.facet(ae)?this.editContext.editContext:null))}destroy(){var t,e,i;this.stop(),(t=this.intersection)===null||t===void 0||t.disconnect(),(e=this.gapIntersection)===null||e===void 0||e.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let n of this.scrollTargets)n.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function Io(s,t,e){for(;t;){let i=$.get(t);if(i&&i.parent==s)return i;let n=t.parentNode;t=n!=s.dom?n:e>0?t.nextSibling:t.previousSibling}return null}function No(s,t){let e=t.startContainer,i=t.startOffset,n=t.endContainer,r=t.endOffset,o=s.docView.domAtPos(s.state.selection.main.anchor);return xi(o.node,o.offset,n,r)&&([e,i,n,r]=[n,r,e,i]),{anchorNode:e,anchorOffset:i,focusNode:n,focusOffset:r}}function fu(s,t){if(t.getComposedRanges){let n=t.getComposedRanges(s.root)[0];if(n)return No(s,n)}let e=null;function i(n){n.preventDefault(),n.stopImmediatePropagation(),e=n.getTargetRanges()[0]}return s.contentDOM.addEventListener("beforeinput",i,!0),s.dom.ownerDocument.execCommand("indent"),s.contentDOM.removeEventListener("beforeinput",i,!0),e?No(s,e):null}class uu{constructor(t){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(t.state);let e=this.editContext=new window.EditContext({text:t.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,t.state.selection.main.anchor))),selectionEnd:this.toContextPos(t.state.selection.main.head)});this.handlers.textupdate=i=>{let{anchor:n}=t.state.selection.main,r=this.toEditorPos(i.updateRangeStart),o=this.toEditorPos(i.updateRangeEnd);t.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:i.updateRangeStart,editorBase:r,drifted:!1});let l={from:r,to:o,insert:F.of(i.text.split(` -`))};l.from==this.from&&nthis.to&&(l.to=n),!(l.from==l.to&&!l.insert.length)&&(this.pendingContextChange=l,t.state.readOnly||kr(t,l,b.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd))),this.pendingContextChange&&(this.revertPending(t.state),this.setSelection(t.state)))},this.handlers.characterboundsupdate=i=>{let n=[],r=null;for(let o=this.toEditorPos(i.rangeStart),l=this.toEditorPos(i.rangeEnd);o{let n=[];for(let r of i.getTextFormats()){let o=r.underlineStyle,l=r.underlineThickness;if(o!="None"&&l!="None"){let a=`text-decoration: underline ${o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${l=="Thin"?1:2}px`;n.push(P.mark({attributes:{style:a}}).range(this.toEditorPos(r.rangeStart),this.toEditorPos(r.rangeEnd)))}}t.dispatch({effects:Ma.of(P.set(n))})},this.handlers.compositionstart=()=>{t.inputState.composing<0&&(t.inputState.composing=0,t.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(t.inputState.composing=-1,t.inputState.compositionFirstChange=null,this.composing){let{drifted:i}=this.composing;this.composing=null,i&&this.reset(t.state)}};for(let i in this.handlers)e.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{this.editContext.updateControlBounds(i.contentDOM.getBoundingClientRect());let n=Ci(i.root);n&&n.rangeCount&&this.editContext.updateSelectionBounds(n.getRangeAt(0).getBoundingClientRect())}}}applyEdits(t){let e=0,i=!1,n=this.pendingContextChange;return t.changes.iterChanges((r,o,l,a,c)=>{if(i)return;let h=c.length-(o-r);if(n&&o>=n.to)if(n.from==r&&n.to==o&&n.insert.eq(c)){n=this.pendingContextChange=null,e+=h,this.to+=h;return}else n=null,this.revertPending(t.state);if(r+=e,o+=e,o<=this.from)this.from+=h,this.to+=h;else if(rthis.to||this.to-this.from+c.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(r),this.toContextPos(o),c.toString()),this.to+=h}e+=h}),n&&!i&&this.revertPending(t.state),!i}update(t){let e=this.pendingContextChange;this.composing&&(this.composing.drifted||t.transactions.some(i=>!i.isUserEvent("input.type")&&i.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=t.changes.mapPos(this.composing.editorBase)):!this.applyEdits(t)||!this.rangeIsValid(t.state)?(this.pendingContextChange=null,this.reset(t.state)):(t.docChanged||t.selectionSet||e)&&this.setSelection(t.state),(t.geometryChanged||t.docChanged||t.selectionSet)&&t.view.requestMeasure(this.measureReq)}resetRange(t){let{head:e}=t.selection.main;this.from=Math.max(0,e-1e4),this.to=Math.min(t.doc.length,e+1e4)}reset(t){this.resetRange(t),this.editContext.updateText(0,this.editContext.text.length,t.doc.sliceString(this.from,this.to)),this.setSelection(t)}revertPending(t){let e=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(e.from),this.toContextPos(e.from+e.insert.length),t.doc.sliceString(e.from,e.to))}setSelection(t){let{main:e}=t.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,e.anchor))),n=this.toContextPos(e.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=n)&&this.editContext.updateSelection(i,n)}rangeIsValid(t){let{head:e}=t.selection.main;return!(this.from>0&&e-this.from<500||this.to1e4*3)}toEditorPos(t){let e=this.composing;return e&&e.drifted?e.editorBase+(t-e.contextBase):t+this.from}toContextPos(t){let e=this.composing;return e&&e.drifted?e.contextBase+(t-e.editorBase):t-this.from}destroy(){for(let t in this.handlers)this.editContext.removeEventListener(t,this.handlers[t])}}class O{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(t={}){var e;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),t.parent&&t.parent.appendChild(this.dom);let{dispatch:i}=t;this.dispatchTransactions=t.dispatchTransactions||i&&(n=>n.forEach(r=>i(r,this)))||(n=>this.update(n)),this.dispatch=this.dispatch.bind(this),this._root=t.root||Jc(t.parent)||document,this.viewState=new Lo(t.state||H.create(t)),t.scrollTo&&t.scrollTo.is(ji)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(ui).map(n=>new Zn(n));for(let n of this.plugins)n.update(this);this.observer=new cu(this),this.inputState=new Ef(this),this.inputState.ensureHandlers(this.plugins),this.docView=new po(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((e=document.fonts)===null||e===void 0)&&e.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...t){let e=t.length==1&&t[0]instanceof Z?t:t.length==1&&Array.isArray(t[0])?t[0]:[this.state.update(...t)];this.dispatchTransactions(e,this)}update(t){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let e=!1,i=!1,n,r=this.state;for(let u of t){if(u.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=u.state}if(this.destroyed){this.viewState.state=r;return}let o=this.hasFocus,l=0,a=null;t.some(u=>u.annotation(Ha))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=Wa(r,o),a||(l=1));let c=this.observer.delayedAndroidKey,h=null;if(c?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(h=null)):this.observer.clear(),r.facet(H.phrases)!=this.state.facet(H.phrases))return this.setState(r);n=Sn.create(this,r,t),n.flags|=l;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let u of t){if(f&&(f=f.map(u.changes)),u.scrollIntoView){let{main:d}=u.state.selection;f=new $e(d.empty?d:b.cursor(d.head,d.head>d.anchor?-1:1))}for(let d of u.effects)d.is(ji)&&(f=d.value.clip(this.state))}this.viewState.update(n,f),this.bidiCache=vn.update(this.bidiCache,n.changes),n.empty||(this.updatePlugins(n),this.inputState.update(n)),e=this.docView.update(n),this.state.facet(di)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(e,t.some(u=>u.isUserEvent("select.pointer")))}finally{this.updateState=0}if(n.startState.facet(_i)!=n.state.facet(_i)&&(this.viewState.mustMeasureContent=!0),(e||i||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),e&&this.docViewUpdate(),!n.empty)for(let u of this.state.facet(zs))try{u(n)}catch(d){At(this.state,d,"update listener")}(a||h)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),h&&!La(this,h)&&c.force&&Ke(this.contentDOM,c.key,c.keyCode)})}setState(t){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=t;return}this.updateState=2;let e=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new Lo(t),this.plugins=t.facet(ui).map(i=>new Zn(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new po(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}e&&this.focus(),this.requestMeasure()}updatePlugins(t){let e=t.startState.facet(ui),i=t.state.facet(ui);if(e!=i){let n=[];for(let r of i){let o=e.indexOf(r);if(o<0)n.push(new Zn(r));else{let l=this.plugins[o];l.mustUpdate=t,n.push(l)}}for(let r of this.plugins)r.mustUpdate!=t&&r.destroy(this);this.plugins=n,this.pluginMap.clear()}else for(let n of this.plugins)n.mustUpdate=t;for(let n=0;n-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,t&&this.observer.forceFlush();let e=null,i=this.scrollDOM,n=i.scrollTop*this.scaleY,{scrollAnchorPos:r,scrollAnchorHeight:o}=this.viewState;Math.abs(n-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(ta(i))r=-1,o=this.viewState.heightMap.height;else{let d=this.viewState.scrollAnchorAt(n);r=d.from,o=d.top}this.updateState=1;let a=this.viewState.measure(this);if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];a&4||([this.measureRequests,c]=[c,this.measureRequests]);let h=c.map(d=>{try{return d.read(this)}catch(p){return At(this.state,p),Fo}}),f=Sn.create(this,this.state,[]),u=!1;f.flags|=a,e?e.flags|=a:e=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),u=this.docView.update(f),u&&this.docViewUpdate());for(let d=0;d1||p<-1){n=n+p,i.scrollTop=n/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(e&&!e.empty)for(let l of this.state.facet(zs))l(e)}get themeClasses(){return Us+" "+(this.state.facet(js)?$a:Ka)+" "+this.state.facet(_i)}updateAttrs(){let t=Vo(this,Da,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),e={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(ae)?"true":"false",class:"cm-content",style:`${D.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(e["aria-readonly"]="true"),Vo(this,xr,e);let i=this.observer.ignore(()=>{let n=Is(this.contentDOM,this.contentAttrs,e),r=Is(this.dom,this.editorAttrs,t);return n||r});return this.editorAttrs=t,this.contentAttrs=e,i}showAnnouncements(t){let e=!0;for(let i of t)for(let n of i.effects)if(n.is(O.announce)){e&&(this.announceDOM.textContent=""),e=!1;let r=this.announceDOM.appendChild(document.createElement("div"));r.textContent=n.value}}mountStyles(){this.styleModules=this.state.facet(di);let t=this.state.facet(O.cspNonce);de.mount(this.root,this.styleModules.concat(au).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(t){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),t){if(this.measureRequests.indexOf(t)>-1)return;if(t.key!=null){for(let e=0;ei.spec==t)||null),e&&e.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(t){return this.readMeasured(),this.viewState.elementAtHeight(t)}lineBlockAtHeight(t){return this.readMeasured(),this.viewState.lineBlockAtHeight(t)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(t){return this.viewState.lineBlockAt(t)}get contentHeight(){return this.viewState.contentHeight}moveByChar(t,e,i){return es(this,t,xo(this,t,e,i))}moveByGroup(t,e){return es(this,t,xo(this,t,e,i=>Af(this,t.head,i)))}visualLineSide(t,e){let i=this.bidiSpans(t),n=this.textDirectionAt(t.from),r=i[e?i.length-1:0];return b.cursor(r.side(e,n)+t.from,r.forward(!e,n)?1:-1)}moveToLineBoundary(t,e,i=!0){return Cf(this,t,e,i)}moveVertically(t,e,i){return es(this,t,Mf(this,t,e,i))}domAtPos(t){return this.docView.domAtPos(t)}posAtDOM(t,e=0){return this.docView.posFromDOM(t,e)}posAtCoords(t,e=!0){return this.readMeasured(),Ra(this,t,e)}coordsAtPos(t,e=1){this.readMeasured();let i=this.docView.coordsAt(t,e);if(!i||i.left==i.right)return i;let n=this.state.doc.lineAt(t),r=this.bidiSpans(n),o=r[fe.find(r,t-n.from,-1,e)];return Ei(i,o.dir==X.LTR==e>0)}coordsForChar(t){return this.readMeasured(),this.docView.coordsForChar(t)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(t){return!this.state.facet(va)||tthis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(t))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(t){if(t.length>du)return ga(t.length);let e=this.textDirectionAt(t.from),i;for(let r of this.bidiCache)if(r.from==t.from&&r.dir==e&&(r.fresh||pa(r.isolates,i=uo(this,t))))return r.order;i||(i=uo(this,t));let n=af(t.text,e,i);return this.bidiCache.push(new vn(t.from,t.to,e,i,!0,n)),n}get hasFocus(){var t;return(this.dom.ownerDocument.hasFocus()||D.safari&&((t=this.inputState)===null||t===void 0?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Ql(this.contentDOM),this.docView.updateSelection()})}setRoot(t){this._root!=t&&(this._root=t,this.observer.setWindow((t.nodeType==9?t:t.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let t of this.plugins)t.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(t,e={}){return ji.of(new $e(typeof t=="number"?b.cursor(t):t,e.y,e.x,e.yMargin,e.xMargin))}scrollSnapshot(){let{scrollTop:t,scrollLeft:e}=this.scrollDOM,i=this.viewState.scrollAnchorAt(t);return ji.of(new $e(b.cursor(i.from),"start","start",i.top-t,e,!0))}setTabFocusMode(t){t==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof t=="boolean"?this.inputState.tabFocusMode=t?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+t)}static domEventHandlers(t){return ut.define(()=>({}),{eventHandlers:t})}static domEventObservers(t){return ut.define(()=>({}),{eventObservers:t})}static theme(t,e){let i=de.newName(),n=[_i.of(i),di.of(Gs(`.${i}`,t))];return e&&e.dark&&n.push(js.of(!0)),n}static baseTheme(t){return ye.lowest(di.of(Gs("."+Us,t,ja)))}static findFromDOM(t){var e;let i=t.querySelector(".cm-content"),n=i&&$.get(i)||$.get(t);return((e=n==null?void 0:n.rootView)===null||e===void 0?void 0:e.view)||null}}O.styleModule=di;O.inputHandler=Sa;O.clipboardInputFilter=yr;O.clipboardOutputFilter=br;O.scrollHandler=Aa;O.focusChangeEffect=ka;O.perLineTextDirection=va;O.exceptionSink=wa;O.updateListener=zs;O.editable=ae;O.mouseSelectionStyle=xa;O.dragMovesSelection=ba;O.clickAddsSelectionRange=ya;O.decorations=Ai;O.outerDecorations=Oa;O.atomicRanges=wr;O.bidiIsolatedRanges=Ta;O.scrollMargins=Ba;O.darkTheme=js;O.cspNonce=T.define({combine:s=>s.length?s[0]:""});O.contentAttributes=xr;O.editorAttributes=Da;O.lineWrapping=O.contentAttributes.of({class:"cm-lineWrapping"});O.announce=N.define();const du=4096,Fo={};class vn{constructor(t,e,i,n,r,o){this.from=t,this.to=e,this.dir=i,this.isolates=n,this.fresh=r,this.order=o}static update(t,e){if(e.empty&&!t.some(r=>r.fresh))return t;let i=[],n=t.length?t[t.length-1].dir:X.LTR;for(let r=Math.max(0,t.length-10);r=0;n--){let r=i[n],o=typeof r=="function"?r(s):r;o&&Es(o,e)}return e}const pu=D.mac?"mac":D.windows?"win":D.linux?"linux":"key";function gu(s,t){const e=s.split(/-(?!$)/);let i=e[e.length-1];i=="Space"&&(i=" ");let n,r,o,l;for(let a=0;ai.concat(n),[]))),e}function yu(s,t,e){return Ga(Ua(s.state),t,s,e)}let he=null;const bu=4e3;function xu(s,t=pu){let e=Object.create(null),i=Object.create(null),n=(o,l)=>{let a=i[o];if(a==null)i[o]=l;else if(a!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},r=(o,l,a,c,h)=>{var f,u;let d=e[o]||(e[o]=Object.create(null)),p=l.split(/ (?!$)/).map(y=>gu(y,t));for(let y=1;y{let k=he={view:S,prefix:x,scope:o};return setTimeout(()=>{he==k&&(he=null)},bu),!0}]})}let g=p.join(" ");n(g,!1);let m=d[g]||(d[g]={preventDefault:!1,stopPropagation:!1,run:((u=(f=d._any)===null||f===void 0?void 0:f.run)===null||u===void 0?void 0:u.slice())||[]});a&&m.run.push(a),c&&(m.preventDefault=!0),h&&(m.stopPropagation=!0)};for(let o of s){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let c of l){let h=e[c]||(e[c]=Object.create(null));h._any||(h._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=o;for(let u in h)h[u].run.push(d=>f(d,Js))}let a=o[t]||o.key;if(a)for(let c of l)r(c,a,o.run,o.preventDefault,o.stopPropagation),o.shift&&r(c,"Shift-"+a,o.shift,o.preventDefault,o.stopPropagation)}return e}let Js=null;function Ga(s,t,e,i){Js=t;let n=Kc(t),r=st(n,0),o=Bt(r)==n.length&&n!=" ",l="",a=!1,c=!1,h=!1;he&&he.view==e&&he.scope==i&&(l=he.prefix+" ",Ia.indexOf(t.keyCode)<0&&(c=!0,he=null));let f=new Set,u=m=>{if(m){for(let y of m.run)if(!f.has(y)&&(f.add(y),y(e)))return m.stopPropagation&&(h=!0),!0;m.preventDefault&&(m.stopPropagation&&(h=!0),c=!0)}return!1},d=s[i],p,g;return d&&(u(d[l+Qi(n,t,!o)])?a=!0:o&&(t.altKey||t.metaKey||t.ctrlKey)&&!(D.windows&&t.ctrlKey&&t.altKey)&&(p=pe[t.keyCode])&&p!=n?(u(d[l+Qi(p,t,!0)])||t.shiftKey&&(g=vi[t.keyCode])!=n&&g!=p&&u(d[l+Qi(g,t,!1)]))&&(a=!0):o&&t.shiftKey&&u(d[l+Qi(n,t,!0)])&&(a=!0),!a&&u(d._any)&&(a=!0)),c&&(a=!0),a&&h&&t.stopPropagation(),Js=null,a}class Fi{constructor(t,e,i,n,r){this.className=t,this.left=e,this.top=i,this.width=n,this.height=r}draw(){let t=document.createElement("div");return t.className=this.className,this.adjust(t),t}update(t,e){return e.className!=this.className?!1:(this.adjust(t),!0)}adjust(t){t.style.left=this.left+"px",t.style.top=this.top+"px",this.width!=null&&(t.style.width=this.width+"px"),t.style.height=this.height+"px"}eq(t){return this.left==t.left&&this.top==t.top&&this.width==t.width&&this.height==t.height&&this.className==t.className}static forRange(t,e,i){if(i.empty){let n=t.coordsAtPos(i.head,i.assoc||1);if(!n)return[];let r=Ja(t);return[new Fi(e,n.left-r.left,n.top-r.top,null,n.bottom-n.top)]}else return wu(t,e,i)}}function Ja(s){let t=s.scrollDOM.getBoundingClientRect();return{left:(s.textDirection==X.LTR?t.left:t.right-s.scrollDOM.clientWidth*s.scaleX)-s.scrollDOM.scrollLeft*s.scaleX,top:t.top-s.scrollDOM.scrollTop*s.scaleY}}function Wo(s,t,e,i){let n=s.coordsAtPos(t,e*2);if(!n)return i;let r=s.dom.getBoundingClientRect(),o=(n.top+n.bottom)/2,l=s.posAtCoords({x:r.left+1,y:o}),a=s.posAtCoords({x:r.right-1,y:o});return l==null||a==null?i:{from:Math.max(i.from,Math.min(l,a)),to:Math.min(i.to,Math.max(l,a))}}function wu(s,t,e){if(e.to<=s.viewport.from||e.from>=s.viewport.to)return[];let i=Math.max(e.from,s.viewport.from),n=Math.min(e.to,s.viewport.to),r=s.textDirection==X.LTR,o=s.contentDOM,l=o.getBoundingClientRect(),a=Ja(s),c=o.querySelector(".cm-line"),h=c&&window.getComputedStyle(c),f=l.left+(h?parseInt(h.paddingLeft)+Math.min(0,parseInt(h.textIndent)):0),u=l.right-(h?parseInt(h.paddingRight):0),d=Ks(s,i),p=Ks(s,n),g=d.type==Mt.Text?d:null,m=p.type==Mt.Text?p:null;if(g&&(s.lineWrapping||d.widgetLineBreaks)&&(g=Wo(s,i,1,g)),m&&(s.lineWrapping||p.widgetLineBreaks)&&(m=Wo(s,n,-1,m)),g&&m&&g.from==m.from&&g.to==m.to)return x(S(e.from,e.to,g));{let w=g?S(e.from,null,g):k(d,!1),v=m?S(null,e.to,m):k(p,!0),A=[];return(g||d).to<(m||p).from-(g&&m?1:0)||d.widgetLineBreaks>1&&w.bottom+s.defaultLineHeight/2B&&V.from=pt)break;Dt>j&&E(Math.max(it,j),w==null&&it<=B,Math.min(Dt,pt),v==null&&Dt>=W,zt.dir)}if(j=kt.to+1,j>=pt)break}return z.length==0&&E(B,w==null,W,v==null,s.textDirection),{top:R,bottom:I,horizontal:z}}function k(w,v){let A=l.top+(v?w.top:w.bottom);return{top:A,bottom:A,horizontal:[]}}}function Su(s,t){return s.constructor==t.constructor&&s.eq(t)}class ku{constructor(t,e){this.view=t,this.layer=e,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=t.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),e.above&&this.dom.classList.add("cm-layer-above"),e.class&&this.dom.classList.add(e.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(t.state),t.requestMeasure(this.measureReq),e.mount&&e.mount(this.dom,t)}update(t){t.startState.facet(pn)!=t.state.facet(pn)&&this.setOrder(t.state),(this.layer.update(t,this.dom)||t.geometryChanged)&&(this.scale(),t.view.requestMeasure(this.measureReq))}docViewUpdate(t){this.layer.updateOnDocViewUpdate!==!1&&t.requestMeasure(this.measureReq)}setOrder(t){let e=0,i=t.facet(pn);for(;e!Su(e,this.drawn[i]))){let e=this.dom.firstChild,i=0;for(let n of t)n.update&&e&&n.constructor&&this.drawn[i].constructor&&n.update(e,this.drawn[i])?(e=e.nextSibling,i++):this.dom.insertBefore(n.draw(),e);for(;e;){let n=e.nextSibling;e.remove(),e=n}this.drawn=t}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const pn=T.define();function Ya(s){return[ut.define(t=>new ku(t,s)),pn.of(s)]}const Xa=!D.ios,Mi=T.define({combine(s){return Ee(s,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(t,e)=>Math.min(t,e),drawRangeCursor:(t,e)=>t||e})}});function xm(s={}){return[Mi.of(s),vu,Cu,Au,Ca.of(!0)]}function _a(s){return s.startState.facet(Mi)!=s.state.facet(Mi)}const vu=Ya({above:!0,markers(s){let{state:t}=s,e=t.facet(Mi),i=[];for(let n of t.selection.ranges){let r=n==t.selection.main;if(n.empty?!r||Xa:e.drawRangeCursor){let o=r?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=n.empty?n:b.cursor(n.head,n.head>n.anchor?-1:1);for(let a of Fi.forRange(s,o,l))i.push(a)}}return i},update(s,t){s.transactions.some(i=>i.selection)&&(t.style.animationName=t.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let e=_a(s);return e&&zo(s.state,t),s.docChanged||s.selectionSet||e},mount(s,t){zo(t.state,s)},class:"cm-cursorLayer"});function zo(s,t){t.style.animationDuration=s.facet(Mi).cursorBlinkRate+"ms"}const Cu=Ya({above:!1,markers(s){return s.state.selection.ranges.map(t=>t.empty?[]:Fi.forRange(s,"cm-selectionBackground",t)).reduce((t,e)=>t.concat(e))},update(s,t){return s.docChanged||s.selectionSet||s.viewportChanged||_a(s)},class:"cm-selectionLayer"}),Ys={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};Xa&&(Ys[".cm-line"].caretColor=Ys[".cm-content"].caretColor="transparent !important");const Au=ye.highest(O.theme(Ys)),Qa=N.define({map(s,t){return s==null?null:t.mapPos(s)}}),mi=yt.define({create(){return null},update(s,t){return s!=null&&(s=t.changes.mapPos(s)),t.effects.reduce((e,i)=>i.is(Qa)?i.value:e,s)}}),Mu=ut.fromClass(class{constructor(s){this.view=s,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(s){var t;let e=s.state.field(mi);e==null?this.cursor!=null&&((t=this.cursor)===null||t===void 0||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(s.startState.field(mi)!=e||s.docChanged||s.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:s}=this,t=s.state.field(mi),e=t!=null&&s.coordsAtPos(t);if(!e)return null;let i=s.scrollDOM.getBoundingClientRect();return{left:e.left-i.left+s.scrollDOM.scrollLeft*s.scaleX,top:e.top-i.top+s.scrollDOM.scrollTop*s.scaleY,height:e.bottom-e.top}}drawCursor(s){if(this.cursor){let{scaleX:t,scaleY:e}=this.view;s?(this.cursor.style.left=s.left/t+"px",this.cursor.style.top=s.top/e+"px",this.cursor.style.height=s.height/e+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(s){this.view.state.field(mi)!=s&&this.view.dispatch({effects:Qa.of(s)})}},{eventObservers:{dragover(s){this.setDropPos(this.view.posAtCoords({x:s.clientX,y:s.clientY}))},dragleave(s){(s.target==this.view.contentDOM||!this.view.contentDOM.contains(s.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function wm(){return[mi,Mu]}function qo(s,t,e,i,n){t.lastIndex=0;for(let r=s.iterRange(e,i),o=e,l;!r.next().done;o+=r.value.length)if(!r.lineBreak)for(;l=t.exec(r.value);)n(o+l.index,l)}function Du(s,t){let e=s.visibleRanges;if(e.length==1&&e[0].from==s.viewport.from&&e[0].to==s.viewport.to)return e;let i=[];for(let{from:n,to:r}of e)n=Math.max(s.state.doc.lineAt(n).from,n-t),r=Math.min(s.state.doc.lineAt(r).to,r+t),i.length&&i[i.length-1].to>=n?i[i.length-1].to=r:i.push({from:n,to:r});return i}class Ou{constructor(t){const{regexp:e,decoration:i,decorate:n,boundary:r,maxLength:o=1e3}=t;if(!e.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=e,n)this.addMatch=(l,a,c,h)=>n(h,c,c+l[0].length,l,a);else if(typeof i=="function")this.addMatch=(l,a,c,h)=>{let f=i(l,a,c);f&&h(c,c+l[0].length,f)};else if(i)this.addMatch=(l,a,c,h)=>h(c,c+l[0].length,i);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=r,this.maxLength=o}createDeco(t){let e=new Oe,i=e.add.bind(e);for(let{from:n,to:r}of Du(t,this.maxLength))qo(t.state.doc,this.regexp,n,r,(o,l)=>this.addMatch(l,t,o,i));return e.finish()}updateDeco(t,e){let i=1e9,n=-1;return t.docChanged&&t.changes.iterChanges((r,o,l,a)=>{a>t.view.viewport.from&&l1e3?this.createDeco(t.view):n>-1?this.updateRange(t.view,e.map(t.changes),i,n):e}updateRange(t,e,i,n){for(let r of t.visibleRanges){let o=Math.max(r.from,i),l=Math.min(r.to,n);if(l>o){let a=t.state.doc.lineAt(o),c=a.toa.from;o--)if(this.boundary.test(a.text[o-1-a.from])){h=o;break}for(;lu.push(y.range(g,m));if(a==c)for(this.regexp.lastIndex=h-a.from;(d=this.regexp.exec(a.text))&&d.indexthis.addMatch(m,t,g,p));e=e.update({filterFrom:h,filterTo:f,filter:(g,m)=>gf,add:u})}}return e}}const Xs=/x/.unicode!=null?"gu":"g",Tu=new RegExp(`[\0-\b ---Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,Xs),Bu={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let ss=null;function Pu(){var s;if(ss==null&&typeof document<"u"&&document.body){let t=document.body.style;ss=((s=t.tabSize)!==null&&s!==void 0?s:t.MozTabSize)!=null}return ss||!1}const gn=T.define({combine(s){let t=Ee(s,{render:null,specialChars:Tu,addSpecialChars:null});return(t.replaceTabs=!Pu())&&(t.specialChars=new RegExp(" |"+t.specialChars.source,Xs)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,Xs)),t}});function Sm(s={}){return[gn.of(s),Ru()]}let Ko=null;function Ru(){return Ko||(Ko=ut.fromClass(class{constructor(s){this.view=s,this.decorations=P.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(s.state.facet(gn)),this.decorations=this.decorator.createDeco(s)}makeDecorator(s){return new Ou({regexp:s.specialChars,decoration:(t,e,i)=>{let{doc:n}=e.state,r=st(t[0],0);if(r==9){let o=n.lineAt(i),l=e.state.tabSize,a=ii(o.text,l,i-o.from);return P.replace({widget:new Nu((l-a%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[r]||(this.decorationCache[r]=P.replace({widget:new Iu(s,r)}))},boundary:s.replaceTabs?void 0:/[^]/})}update(s){let t=s.state.facet(gn);s.startState.facet(gn)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(s.view)):this.decorations=this.decorator.updateDeco(s,this.decorations)}},{decorations:s=>s.decorations}))}const Lu="•";function Eu(s){return s>=32?Lu:s==10?"␤":String.fromCharCode(9216+s)}class Iu extends Ie{constructor(t,e){super(),this.options=t,this.code=e}eq(t){return t.code==this.code}toDOM(t){let e=Eu(this.code),i=t.state.phrase("Control character")+" "+(Bu[this.code]||"0x"+this.code.toString(16)),n=this.options.render&&this.options.render(this.code,i,e);if(n)return n;let r=document.createElement("span");return r.textContent=e,r.title=i,r.setAttribute("aria-label",i),r.className="cm-specialChar",r}ignoreEvent(){return!1}}class Nu extends Ie{constructor(t){super(),this.width=t}eq(t){return t.width==this.width}toDOM(){let t=document.createElement("span");return t.textContent=" ",t.className="cm-tab",t.style.width=this.width+"px",t}ignoreEvent(){return!1}}class Fu extends Ie{constructor(t){super(),this.content=t}toDOM(t){let e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(t):this.content.cloneNode(!0)),typeof this.content=="string"?e.setAttribute("aria-label","placeholder "+this.content):e.setAttribute("aria-hidden","true"),e}coordsAt(t){let e=t.firstChild?Je(t.firstChild):[];if(!e.length)return null;let i=window.getComputedStyle(t.parentNode),n=Ei(e[0],i.direction!="rtl"),r=parseInt(i.lineHeight);return n.bottom-n.top>r*1.5?{left:n.left,right:n.right,top:n.top,bottom:n.top+r}:n}ignoreEvent(){return!1}}function km(s){return ut.fromClass(class{constructor(t){this.view=t,this.placeholder=s?P.set([P.widget({widget:new Fu(s),side:1}).range(0)]):P.none}get decorations(){return this.view.state.doc.length?P.none:this.placeholder}},{decorations:t=>t.decorations})}const _s=2e3;function Vu(s,t,e){let i=Math.min(t.line,e.line),n=Math.max(t.line,e.line),r=[];if(t.off>_s||e.off>_s||t.col<0||e.col<0){let o=Math.min(t.off,e.off),l=Math.max(t.off,e.off);for(let a=i;a<=n;a++){let c=s.doc.line(a);c.length<=l&&r.push(b.range(c.from+o,c.to+l))}}else{let o=Math.min(t.col,e.col),l=Math.max(t.col,e.col);for(let a=i;a<=n;a++){let c=s.doc.line(a),h=Ds(c.text,o,s.tabSize,!0);if(h<0)r.push(b.cursor(c.to));else{let f=Ds(c.text,l,s.tabSize);r.push(b.range(c.from+h,c.from+f))}}}return r}function Hu(s,t){let e=s.coordsAtPos(s.viewport.from);return e?Math.round(Math.abs((e.left-t)/s.defaultCharacterWidth)):-1}function $o(s,t){let e=s.posAtCoords({x:t.clientX,y:t.clientY},!1),i=s.state.doc.lineAt(e),n=e-i.from,r=n>_s?-1:n==i.length?Hu(s,t.clientX):ii(i.text,s.state.tabSize,e-i.from);return{line:i.number,col:r,off:n}}function Wu(s,t){let e=$o(s,t),i=s.state.selection;return e?{update(n){if(n.docChanged){let r=n.changes.mapPos(n.startState.doc.line(e.line).from),o=n.state.doc.lineAt(r);e={line:o.number,col:e.col,off:Math.min(e.off,o.length)},i=i.map(n.changes)}},get(n,r,o){let l=$o(s,n);if(!l)return i;let a=Vu(s.state,e,l);return a.length?o?b.create(a.concat(i.ranges)):b.create(a):i}}:null}function vm(s){let t=e=>e.altKey&&e.button==0;return O.mouseSelectionStyle.of((e,i)=>t(i)?Wu(e,i):null)}const ai="-10000px";class zu{constructor(t,e,i,n){this.facet=e,this.createTooltipView=i,this.removeTooltipView=n,this.input=t.state.facet(e),this.tooltips=this.input.filter(o=>o);let r=null;this.tooltipViews=this.tooltips.map(o=>r=i(o,r))}update(t,e){var i;let n=t.state.facet(this.facet),r=n.filter(a=>a);if(n===this.input){for(let a of this.tooltipViews)a.update&&a.update(t);return!1}let o=[],l=e?[]:null;for(let a=0;ae[c]=a),e.length=l.length),this.input=n,this.tooltips=r,this.tooltipViews=o,!0}}function qu(s){let{win:t}=s;return{top:0,left:0,bottom:t.innerHeight,right:t.innerWidth}}const rs=T.define({combine:s=>{var t,e,i;return{position:D.ios?"absolute":((t=s.find(n=>n.position))===null||t===void 0?void 0:t.position)||"fixed",parent:((e=s.find(n=>n.parent))===null||e===void 0?void 0:e.parent)||null,tooltipSpace:((i=s.find(n=>n.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||qu}}}),jo=new WeakMap,Za=ut.fromClass(class{constructor(s){this.view=s,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=s.state.facet(rs);this.position=t.position,this.parent=t.parent,this.classes=s.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new zu(s,th,(e,i)=>this.createTooltip(e,i),e=>{this.resizeObserver&&this.resizeObserver.unobserve(e.dom),e.dom.remove()}),this.above=this.manager.tooltips.map(e=>!!e.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),s.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let s of this.manager.tooltipViews)this.intersectionObserver.observe(s.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(s){s.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(s,this.above);t&&this.observeIntersection();let e=t||s.geometryChanged,i=s.state.facet(rs);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let n of this.manager.tooltipViews)n.dom.style.position=this.position;e=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let n of this.manager.tooltipViews)this.container.appendChild(n.dom);e=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);e&&this.maybeMeasure()}createTooltip(s,t){let e=s.create(this.view),i=t?t.dom:null;if(e.dom.classList.add("cm-tooltip"),s.arrow&&!e.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let n=document.createElement("div");n.className="cm-tooltip-arrow",e.dom.appendChild(n)}return e.dom.style.position=this.position,e.dom.style.top=ai,e.dom.style.left="0px",this.container.insertBefore(e.dom,i),e.mount&&e.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(e.dom),e}destroy(){var s,t,e;this.view.win.removeEventListener("resize",this.measureSoon);for(let i of this.manager.tooltipViews)i.dom.remove(),(s=i.destroy)===null||s===void 0||s.call(i);this.parent&&this.container.remove(),(t=this.resizeObserver)===null||t===void 0||t.disconnect(),(e=this.intersectionObserver)===null||e===void 0||e.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let s=1,t=1,e=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:r}=this.manager.tooltipViews[0];if(D.gecko)e=r.offsetParent!=this.container.ownerDocument.body;else if(r.style.top==ai&&r.style.left=="0px"){let o=r.getBoundingClientRect();e=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}}if(e||this.position=="absolute")if(this.parent){let r=this.parent.getBoundingClientRect();r.width&&r.height&&(s=r.width/this.parent.offsetWidth,t=r.height/this.parent.offsetHeight)}else({scaleX:s,scaleY:t}=this.view.viewState);let i=this.view.scrollDOM.getBoundingClientRect(),n=Sr(this.view);return{visible:{left:i.left+n.left,top:i.top+n.top,right:i.right-n.right,bottom:i.bottom-n.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((r,o)=>{let l=this.manager.tooltipViews[o];return l.getCoords?l.getCoords(r.pos):this.view.coordsAtPos(r.pos)}),size:this.manager.tooltipViews.map(({dom:r})=>r.getBoundingClientRect()),space:this.view.state.facet(rs).tooltipSpace(this.view),scaleX:s,scaleY:t,makeAbsolute:e}}writeMeasure(s){var t;if(s.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{visible:e,space:i,scaleX:n,scaleY:r}=s,o=[];for(let l=0;l=Math.min(e.bottom,i.bottom)||f.rightMath.min(e.right,i.right)+.1)){h.style.top=ai;continue}let d=a.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,p=d?7:0,g=u.right-u.left,m=(t=jo.get(c))!==null&&t!==void 0?t:u.bottom-u.top,y=c.offset||$u,x=this.view.textDirection==X.LTR,S=u.width>i.right-i.left?x?i.left:i.right-u.width:x?Math.max(i.left,Math.min(f.left-(d?14:0)+y.x,i.right-g)):Math.min(Math.max(i.left,f.left-g+(d?14:0)-y.x),i.right-g),k=this.above[l];!a.strictSide&&(k?f.top-m-p-y.yi.bottom)&&k==i.bottom-f.bottom>f.top-i.top&&(k=this.above[l]=!k);let w=(k?f.top-i.top:i.bottom-f.bottom)-p;if(wS&&R.topv&&(v=k?R.top-m-2-p:R.bottom+p+2);if(this.position=="absolute"?(h.style.top=(v-s.parent.top)/r+"px",h.style.left=(S-s.parent.left)/n+"px"):(h.style.top=v/r+"px",h.style.left=S/n+"px"),d){let R=f.left+(x?y.x:-y.x)-(S+14-7);d.style.left=R/n+"px"}c.overlap!==!0&&o.push({left:S,top:v,right:A,bottom:v+m}),h.classList.toggle("cm-tooltip-above",k),h.classList.toggle("cm-tooltip-below",!k),c.positioned&&c.positioned(s.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let s of this.manager.tooltipViews)s.dom.style.top=ai}},{eventObservers:{scroll(){this.maybeMeasure()}}}),Ku=O.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),$u={x:0,y:0},th=T.define({enables:[Za,Ku]});function eh(s,t){let e=s.plugin(Za);if(!e)return null;let i=e.manager.tooltips.indexOf(t);return i<0?null:e.manager.tooltipViews[i]}const Uo=T.define({combine(s){let t,e;for(let i of s)t=t||i.topContainer,e=e||i.bottomContainer;return{topContainer:t,bottomContainer:e}}});function Cn(s,t){let e=s.plugin(ih),i=e?e.specs.indexOf(t):-1;return i>-1?e.panels[i]:null}const ih=ut.fromClass(class{constructor(s){this.input=s.state.facet(An),this.specs=this.input.filter(e=>e),this.panels=this.specs.map(e=>e(s));let t=s.state.facet(Uo);this.top=new Zi(s,!0,t.topContainer),this.bottom=new Zi(s,!1,t.bottomContainer),this.top.sync(this.panels.filter(e=>e.top)),this.bottom.sync(this.panels.filter(e=>!e.top));for(let e of this.panels)e.dom.classList.add("cm-panel"),e.mount&&e.mount()}update(s){let t=s.state.facet(Uo);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new Zi(s.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new Zi(s.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let e=s.state.facet(An);if(e!=this.input){let i=e.filter(a=>a),n=[],r=[],o=[],l=[];for(let a of i){let c=this.specs.indexOf(a),h;c<0?(h=a(s.view),l.push(h)):(h=this.panels[c],h.update&&h.update(s)),n.push(h),(h.top?r:o).push(h)}this.specs=i,this.panels=n,this.top.sync(r),this.bottom.sync(o);for(let a of l)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let i of this.panels)i.update&&i.update(s)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:s=>O.scrollMargins.of(t=>{let e=t.plugin(s);return e&&{top:e.top.scrollMargin(),bottom:e.bottom.scrollMargin()}})});class Zi{constructor(t,e,i){this.view=t,this.top=e,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(t){for(let e of this.panels)e.destroy&&t.indexOf(e)<0&&e.destroy();this.panels=t,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let e=this.container||this.view.dom;e.insertBefore(this.dom,this.top?e.firstChild:null)}let t=this.dom.firstChild;for(let e of this.panels)if(e.dom.parentNode==this.dom){for(;t!=e.dom;)t=Go(t);t=t.nextSibling}else this.dom.insertBefore(e.dom,t);for(;t;)t=Go(t)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let t of this.classes.split(" "))t&&this.container.classList.remove(t);for(let t of(this.classes=this.view.themeClasses).split(" "))t&&this.container.classList.add(t)}}}function Go(s){let t=s.nextSibling;return s.remove(),t}const An=T.define({enables:ih});class Re extends De{compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}eq(t){return!1}destroy(t){}}Re.prototype.elementClass="";Re.prototype.toDOM=void 0;Re.prototype.mapMode=ht.TrackBefore;Re.prototype.startSide=Re.prototype.endSide=-1;Re.prototype.point=!0;const ju=T.define(),Uu=new class extends Re{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},Gu=ju.compute(["selection"],s=>{let t=[],e=-1;for(let i of s.selection.ranges){let n=s.doc.lineAt(i.head).from;n>e&&(e=n,t.push(Uu.range(n)))}return K.of(t)});function Cm(){return Gu}const Ju=1024;let Yu=0;class Pt{constructor(t,e){this.from=t,this.to=e}}class L{constructor(t={}){this.id=Yu++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(t){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof t!="function"&&(t=mt.match(t)),e=>{let i=t(e);return i===void 0?null:[this,i]}}}L.closedBy=new L({deserialize:s=>s.split(" ")});L.openedBy=new L({deserialize:s=>s.split(" ")});L.group=new L({deserialize:s=>s.split(" ")});L.isolate=new L({deserialize:s=>{if(s&&s!="rtl"&&s!="ltr"&&s!="auto")throw new RangeError("Invalid value for isolate: "+s);return s||"auto"}});L.contextHash=new L({perNode:!0});L.lookAhead=new L({perNode:!0});L.mounted=new L({perNode:!0});class Di{constructor(t,e,i){this.tree=t,this.overlay=e,this.parser=i}static get(t){return t&&t.props&&t.props[L.mounted.id]}}const Xu=Object.create(null);class mt{constructor(t,e,i,n=0){this.name=t,this.props=e,this.id=i,this.flags=n}static define(t){let e=t.props&&t.props.length?Object.create(null):Xu,i=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),n=new mt(t.name||"",e,t.id,i);if(t.props){for(let r of t.props)if(Array.isArray(r)||(r=r(n)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");e[r[0].id]=r[1]}}return n}prop(t){return this.props[t.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(t){if(typeof t=="string"){if(this.name==t)return!0;let e=this.prop(L.group);return e?e.indexOf(t)>-1:!1}return this.id==t}static match(t){let e=Object.create(null);for(let i in t)for(let n of i.split(" "))e[n]=t[i];return i=>{for(let n=i.prop(L.group),r=-1;r<(n?n.length:0);r++){let o=e[r<0?i.name:n[r]];if(o)return o}}}}mt.none=new mt("",Object.create(null),0,8);class Mr{constructor(t){this.types=t;for(let e=0;e0;for(let a=this.cursor(o|Y.IncludeAnonymous);;){let c=!1;if(a.from<=r&&a.to>=n&&(!l&&a.type.isAnonymous||e(a)!==!1)){if(a.firstChild())continue;c=!0}for(;c&&i&&(l||!a.type.isAnonymous)&&i(a),!a.nextSibling();){if(!a.parent())return;c=!0}}}prop(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t)}get propValues(){let t=[];if(this.props)for(let e in this.props)t.push([+e,this.props[e]]);return t}balance(t={}){return this.children.length<=8?this:Tr(mt.none,this.children,this.positions,0,this.children.length,0,this.length,(e,i,n)=>new U(this.type,e,i,n,this.propValues),t.makeTree||((e,i,n)=>new U(mt.none,e,i,n)))}static build(t){return td(t)}}U.empty=new U(mt.none,[],[],0);class Dr{constructor(t,e){this.buffer=t,this.index=e}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Dr(this.buffer,this.index)}}class me{constructor(t,e,i){this.buffer=t,this.length=e,this.set=i}get type(){return mt.none}toString(){let t=[];for(let e=0;e0));a=o[a+3]);return l}slice(t,e,i){let n=this.buffer,r=new Uint16Array(e-t),o=0;for(let l=t,a=0;l=t&&et;case 1:return e<=t&&i>t;case 2:return i>t;case 4:return!0}}function Oi(s,t,e,i){for(var n;s.from==s.to||(e<1?s.from>=t:s.from>t)||(e>-1?s.to<=t:s.to0?l.length:-1;t!=c;t+=e){let h=l[t],f=a[t]+o.from;if(nh(n,i,f,f+h.length)){if(h instanceof me){if(r&Y.ExcludeBuffers)continue;let u=h.findChild(0,h.buffer.length,e,i-f,n);if(u>-1)return new Yt(new _u(o,h,t,f),null,u)}else if(r&Y.IncludeAnonymous||!h.type.isAnonymous||Or(h)){let u;if(!(r&Y.IgnoreMounts)&&(u=Di.get(h))&&!u.overlay)return new ft(u.tree,f,t,o);let d=new ft(h,f,t,o);return r&Y.IncludeAnonymous||!d.type.isAnonymous?d:d.nextChild(e<0?h.children.length-1:0,e,i,n)}}}if(r&Y.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?t=o.index+e:t=e<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(t){return this.nextChild(0,1,t,2)}childBefore(t){return this.nextChild(this._tree.children.length-1,-1,t,-2)}enter(t,e,i=0){let n;if(!(i&Y.IgnoreOverlays)&&(n=Di.get(this._tree))&&n.overlay){let r=t-this.from;for(let{from:o,to:l}of n.overlay)if((e>0?o<=r:o=r:l>r))return new ft(n.tree,n.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,e,i)}nextSignificantParent(){let t=this;for(;t.type.isAnonymous&&t._parent;)t=t._parent;return t}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function Yo(s,t,e,i){let n=s.cursor(),r=[];if(!n.firstChild())return r;if(e!=null){for(let o=!1;!o;)if(o=n.type.is(e),!n.nextSibling())return r}for(;;){if(i!=null&&n.type.is(i))return r;if(n.type.is(t)&&r.push(n.node),!n.nextSibling())return i==null?r:[]}}function Qs(s,t,e=t.length-1){for(let i=s;e>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(t[e]&&t[e]!=i.name)return!1;e--}}return!0}class _u{constructor(t,e,i,n){this.parent=t,this.buffer=e,this.index=i,this.start=n}}class Yt extends sh{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(t,e,i){super(),this.context=t,this._parent=e,this.index=i,this.type=t.buffer.set.types[t.buffer.buffer[i]]}child(t,e,i){let{buffer:n}=this.context,r=n.findChild(this.index+4,n.buffer[this.index+3],t,e-this.context.start,i);return r<0?null:new Yt(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(t){return this.child(1,t,2)}childBefore(t){return this.child(-1,t,-2)}enter(t,e,i=0){if(i&Y.ExcludeBuffers)return null;let{buffer:n}=this.context,r=n.findChild(this.index+4,n.buffer[this.index+3],e>0?1:-1,t-this.context.start,e);return r<0?null:new Yt(this.context,this,r)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,0,4)}get nextSibling(){let{buffer:t}=this.context,e=t.buffer[this.index+3];return e<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new Yt(this.context,this._parent,e):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,e=this._parent?this._parent.index+4:0;return this.index==e?this.externalSibling(-1):new Yt(this.context,this._parent,t.findChild(e,this.index,-1,0,4))}get tree(){return null}toTree(){let t=[],e=[],{buffer:i}=this.context,n=this.index+4,r=i.buffer[this.index+3];if(r>n){let o=i.buffer[this.index+1];t.push(i.slice(n,r,o)),e.push(0)}return new U(this.type,t,e,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function rh(s){if(!s.length)return null;let t=0,e=s[0];for(let r=1;re.from||o.to=t){let l=new ft(o.tree,o.overlay[0].from+r.from,-1,r);(n||(n=[i])).push(Oi(l,t,e,!1))}}return n?rh(n):i}class Mn{get name(){return this.type.name}constructor(t,e=0){if(this.mode=e,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,t instanceof ft)this.yieldNode(t);else{this._tree=t.context.parent,this.buffer=t.context;for(let i=t._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=t,this.yieldBuf(t.index)}}yieldNode(t){return t?(this._tree=t,this.type=t.type,this.from=t.from,this.to=t.to,!0):!1}yieldBuf(t,e){this.index=t;let{start:i,buffer:n}=this.buffer;return this.type=e||n.set.types[n.buffer[t]],this.from=i+n.buffer[t+1],this.to=i+n.buffer[t+2],!0}yield(t){return t?t instanceof ft?(this.buffer=null,this.yieldNode(t)):(this.buffer=t.context,this.yieldBuf(t.index,t.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(t,e,i){if(!this.buffer)return this.yield(this._tree.nextChild(t<0?this._tree._tree.children.length-1:0,t,e,i,this.mode));let{buffer:n}=this.buffer,r=n.findChild(this.index+4,n.buffer[this.index+3],t,e-this.buffer.start,i);return r<0?!1:(this.stack.push(this.index),this.yieldBuf(r))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(t){return this.enterChild(1,t,2)}childBefore(t){return this.enterChild(-1,t,-2)}enter(t,e,i=this.mode){return this.buffer?i&Y.ExcludeBuffers?!1:this.enterChild(1,t,e):this.yield(this._tree.enter(t,e,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Y.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let t=this.mode&Y.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(t)}sibling(t){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+t,t,0,4,this.mode)):!1;let{buffer:e}=this.buffer,i=this.stack.length-1;if(t<0){let n=i<0?0:this.stack[i]+4;if(this.index!=n)return this.yieldBuf(e.findChild(n,this.index,-1,0,4))}else{let n=e.buffer[this.index+3];if(n<(i<0?e.buffer.length:e.buffer[this.stack[i]+3]))return this.yieldBuf(n)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+t,t,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(t){let e,i,{buffer:n}=this;if(n){if(t>0){if(this.index-1)for(let r=e+t,o=t<0?-1:i._tree.children.length;r!=o;r+=t){let l=i._tree.children[r];if(this.mode&Y.IncludeAnonymous||l instanceof me||!l.type.isAnonymous||Or(l))return!1}return!0}move(t,e){if(e&&this.enterChild(t,0,4))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1}}next(t=!0){return this.move(1,t)}prev(t=!0){return this.move(-1,t)}moveTo(t,e=0){for(;(this.from==this.to||(e<1?this.from>=t:this.from>t)||(e>-1?this.to<=t:this.to=0;){for(let o=t;o;o=o._parent)if(o.index==n){if(n==this.index)return o;e=o,i=r+1;break t}n=this.stack[--r]}for(let n=i;n=0;r--){if(r<0)return Qs(this._tree,t,n);let o=i[e.buffer[this.stack[r]]];if(!o.isAnonymous){if(t[n]&&t[n]!=o.name)return!1;n--}}return!0}}function Or(s){return s.children.some(t=>t instanceof me||!t.type.isAnonymous||Or(t))}function td(s){var t;let{buffer:e,nodeSet:i,maxBufferLength:n=Ju,reused:r=[],minRepeatType:o=i.types.length}=s,l=Array.isArray(e)?new Dr(e,e.length):e,a=i.types,c=0,h=0;function f(w,v,A,R,I,z){let{id:E,start:B,end:W,size:V}=l,j=h,pt=c;for(;V<0;)if(l.next(),V==-1){let ee=r[E];A.push(ee),R.push(B-w);return}else if(V==-3){c=E;return}else if(V==-4){h=E;return}else throw new RangeError(`Unrecognized record size: ${V}`);let kt=a[E],zt,it,Dt=B-w;if(W-B<=n&&(it=m(l.pos-v,I))){let ee=new Uint16Array(it.size-it.skip),Ot=l.pos-it.size,qt=ee.length;for(;l.pos>Ot;)qt=y(it.start,ee,qt);zt=new me(ee,W-it.start,i),Dt=it.start-w}else{let ee=l.pos-V;l.next();let Ot=[],qt=[],xe=E>=o?E:-1,Ne=0,zi=W;for(;l.pos>ee;)xe>=0&&l.id==xe&&l.size>=0?(l.end<=zi-n&&(p(Ot,qt,B,Ne,l.end,zi,xe,j,pt),Ne=Ot.length,zi=l.end),l.next()):z>2500?u(B,ee,Ot,qt):f(B,ee,Ot,qt,xe,z+1);if(xe>=0&&Ne>0&&Ne-1&&Ne>0){let Gr=d(kt,pt);zt=Tr(kt,Ot,qt,0,Ot.length,0,W-B,Gr,Gr)}else zt=g(kt,Ot,qt,W-B,j-W,pt)}A.push(zt),R.push(Dt)}function u(w,v,A,R){let I=[],z=0,E=-1;for(;l.pos>v;){let{id:B,start:W,end:V,size:j}=l;if(j>4)l.next();else{if(E>-1&&W=0;V-=3)B[j++]=I[V],B[j++]=I[V+1]-W,B[j++]=I[V+2]-W,B[j++]=j;A.push(new me(B,I[2]-W,i)),R.push(W-w)}}function d(w,v){return(A,R,I)=>{let z=0,E=A.length-1,B,W;if(E>=0&&(B=A[E])instanceof U){if(!E&&B.type==w&&B.length==I)return B;(W=B.prop(L.lookAhead))&&(z=R[E]+B.length+W)}return g(w,A,R,I,z,v)}}function p(w,v,A,R,I,z,E,B,W){let V=[],j=[];for(;w.length>R;)V.push(w.pop()),j.push(v.pop()+A-I);w.push(g(i.types[E],V,j,z-I,B-z,W)),v.push(I-A)}function g(w,v,A,R,I,z,E){if(z){let B=[L.contextHash,z];E=E?[B].concat(E):[B]}if(I>25){let B=[L.lookAhead,I];E=E?[B].concat(E):[B]}return new U(w,v,A,R,E)}function m(w,v){let A=l.fork(),R=0,I=0,z=0,E=A.end-n,B={size:0,start:0,skip:0};t:for(let W=A.pos-w;A.pos>W;){let V=A.size;if(A.id==v&&V>=0){B.size=R,B.start=I,B.skip=z,z+=4,R+=4,A.next();continue}let j=A.pos-V;if(V<0||j=o?4:0,kt=A.start;for(A.next();A.pos>j;){if(A.size<0)if(A.size==-3)pt+=4;else break t;else A.id>=o&&(pt+=4);A.next()}I=kt,R+=V,z+=pt}return(v<0||R==w)&&(B.size=R,B.start=I,B.skip=z),B.size>4?B:void 0}function y(w,v,A){let{id:R,start:I,end:z,size:E}=l;if(l.next(),E>=0&&R4){let W=l.pos-(E-4);for(;l.pos>W;)A=y(w,v,A)}v[--A]=B,v[--A]=z-w,v[--A]=I-w,v[--A]=R}else E==-3?c=R:E==-4&&(h=R);return A}let x=[],S=[];for(;l.pos>0;)f(s.start||0,s.bufferStart||0,x,S,-1,0);let k=(t=s.length)!==null&&t!==void 0?t:x.length?S[0]+x[0].length:0;return new U(a[s.topID],x.reverse(),S.reverse(),k)}const Xo=new WeakMap;function mn(s,t){if(!s.isAnonymous||t instanceof me||t.type!=s)return 1;let e=Xo.get(t);if(e==null){e=1;for(let i of t.children){if(i.type!=s||!(i instanceof U)){e=1;break}e+=mn(s,i)}Xo.set(t,e)}return e}function Tr(s,t,e,i,n,r,o,l,a){let c=0;for(let p=i;p=h)break;v+=A}if(S==k+1){if(v>h){let A=p[k];d(A.children,A.positions,0,A.children.length,g[k]+x);continue}f.push(p[k])}else{let A=g[S-1]+p[S-1].length-w;f.push(Tr(s,p,g,k,S,w,A,null,a))}u.push(w+x-r)}}return d(t,e,i,n,0),(l||a)(f,u,o)}class Am{constructor(){this.map=new WeakMap}setBuffer(t,e,i){let n=this.map.get(t);n||this.map.set(t,n=new Map),n.set(e,i)}getBuffer(t,e){let i=this.map.get(t);return i&&i.get(e)}set(t,e){t instanceof Yt?this.setBuffer(t.context.buffer,t.index,e):t instanceof ft&&this.map.set(t.tree,e)}get(t){return t instanceof Yt?this.getBuffer(t.context.buffer,t.index):t instanceof ft?this.map.get(t.tree):void 0}cursorSet(t,e){t.buffer?this.setBuffer(t.buffer.buffer,t.index,e):this.map.set(t.tree,e)}cursorGet(t){return t.buffer?this.getBuffer(t.buffer.buffer,t.index):this.map.get(t.tree)}}class ne{constructor(t,e,i,n,r=!1,o=!1){this.from=t,this.to=e,this.tree=i,this.offset=n,this.open=(r?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,e=[],i=!1){let n=[new ne(0,t.length,t,0,!1,i)];for(let r of e)r.to>t.length&&n.push(r);return n}static applyChanges(t,e,i=128){if(!e.length)return t;let n=[],r=1,o=t.length?t[0]:null;for(let l=0,a=0,c=0;;l++){let h=l=i)for(;o&&o.from=u.from||f<=u.to||c){let d=Math.max(u.from,a)-c,p=Math.min(u.to,f)-c;u=d>=p?null:new ne(d,p,u.tree,u.offset+c,l>0,!!h)}if(u&&n.push(u),o.to>f)break;o=rnew Pt(n.from,n.to)):[new Pt(0,0)]:[new Pt(0,t.length)],this.createParse(t,e||[],i)}parse(t,e,i){let n=this.startParse(t,e,i);for(;;){let r=n.advance();if(r)return r}}}class ed{constructor(t){this.string=t}get length(){return this.string.length}chunk(t){return this.string.slice(t)}get lineChunks(){return!1}read(t,e){return this.string.slice(t,e)}}function Mm(s){return(t,e,i,n)=>new nd(t,s,e,i,n)}class _o{constructor(t,e,i,n,r){this.parser=t,this.parse=e,this.overlay=i,this.target=n,this.from=r}}function Qo(s){if(!s.length||s.some(t=>t.from>=t.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(s))}class id{constructor(t,e,i,n,r,o,l){this.parser=t,this.predicate=e,this.mounts=i,this.index=n,this.start=r,this.target=o,this.prev=l,this.depth=0,this.ranges=[]}}const Zs=new L({perNode:!0});class nd{constructor(t,e,i,n,r){this.nest=e,this.input=i,this.fragments=n,this.ranges=r,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=t}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let n of this.inner)n.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new U(i.type,i.children,i.positions,i.length,i.propValues.concat([[Zs,this.stoppedAt]]))),i}let t=this.inner[this.innerDone],e=t.parse.advance();if(e){this.innerDone++;let i=Object.assign(Object.create(null),t.target.props);i[L.mounted.id]=new Di(e,t.overlay,t.parser),t.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let t=this.input.length;for(let e=this.innerDone;e=this.stoppedAt)l=!1;else if(t.hasNode(n)){if(e){let c=e.mounts.find(h=>h.frag.from<=n.from&&h.frag.to>=n.to&&h.mount.overlay);if(c)for(let h of c.mount.overlay){let f=h.from+c.pos,u=h.to+c.pos;f>=n.from&&u<=n.to&&!e.ranges.some(d=>d.fromf)&&e.ranges.push({from:f,to:u})}}l=!1}else if(i&&(o=sd(i.ranges,n.from,n.to)))l=o!=2;else if(!n.type.isAnonymous&&(r=this.nest(n,this.input))&&(n.fromnew Pt(f.from-n.from,f.to-n.from)):null,n.tree,h.length?h[0].from:n.from)),r.overlay?h.length&&(i={ranges:h,depth:0,prev:i}):l=!1}}else if(e&&(a=e.predicate(n))&&(a===!0&&(a=new Pt(n.from,n.to)),a.from=0&&e.ranges[c].to==a.from?e.ranges[c]={from:e.ranges[c].from,to:a.to}:e.ranges.push(a)}if(l&&n.firstChild())e&&e.depth++,i&&i.depth++;else for(;!n.nextSibling();){if(!n.parent())break t;if(e&&!--e.depth){let c=el(this.ranges,e.ranges);c.length&&(Qo(c),this.inner.splice(e.index,0,new _o(e.parser,e.parser.startParse(this.input,il(e.mounts,c),c),e.ranges.map(h=>new Pt(h.from-e.start,h.to-e.start)),e.target,c[0].from))),e=e.prev}i&&!--i.depth&&(i=i.prev)}}}}function sd(s,t,e){for(let i of s){if(i.from>=e)break;if(i.to>t)return i.from<=t&&i.to>=e?2:1}return 0}function Zo(s,t,e,i,n,r){if(t=t&&e.enter(i,1,Y.IgnoreOverlays|Y.ExcludeBuffers)||e.next(!1)||(this.done=!0)}hasNode(t){if(this.moveTo(t.from),!this.done&&this.cursor.from+this.offset==t.from&&this.cursor.tree)for(let e=this.cursor.tree;;){if(e==t.tree)return!0;if(e.children.length&&e.positions[0]==0&&e.children[0]instanceof U)e=e.children[0];else break}return!1}}class od{constructor(t){var e;if(this.fragments=t,this.curTo=0,this.fragI=0,t.length){let i=this.curFrag=t[0];this.curTo=(e=i.tree.prop(Zs))!==null&&e!==void 0?e:i.to,this.inner=new tl(i.tree,-i.offset)}else this.curFrag=this.inner=null}hasNode(t){for(;this.curFrag&&t.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=t.from&&this.curTo>=t.to&&this.inner.hasNode(t)}nextFrag(){var t;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let e=this.curFrag=this.fragments[this.fragI];this.curTo=(t=e.tree.prop(Zs))!==null&&t!==void 0?t:e.to,this.inner=new tl(e.tree,-e.offset)}}findMounts(t,e){var i;let n=[];if(this.inner){this.inner.cursor.moveTo(t,1);for(let r=this.inner.cursor.node;r;r=r.parent){let o=(i=r.tree)===null||i===void 0?void 0:i.prop(L.mounted);if(o&&o.parser==e)for(let l=this.fragI;l=r.to)break;a.tree==this.curFrag.tree&&n.push({frag:a,pos:r.from-a.offset,mount:o})}}}return n}}function el(s,t){let e=null,i=t;for(let n=1,r=0;n=l)break;a.to<=o||(e||(i=e=t.slice()),a.froml&&e.splice(r+1,0,new Pt(l,a.to))):a.to>l?e[r--]=new Pt(l,a.to):e.splice(r--,1))}}return i}function ld(s,t,e,i){let n=0,r=0,o=!1,l=!1,a=-1e9,c=[];for(;;){let h=n==s.length?1e9:o?s[n].to:s[n].from,f=r==t.length?1e9:l?t[r].to:t[r].from;if(o!=l){let u=Math.max(a,e),d=Math.min(h,f,i);unew Pt(u.from+i,u.to+i)),f=ld(t,h,a,c);for(let u=0,d=a;;u++){let p=u==f.length,g=p?c:f[u].from;if(g>d&&e.push(new ne(d,g,n.tree,-o,r.from>=d||r.openStart,r.to<=g||r.openEnd)),p)break;d=f[u].to}}else e.push(new ne(a,c,n.tree,-o,r.from>=o||r.openStart,r.to<=l||r.openEnd))}return e}let ad=0;class Tt{constructor(t,e,i,n){this.name=t,this.set=e,this.base=i,this.modified=n,this.id=ad++}toString(){let{name:t}=this;for(let e of this.modified)e.name&&(t=`${e.name}(${t})`);return t}static define(t,e){let i=typeof t=="string"?t:"?";if(t instanceof Tt&&(e=t),e!=null&&e.base)throw new Error("Can not derive from a modified tag");let n=new Tt(i,[],null,[]);if(n.set.push(n),e)for(let r of e.set)n.set.push(r);return n}static defineModifier(t){let e=new Dn(t);return i=>i.modified.indexOf(e)>-1?i:Dn.get(i.base||i,i.modified.concat(e).sort((n,r)=>n.id-r.id))}}let hd=0;class Dn{constructor(t){this.name=t,this.instances=[],this.id=hd++}static get(t,e){if(!e.length)return t;let i=e[0].instances.find(l=>l.base==t&&cd(e,l.modified));if(i)return i;let n=[],r=new Tt(t.name,n,t,e);for(let l of e)l.instances.push(r);let o=fd(e);for(let l of t.set)if(!l.modified.length)for(let a of o)n.push(Dn.get(l,a));return r}}function cd(s,t){return s.length==t.length&&s.every((e,i)=>e==t[i])}function fd(s){let t=[[]];for(let e=0;ei.length-e.length)}function ud(s){let t=Object.create(null);for(let e in s){let i=s[e];Array.isArray(i)||(i=[i]);for(let n of e.split(" "))if(n){let r=[],o=2,l=n;for(let f=0;;){if(l=="..."&&f>0&&f+3==n.length){o=1;break}let u=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!u)throw new RangeError("Invalid path: "+n);if(r.push(u[0]=="*"?"":u[0][0]=='"'?JSON.parse(u[0]):u[0]),f+=u[0].length,f==n.length)break;let d=n[f++];if(f==n.length&&d=="!"){o=0;break}if(d!="/")throw new RangeError("Invalid path: "+n);l=n.slice(f)}let a=r.length-1,c=r[a];if(!c)throw new RangeError("Invalid path: "+n);let h=new On(i,o,a>0?r.slice(0,a):null);t[c]=h.sort(t[c])}}return lh.add(t)}const lh=new L;class On{constructor(t,e,i,n){this.tags=t,this.mode=e,this.context=i,this.next=n}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(t){return!t||t.depth{let o=n;for(let l of r)for(let a of l.set){let c=e[a.id];if(c){o=o?o+" "+c:c;break}}return o},scope:i}}function dd(s,t){let e=null;for(let i of s){let n=i.style(t);n&&(e=e?e+" "+n:n)}return e}function pd(s,t,e,i=0,n=s.length){let r=new gd(i,Array.isArray(t)?t:[t],e);r.highlightRange(s.cursor(),i,n,"",r.highlighters),r.flush(n)}class gd{constructor(t,e,i){this.at=t,this.highlighters=e,this.span=i,this.class=""}startSpan(t,e){e!=this.class&&(this.flush(t),t>this.at&&(this.at=t),this.class=e)}flush(t){t>this.at&&this.class&&this.span(this.at,t,this.class)}highlightRange(t,e,i,n,r){let{type:o,from:l,to:a}=t;if(l>=i||a<=e)return;o.isTop&&(r=this.highlighters.filter(d=>!d.scope||d.scope(o)));let c=n,h=md(t)||On.empty,f=dd(r,h.tags);if(f&&(c&&(c+=" "),c+=f,h.mode==1&&(n+=(n?" ":"")+f)),this.startSpan(Math.max(e,l),c),h.opaque)return;let u=t.tree&&t.tree.prop(L.mounted);if(u&&u.overlay){let d=t.node.enter(u.overlay[0].from+l,1),p=this.highlighters.filter(m=>!m.scope||m.scope(u.tree.type)),g=t.firstChild();for(let m=0,y=l;;m++){let x=m=S||!t.nextSibling())););if(!x||S>i)break;y=x.to+l,y>e&&(this.highlightRange(d.cursor(),Math.max(e,x.from+l),Math.min(i,y),"",p),this.startSpan(Math.min(i,y),c))}g&&t.parent()}else if(t.firstChild()){u&&(n="");do if(!(t.to<=e)){if(t.from>=i)break;this.highlightRange(t,e,i,n,r),this.startSpan(Math.min(i,t.to),c)}while(t.nextSibling());t.parent()}}}function md(s){let t=s.type.prop(lh);for(;t&&t.context&&!s.matchContext(t.context);)t=t.next;return t||null}const C=Tt.define,en=C(),oe=C(),nl=C(oe),sl=C(oe),le=C(),nn=C(le),os=C(le),Ut=C(),we=C(Ut),$t=C(),jt=C(),tr=C(),hi=C(tr),sn=C(),M={comment:en,lineComment:C(en),blockComment:C(en),docComment:C(en),name:oe,variableName:C(oe),typeName:nl,tagName:C(nl),propertyName:sl,attributeName:C(sl),className:C(oe),labelName:C(oe),namespace:C(oe),macroName:C(oe),literal:le,string:nn,docString:C(nn),character:C(nn),attributeValue:C(nn),number:os,integer:C(os),float:C(os),bool:C(le),regexp:C(le),escape:C(le),color:C(le),url:C(le),keyword:$t,self:C($t),null:C($t),atom:C($t),unit:C($t),modifier:C($t),operatorKeyword:C($t),controlKeyword:C($t),definitionKeyword:C($t),moduleKeyword:C($t),operator:jt,derefOperator:C(jt),arithmeticOperator:C(jt),logicOperator:C(jt),bitwiseOperator:C(jt),compareOperator:C(jt),updateOperator:C(jt),definitionOperator:C(jt),typeOperator:C(jt),controlOperator:C(jt),punctuation:tr,separator:C(tr),bracket:hi,angleBracket:C(hi),squareBracket:C(hi),paren:C(hi),brace:C(hi),content:Ut,heading:we,heading1:C(we),heading2:C(we),heading3:C(we),heading4:C(we),heading5:C(we),heading6:C(we),contentSeparator:C(Ut),list:C(Ut),quote:C(Ut),emphasis:C(Ut),strong:C(Ut),link:C(Ut),monospace:C(Ut),strikethrough:C(Ut),inserted:C(),deleted:C(),changed:C(),invalid:C(),meta:sn,documentMeta:C(sn),annotation:C(sn),processingInstruction:C(sn),definition:Tt.defineModifier("definition"),constant:Tt.defineModifier("constant"),function:Tt.defineModifier("function"),standard:Tt.defineModifier("standard"),local:Tt.defineModifier("local"),special:Tt.defineModifier("special")};for(let s in M){let t=M[s];t instanceof Tt&&(t.name=s)}ah([{tag:M.link,class:"tok-link"},{tag:M.heading,class:"tok-heading"},{tag:M.emphasis,class:"tok-emphasis"},{tag:M.strong,class:"tok-strong"},{tag:M.keyword,class:"tok-keyword"},{tag:M.atom,class:"tok-atom"},{tag:M.bool,class:"tok-bool"},{tag:M.url,class:"tok-url"},{tag:M.labelName,class:"tok-labelName"},{tag:M.inserted,class:"tok-inserted"},{tag:M.deleted,class:"tok-deleted"},{tag:M.literal,class:"tok-literal"},{tag:M.string,class:"tok-string"},{tag:M.number,class:"tok-number"},{tag:[M.regexp,M.escape,M.special(M.string)],class:"tok-string2"},{tag:M.variableName,class:"tok-variableName"},{tag:M.local(M.variableName),class:"tok-variableName tok-local"},{tag:M.definition(M.variableName),class:"tok-variableName tok-definition"},{tag:M.special(M.variableName),class:"tok-variableName2"},{tag:M.definition(M.propertyName),class:"tok-propertyName tok-definition"},{tag:M.typeName,class:"tok-typeName"},{tag:M.namespace,class:"tok-namespace"},{tag:M.className,class:"tok-className"},{tag:M.macroName,class:"tok-macroName"},{tag:M.propertyName,class:"tok-propertyName"},{tag:M.operator,class:"tok-operator"},{tag:M.comment,class:"tok-comment"},{tag:M.meta,class:"tok-meta"},{tag:M.invalid,class:"tok-invalid"},{tag:M.punctuation,class:"tok-punctuation"}]);var ls;const Ce=new L;function hh(s){return T.define({combine:s?t=>t.concat(s):void 0})}const yd=new L;class Rt{constructor(t,e,i=[],n=""){this.data=t,this.name=n,H.prototype.hasOwnProperty("tree")||Object.defineProperty(H.prototype,"tree",{get(){return St(this)}}),this.parser=e,this.extension=[ti.of(this),H.languageData.of((r,o,l)=>{let a=rl(r,o,l),c=a.type.prop(Ce);if(!c)return[];let h=r.facet(c),f=a.type.prop(yd);if(f){let u=a.resolve(o-a.from,l);for(let d of f)if(d.test(u,r)){let p=r.facet(d.facet);return d.type=="replace"?p:p.concat(h)}}return h})].concat(i)}isActiveAt(t,e,i=-1){return rl(t,e,i).type.prop(Ce)==this.data}findRegions(t){let e=t.facet(ti);if((e==null?void 0:e.data)==this.data)return[{from:0,to:t.doc.length}];if(!e||!e.allowsNesting)return[];let i=[],n=(r,o)=>{if(r.prop(Ce)==this.data){i.push({from:o,to:o+r.length});return}let l=r.prop(L.mounted);if(l){if(l.tree.prop(Ce)==this.data){if(l.overlay)for(let a of l.overlay)i.push({from:a.from+o,to:a.to+o});else i.push({from:o,to:o+r.length});return}else if(l.overlay){let a=i.length;if(n(l.tree,l.overlay[0].from+o),i.length>a)return}}for(let a=0;ai.isTop?e:void 0)]}),t.name)}configure(t,e){return new er(this.data,this.parser.configure(t),e||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function St(s){let t=s.field(Rt.state,!1);return t?t.tree:U.empty}class bd{constructor(t){this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter()}get length(){return this.doc.length}syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}chunk(t){return this.syncTo(t),this.string}get lineChunks(){return!0}read(t,e){let i=this.cursorPos-this.string.length;return t=this.cursorPos?this.doc.sliceString(t,e):this.string.slice(t-i,e-i)}}let ci=null;class Qe{constructor(t,e,i=[],n,r,o,l,a){this.parser=t,this.state=e,this.fragments=i,this.tree=n,this.treeLen=r,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(t,e,i){return new Qe(t,e,[],U.empty,0,i,[],null)}startParse(){return this.parser.startParse(new bd(this.state.doc),this.fragments)}work(t,e){return e!=null&&e>=this.state.doc.length&&(e=void 0),this.tree!=U.empty&&this.isDone(e??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof t=="number"){let n=Date.now()+t;t=()=>Date.now()>n}for(this.parse||(this.parse=this.startParse()),e!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&e=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext(()=>{for(;!(e=this.parse.advance()););}),this.treeLen=t,this.tree=e,this.fragments=this.withoutTempSkipped(ne.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let e=ci;ci=this;try{return t()}finally{ci=e}}withoutTempSkipped(t){for(let e;e=this.tempSkipped.pop();)t=ol(t,e.from,e.to);return t}changes(t,e){let{fragments:i,tree:n,treeLen:r,viewport:o,skipped:l}=this;if(this.takeTree(),!t.empty){let a=[];if(t.iterChangedRanges((c,h,f,u)=>a.push({fromA:c,toA:h,fromB:f,toB:u})),i=ne.applyChanges(i,a),n=U.empty,r=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length){l=[];for(let c of this.skipped){let h=t.mapPos(c.from,1),f=t.mapPos(c.to,-1);ht.from&&(this.fragments=ol(this.fragments,n,r),this.skipped.splice(i--,1))}return this.skipped.length>=e?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(t,e){this.skipped.push({from:t,to:e})}static getSkippingParser(t){return new class extends oh{createParse(e,i,n){let r=n[0].from,o=n[n.length-1].to;return{parsedPos:r,advance(){let a=ci;if(a){for(let c of n)a.tempSkipped.push(c);t&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,t]):t)}return this.parsedPos=o,new U(mt.none,[],[],o-r)},stoppedAt:null,stopAt(){}}}}}isDone(t){t=Math.min(t,this.state.doc.length);let e=this.fragments;return this.treeLen>=t&&e.length&&e[0].from==0&&e[0].to>=t}static get(){return ci}}function ol(s,t,e){return ne.applyChanges(s,[{fromA:t,toA:e,fromB:t,toB:e}])}class Ze{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let e=this.context.changes(t.changes,t.state),i=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),e.viewport.to);return e.work(20,i)||e.takeTree(),new Ze(e)}static init(t){let e=Math.min(3e3,t.doc.length),i=Qe.create(t.facet(ti).parser,t,{from:0,to:e});return i.work(20,e)||i.takeTree(),new Ze(i)}}Rt.state=yt.define({create:Ze.init,update(s,t){for(let e of t.effects)if(e.is(Rt.setState))return e.value;return t.startState.facet(ti)!=t.state.facet(ti)?Ze.init(t.state):s.apply(t)}});let ch=s=>{let t=setTimeout(()=>s(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<"u"&&(ch=s=>{let t=-1,e=setTimeout(()=>{t=requestIdleCallback(s,{timeout:400})},100);return()=>t<0?clearTimeout(e):cancelIdleCallback(t)});const as=typeof navigator<"u"&&(!((ls=navigator.scheduling)===null||ls===void 0)&&ls.isInputPending)?()=>navigator.scheduling.isInputPending():null,xd=ut.fromClass(class{constructor(t){this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let e=this.view.state.field(Rt.state).context;(e.updateViewport(t.view.viewport)||this.view.viewport.to>e.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(e)}scheduleWork(){if(this.working)return;let{state:t}=this.view,e=t.field(Rt.state);(e.tree!=e.context.tree||!e.context.isDone(t.doc.length))&&(this.working=ch(this.work))}work(t){this.working=null;let e=Date.now();if(this.chunkEndn+1e3,a=r.context.work(()=>as&&as()||Date.now()>o,n+(l?0:1e5));this.chunkBudget-=Date.now()-e,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:Rt.setState.of(new Ze(r.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then(()=>this.scheduleWork()).catch(e=>At(this.view.state,e)).then(()=>this.workScheduled--),t.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),ti=T.define({combine(s){return s.length?s[0]:null},enables:s=>[Rt.state,xd,O.contentAttributes.compute([s],t=>{let e=t.facet(s);return e&&e.name?{"data-language":e.name}:{}})]});class Om{constructor(t,e=[]){this.language=t,this.support=e,this.extension=[t,e]}}const wd=T.define(),qn=T.define({combine:s=>{if(!s.length)return" ";let t=s[0];if(!t||/\S/.test(t)||Array.from(t).some(e=>e!=t[0]))throw new Error("Invalid indent unit: "+JSON.stringify(s[0]));return t}});function Le(s){let t=s.facet(qn);return t.charCodeAt(0)==9?s.tabSize*t.length:t.length}function Tn(s,t){let e="",i=s.tabSize,n=s.facet(qn)[0];if(n==" "){for(;t>=i;)e+=" ",t-=i;n=" "}for(let r=0;r=t?Sd(s,e,t):null}class Kn{constructor(t,e={}){this.state=t,this.options=e,this.unit=Le(t)}lineAt(t,e=1){let i=this.state.doc.lineAt(t),{simulateBreak:n,simulateDoubleBreak:r}=this.options;return n!=null&&n>=i.from&&n<=i.to?r&&n==t?{text:"",from:t}:(e<0?n-1&&(r+=o-this.countColumn(i,i.search(/\S|$/))),r}countColumn(t,e=t.length){return ii(t,this.state.tabSize,e)}lineIndent(t,e=1){let{text:i,from:n}=this.lineAt(t,e),r=this.options.overrideIndentation;if(r){let o=r(n);if(o>-1)return o}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const uh=new L;function Sd(s,t,e){let i=t.resolveStack(e),n=i.node.enterUnfinishedNodesBefore(e);if(n!=i.node){let r=[];for(let o=n;o!=i.node;o=o.parent)r.push(o);for(let o=r.length-1;o>=0;o--)i={node:r[o],next:i}}return dh(i,s,e)}function dh(s,t,e){for(let i=s;i;i=i.next){let n=vd(i.node);if(n)return n(Br.create(t,e,i))}return 0}function kd(s){return s.pos==s.options.simulateBreak&&s.options.simulateDoubleBreak}function vd(s){let t=s.type.prop(uh);if(t)return t;let e=s.firstChild,i;if(e&&(i=e.type.prop(L.closedBy))){let n=s.lastChild,r=n&&i.indexOf(n.name)>-1;return o=>ph(o,!0,1,void 0,r&&!kd(o)?n.from:void 0)}return s.parent==null?Cd:null}function Cd(){return 0}class Br extends Kn{constructor(t,e,i){super(t.state,t.options),this.base=t,this.pos=e,this.context=i}get node(){return this.context.node}static create(t,e,i){return new Br(t,e,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(t){let e=this.state.doc.lineAt(t.from);for(;;){let i=t.resolve(e.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(Ad(i,t))break;e=this.state.doc.lineAt(i.from)}return this.lineIndent(e.from)}continue(){return dh(this.context.next,this.base,this.pos)}}function Ad(s,t){for(let e=t;e;e=e.parent)if(s==e)return!0;return!1}function Md(s){let t=s.node,e=t.childAfter(t.from),i=t.lastChild;if(!e)return null;let n=s.options.simulateBreak,r=s.state.doc.lineAt(e.from),o=n==null||n<=r.from?r.to:Math.min(r.to,n);for(let l=e.to;;){let a=t.childAfter(l);if(!a||a==i)return null;if(!a.type.isSkipped){if(a.from>=o)return null;let c=/^ */.exec(r.text.slice(e.to-r.from))[0].length;return{from:e.from,to:e.to+c}}l=a.to}}function Tm({closing:s,align:t=!0,units:e=1}){return i=>ph(i,t,e,s)}function ph(s,t,e,i,n){let r=s.textAfter,o=r.match(/^\s*/)[0].length,l=i&&r.slice(o,o+i.length)==i||n==s.pos+o,a=t?Md(s):null;return a?l?s.column(a.from):s.column(a.to):s.baseIndent+(l?0:s.unit*e)}const Bm=s=>s.baseIndent;function Pm({except:s,units:t=1}={}){return e=>{let i=s&&s.test(e.textAfter);return e.baseIndent+(i?0:t*e.unit)}}const Rm=new L;function Lm(s){let t=s.firstChild,e=s.lastChild;return t&&t.tol.prop(Ce)==o.data:o?l=>l==o:void 0,this.style=ah(t.map(l=>({tag:l.tag,class:l.class||n(Object.assign({},l,{tag:null}))})),{all:r}).style,this.module=i?new de(i):null,this.themeType=e.themeType}static define(t,e){return new $n(t,e||{})}}const ir=T.define(),gh=T.define({combine(s){return s.length?[s[0]]:null}});function hs(s){let t=s.facet(ir);return t.length?t:s.facet(gh)}function Em(s,t){let e=[Od],i;return s instanceof $n&&(s.module&&e.push(O.styleModule.of(s.module)),i=s.themeType),t!=null&&t.fallback?e.push(gh.of(s)):i?e.push(ir.computeN([O.darkTheme],n=>n.facet(O.darkTheme)==(i=="dark")?[s]:[])):e.push(ir.of(s)),e}class Dd{constructor(t){this.markCache=Object.create(null),this.tree=St(t.state),this.decorations=this.buildDeco(t,hs(t.state)),this.decoratedTo=t.viewport.to}update(t){let e=St(t.state),i=hs(t.state),n=i!=hs(t.startState),{viewport:r}=t.view,o=t.changes.mapPos(this.decoratedTo,1);e.length=r.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=o):(e!=this.tree||t.viewportChanged||n)&&(this.tree=e,this.decorations=this.buildDeco(t.view,i),this.decoratedTo=r.to)}buildDeco(t,e){if(!e||!this.tree.length)return P.none;let i=new Oe;for(let{from:n,to:r}of t.visibleRanges)pd(this.tree,e,(o,l,a)=>{i.add(o,l,this.markCache[a]||(this.markCache[a]=P.mark({class:a})))},n,r);return i.finish()}}const Od=ye.high(ut.fromClass(Dd,{decorations:s=>s.decorations})),Im=$n.define([{tag:M.meta,color:"#404740"},{tag:M.link,textDecoration:"underline"},{tag:M.heading,textDecoration:"underline",fontWeight:"bold"},{tag:M.emphasis,fontStyle:"italic"},{tag:M.strong,fontWeight:"bold"},{tag:M.strikethrough,textDecoration:"line-through"},{tag:M.keyword,color:"#708"},{tag:[M.atom,M.bool,M.url,M.contentSeparator,M.labelName],color:"#219"},{tag:[M.literal,M.inserted],color:"#164"},{tag:[M.string,M.deleted],color:"#a11"},{tag:[M.regexp,M.escape,M.special(M.string)],color:"#e40"},{tag:M.definition(M.variableName),color:"#00f"},{tag:M.local(M.variableName),color:"#30a"},{tag:[M.typeName,M.namespace],color:"#085"},{tag:M.className,color:"#167"},{tag:[M.special(M.variableName),M.macroName],color:"#256"},{tag:M.definition(M.propertyName),color:"#00c"},{tag:M.comment,color:"#940"},{tag:M.invalid,color:"#f00"}]),Td=O.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),mh=1e4,yh="()[]{}",bh=T.define({combine(s){return Ee(s,{afterCursor:!0,brackets:yh,maxScanDistance:mh,renderMatch:Rd})}}),Bd=P.mark({class:"cm-matchingBracket"}),Pd=P.mark({class:"cm-nonmatchingBracket"});function Rd(s){let t=[],e=s.matched?Bd:Pd;return t.push(e.range(s.start.from,s.start.to)),s.end&&t.push(e.range(s.end.from,s.end.to)),t}const Ld=yt.define({create(){return P.none},update(s,t){if(!t.docChanged&&!t.selection)return s;let e=[],i=t.state.facet(bh);for(let n of t.state.selection.ranges){if(!n.empty)continue;let r=Xt(t.state,n.head,-1,i)||n.head>0&&Xt(t.state,n.head-1,1,i)||i.afterCursor&&(Xt(t.state,n.head,1,i)||n.headO.decorations.from(s)}),Ed=[Ld,Td];function Nm(s={}){return[bh.of(s),Ed]}const Id=new L;function nr(s,t,e){let i=s.prop(t<0?L.openedBy:L.closedBy);if(i)return i;if(s.name.length==1){let n=e.indexOf(s.name);if(n>-1&&n%2==(t<0?1:0))return[e[n+t]]}return null}function sr(s){let t=s.type.prop(Id);return t?t(s.node):s}function Xt(s,t,e,i={}){let n=i.maxScanDistance||mh,r=i.brackets||yh,o=St(s),l=o.resolveInner(t,e);for(let a=l;a;a=a.parent){let c=nr(a.type,e,r);if(c&&a.from0?t>=h.from&&th.from&&t<=h.to))return Nd(s,t,e,a,h,c,r)}}return Fd(s,t,e,o,l.type,n,r)}function Nd(s,t,e,i,n,r,o){let l=i.parent,a={from:n.from,to:n.to},c=0,h=l==null?void 0:l.cursor();if(h&&(e<0?h.childBefore(i.from):h.childAfter(i.to)))do if(e<0?h.to<=i.from:h.from>=i.to){if(c==0&&r.indexOf(h.type.name)>-1&&h.from0)return null;let c={from:e<0?t-1:t,to:e>0?t+1:t},h=s.doc.iterRange(t,e>0?s.doc.length:0),f=0;for(let u=0;!h.next().done&&u<=r;){let d=h.value;e<0&&(u+=d.length);let p=t+u*e;for(let g=e>0?0:d.length-1,m=e>0?d.length:-1;g!=m;g+=e){let y=o.indexOf(d[g]);if(!(y<0||i.resolveInner(p+g,1).type!=n))if(y%2==0==e>0)f++;else{if(f==1)return{start:c,end:{from:p+g,to:p+g+1},matched:y>>1==a>>1};f--}}e>0&&(u+=d.length)}return h.done?{start:c,matched:!1}:null}function ll(s,t,e,i=0,n=0){t==null&&(t=s.search(/[^\s\u00a0]/),t==-1&&(t=s.length));let r=n;for(let o=i;o=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pose}eatSpace(){let t=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t}skipToEnd(){this.pos=this.string.length}skipTo(t){let e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0}backUp(t){this.pos-=t}column(){return this.lastColumnPosi?o.toLowerCase():o,r=this.string.substr(this.pos,t.length);return n(r)==n(t)?(e!==!1&&(this.pos+=t.length),!0):null}else{let n=this.string.slice(this.pos).match(t);return n&&n.index>0?null:(n&&e!==!1&&(this.pos+=n[0].length),n)}}current(){return this.string.slice(this.start,this.pos)}}function Vd(s){return{name:s.name||"",token:s.token,blankLine:s.blankLine||(()=>{}),startState:s.startState||(()=>!0),copyState:s.copyState||Hd,indent:s.indent||(()=>null),languageData:s.languageData||{},tokenTable:s.tokenTable||Rr}}function Hd(s){if(typeof s!="object")return s;let t={};for(let e in s){let i=s[e];t[e]=i instanceof Array?i.slice():i}return t}const al=new WeakMap;class wh extends Rt{constructor(t){let e=hh(t.languageData),i=Vd(t),n,r=new class extends oh{createParse(o,l,a){return new zd(n,o,l,a)}};super(e,r,[],t.name),this.topNode=$d(e,this),n=this,this.streamParser=i,this.stateAfter=new L({perNode:!0}),this.tokenTable=t.tokenTable?new Ch(i.tokenTable):Kd}static define(t){return new wh(t)}getIndent(t){let e,{overrideIndentation:i}=t.options;i&&(e=al.get(t.state),e!=null&&e1e4)return null;for(;r=i&&e+t.length<=n&&t.prop(s.stateAfter);if(r)return{state:s.streamParser.copyState(r),pos:e+t.length};for(let o=t.children.length-1;o>=0;o--){let l=t.children[o],a=e+t.positions[o],c=l instanceof U&&a=t.length)return t;!n&&e==0&&t.type==s.topNode&&(n=!0);for(let r=t.children.length-1;r>=0;r--){let o=t.positions[r],l=t.children[r],a;if(oe&&Pr(s,r.tree,0-r.offset,e,l),c;if(a&&a.pos<=i&&(c=Sh(s,r.tree,e+r.offset,a.pos+r.offset,!1)))return{state:a.state,tree:c}}return{state:s.streamParser.startState(n?Le(n):4),tree:U.empty}}class zd{constructor(t,e,i,n){this.lang=t,this.input=e,this.fragments=i,this.ranges=n,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=n[n.length-1].to;let r=Qe.get(),o=n[0].from,{state:l,tree:a}=Wd(t,i,o,this.to,r==null?void 0:r.state);this.state=l,this.parsedPos=this.chunkStart=o+a.length;for(let c=0;cc.from<=r.viewport.from&&c.to>=r.viewport.from)&&(this.state=this.lang.streamParser.startState(Le(r.state)),r.skipUntilInView(this.parsedPos,r.viewport.from),this.parsedPos=r.viewport.from),this.moveRangeIndex()}advance(){let t=Qe.get(),e=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),i=Math.min(e,this.chunkStart+2048);for(t&&(i=Math.min(i,t.viewport.to));this.parsedPos=e?this.finish():t&&this.parsedPos>=t.viewport.to?(t.skipUntilInView(this.parsedPos,e),this.finish()):null}stopAt(t){this.stoppedAt=t}lineAfter(t){let e=this.input.chunk(t);if(this.input.lineChunks)e==` -`&&(e="");else{let i=e.indexOf(` -`);i>-1&&(e=e.slice(0,i))}return t+e.length<=this.to?e:e.slice(0,this.to-t)}nextLine(){let t=this.parsedPos,e=this.lineAfter(t),i=t+e.length;for(let n=this.rangeIndex;;){let r=this.ranges[n].to;if(r>=i||(e=e.slice(0,r-(i-e.length)),n++,n==this.ranges.length))break;let o=this.ranges[n].from,l=this.lineAfter(o);e+=l,i=o+l.length}return{line:e,end:i}}skipGapsTo(t,e,i){for(;;){let n=this.ranges[this.rangeIndex].to,r=t+e;if(i>0?n>r:n>=r)break;let o=this.ranges[++this.rangeIndex].from;e+=o-n}return e}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){n=this.skipGapsTo(e,n,1),e+=n;let l=this.chunk.length;n=this.skipGapsTo(i,n,-1),i+=n,r+=this.chunk.length-l}let o=this.chunk.length-4;return r==4&&o>=0&&this.chunk[o]==t&&this.chunk[o+2]==e?this.chunk[o+2]=i:this.chunk.push(t,e,i,r),n}parseLine(t){let{line:e,end:i}=this.nextLine(),n=0,{streamParser:r}=this.lang,o=new xh(e,t?t.state.tabSize:4,t?Le(t.state):2);if(o.eol())r.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=kh(r.token,o,this.state);if(l&&(n=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,n)),o.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPost.start)return n}throw new Error("Stream parser failed to advance stream.")}const Rr=Object.create(null),Ti=[mt.none],qd=new Mr(Ti),hl=[],cl=Object.create(null),vh=Object.create(null);for(let[s,t]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])vh[s]=Ah(Rr,t);class Ch{constructor(t){this.extra=t,this.table=Object.assign(Object.create(null),vh)}resolve(t){return t?this.table[t]||(this.table[t]=Ah(this.extra,t)):0}}const Kd=new Ch(Rr);function cs(s,t){hl.indexOf(s)>-1||(hl.push(s),console.warn(t))}function Ah(s,t){let e=[];for(let l of t.split(" ")){let a=[];for(let c of l.split(".")){let h=s[c]||M[c];h?typeof h=="function"?a.length?a=a.map(h):cs(c,`Modifier ${c} used at start of tag`):a.length?cs(c,`Tag ${c} used as modifier`):a=Array.isArray(h)?h:[h]:cs(c,`Unknown highlighting tag ${c}`)}for(let c of a)e.push(c)}if(!e.length)return 0;let i=t.replace(/ /g,"_"),n=i+" "+e.map(l=>l.id),r=cl[n];if(r)return r.id;let o=cl[n]=mt.define({id:Ti.length,name:i,props:[ud({[i]:e})]});return Ti.push(o),o.id}function $d(s,t){let e=mt.define({id:Ti.length,name:"Document",props:[Ce.add(()=>s),uh.add(()=>i=>t.getIndent(i))],top:!0});return Ti.push(e),e}X.RTL,X.LTR;const jd=s=>{let{state:t}=s,e=t.doc.lineAt(t.selection.main.from),i=Er(s.state,e.from);return i.line?Ud(s):i.block?Jd(s):!1};function Lr(s,t){return({state:e,dispatch:i})=>{if(e.readOnly)return!1;let n=s(t,e);return n?(i(e.update(n)),!0):!1}}const Ud=Lr(_d,0),Gd=Lr(Mh,0),Jd=Lr((s,t)=>Mh(s,t,Xd(t)),0);function Er(s,t){let e=s.languageDataAt("commentTokens",t);return e.length?e[0]:{}}const fi=50;function Yd(s,{open:t,close:e},i,n){let r=s.sliceDoc(i-fi,i),o=s.sliceDoc(n,n+fi),l=/\s*$/.exec(r)[0].length,a=/^\s*/.exec(o)[0].length,c=r.length-l;if(r.slice(c-t.length,c)==t&&o.slice(a,a+e.length)==e)return{open:{pos:i-l,margin:l&&1},close:{pos:n+a,margin:a&&1}};let h,f;n-i<=2*fi?h=f=s.sliceDoc(i,n):(h=s.sliceDoc(i,i+fi),f=s.sliceDoc(n-fi,n));let u=/^\s*/.exec(h)[0].length,d=/\s*$/.exec(f)[0].length,p=f.length-d-e.length;return h.slice(u,u+t.length)==t&&f.slice(p,p+e.length)==e?{open:{pos:i+u+t.length,margin:/\s/.test(h.charAt(u+t.length))?1:0},close:{pos:n-d-e.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function Xd(s){let t=[];for(let e of s.selection.ranges){let i=s.doc.lineAt(e.from),n=e.to<=i.to?i:s.doc.lineAt(e.to);n.from>i.from&&n.from==e.to&&(n=e.to==i.to+1?i:s.doc.lineAt(e.to-1));let r=t.length-1;r>=0&&t[r].to>i.from?t[r].to=n.to:t.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:n.to})}return t}function Mh(s,t,e=t.selection.ranges){let i=e.map(r=>Er(t,r.from).block);if(!i.every(r=>r))return null;let n=e.map((r,o)=>Yd(t,i[o],r.from,r.to));if(s!=2&&!n.every(r=>r))return{changes:t.changes(e.map((r,o)=>n[o]?[]:[{from:r.from,insert:i[o].open+" "},{from:r.to,insert:" "+i[o].close}]))};if(s!=1&&n.some(r=>r)){let r=[];for(let o=0,l;on&&(r==o||o>f.from)){n=f.from;let u=/^\s*/.exec(f.text)[0].length,d=u==f.length,p=f.text.slice(u,u+c.length)==c?u:-1;ur.comment<0&&(!r.empty||r.single))){let r=[];for(let{line:l,token:a,indent:c,empty:h,single:f}of i)(f||!h)&&r.push({from:l.from+c,insert:a+" "});let o=t.changes(r);return{changes:o,selection:t.selection.map(o,1)}}else if(s!=1&&i.some(r=>r.comment>=0)){let r=[];for(let{line:o,comment:l,token:a}of i)if(l>=0){let c=o.from+l,h=c+a.length;o.text[h-o.from]==" "&&h++,r.push({from:c,to:h})}return{changes:r}}return null}const rr=re.define(),Qd=re.define(),Zd=T.define(),Dh=T.define({combine(s){return Ee(s,{minDepth:100,newGroupDelay:500,joinToEvent:(t,e)=>e},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,e)=>(i,n)=>t(i,n)||e(i,n)})}}),Oh=yt.define({create(){return _t.empty},update(s,t){let e=t.state.facet(Dh),i=t.annotation(rr);if(i){let a=wt.fromTransaction(t,i.selection),c=i.side,h=c==0?s.undone:s.done;return a?h=Bn(h,h.length,e.minDepth,a):h=Ph(h,t.startState.selection),new _t(c==0?i.rest:h,c==0?h:i.rest)}let n=t.annotation(Qd);if((n=="full"||n=="before")&&(s=s.isolate()),t.annotation(Z.addToHistory)===!1)return t.changes.empty?s:s.addMapping(t.changes.desc);let r=wt.fromTransaction(t),o=t.annotation(Z.time),l=t.annotation(Z.userEvent);return r?s=s.addChanges(r,o,l,e,t):t.selection&&(s=s.addSelection(t.startState.selection,o,l,e.newGroupDelay)),(n=="full"||n=="after")&&(s=s.isolate()),s},toJSON(s){return{done:s.done.map(t=>t.toJSON()),undone:s.undone.map(t=>t.toJSON())}},fromJSON(s){return new _t(s.done.map(wt.fromJSON),s.undone.map(wt.fromJSON))}});function Fm(s={}){return[Oh,Dh.of(s),O.domEventHandlers({beforeinput(t,e){let i=t.inputType=="historyUndo"?Th:t.inputType=="historyRedo"?or:null;return i?(t.preventDefault(),i(e)):!1}})]}function jn(s,t){return function({state:e,dispatch:i}){if(!t&&e.readOnly)return!1;let n=e.field(Oh,!1);if(!n)return!1;let r=n.pop(s,e,t);return r?(i(r),!0):!1}}const Th=jn(0,!1),or=jn(1,!1),tp=jn(0,!0),ep=jn(1,!0);class wt{constructor(t,e,i,n,r){this.changes=t,this.effects=e,this.mapped=i,this.startSelection=n,this.selectionsAfter=r}setSelAfter(t){return new wt(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,e,i;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(e=this.mapped)===null||e===void 0?void 0:e.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(n=>n.toJSON())}}static fromJSON(t){return new wt(t.changes&&tt.fromJSON(t.changes),[],t.mapped&&Qt.fromJSON(t.mapped),t.startSelection&&b.fromJSON(t.startSelection),t.selectionsAfter.map(b.fromJSON))}static fromTransaction(t,e){let i=Lt;for(let n of t.startState.facet(Zd)){let r=n(t);r.length&&(i=i.concat(r))}return!i.length&&t.changes.empty?null:new wt(t.changes.invert(t.startState.doc),i,void 0,e||t.startState.selection,Lt)}static selection(t){return new wt(void 0,Lt,void 0,void 0,t)}}function Bn(s,t,e,i){let n=t+1>e+20?t-e-1:0,r=s.slice(n,t);return r.push(i),r}function ip(s,t){let e=[],i=!1;return s.iterChangedRanges((n,r)=>e.push(n,r)),t.iterChangedRanges((n,r,o,l)=>{for(let a=0;a=c&&o<=h&&(i=!0)}}),i}function np(s,t){return s.ranges.length==t.ranges.length&&s.ranges.filter((e,i)=>e.empty!=t.ranges[i].empty).length===0}function Bh(s,t){return s.length?t.length?s.concat(t):s:t}const Lt=[],sp=200;function Ph(s,t){if(s.length){let e=s[s.length-1],i=e.selectionsAfter.slice(Math.max(0,e.selectionsAfter.length-sp));return i.length&&i[i.length-1].eq(t)?s:(i.push(t),Bn(s,s.length-1,1e9,e.setSelAfter(i)))}else return[wt.selection([t])]}function rp(s){let t=s[s.length-1],e=s.slice();return e[s.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),e}function fs(s,t){if(!s.length)return s;let e=s.length,i=Lt;for(;e;){let n=op(s[e-1],t,i);if(n.changes&&!n.changes.empty||n.effects.length){let r=s.slice(0,e);return r[e-1]=n,r}else t=n.mapped,e--,i=n.selectionsAfter}return i.length?[wt.selection(i)]:Lt}function op(s,t,e){let i=Bh(s.selectionsAfter.length?s.selectionsAfter.map(l=>l.map(t)):Lt,e);if(!s.changes)return wt.selection(i);let n=s.changes.map(t),r=t.mapDesc(s.changes,!0),o=s.mapped?s.mapped.composeDesc(r):r;return new wt(n,N.mapEffects(s.effects,t),o,s.startSelection.map(r),i)}const lp=/^(input\.type|delete)($|\.)/;class _t{constructor(t,e,i=0,n=void 0){this.done=t,this.undone=e,this.prevTime=i,this.prevUserEvent=n}isolate(){return this.prevTime?new _t(this.done,this.undone):this}addChanges(t,e,i,n,r){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&t.changes&&(!i||lp.test(i))&&(!l.selectionsAfter.length&&e-this.prevTime0&&e-this.prevTimee.empty?s.moveByChar(e,t):Un(e,t))}function dt(s){return s.textDirectionAt(s.state.selection.main.head)==X.LTR}const Lh=s=>Rh(s,!dt(s)),Eh=s=>Rh(s,dt(s));function Ih(s,t){return Wt(s,e=>e.empty?s.moveByGroup(e,t):Un(e,t))}const ap=s=>Ih(s,!dt(s)),hp=s=>Ih(s,dt(s));function cp(s,t,e){if(t.type.prop(e))return!0;let i=t.to-t.from;return i&&(i>2||/[^\s,.;:]/.test(s.sliceDoc(t.from,t.to)))||t.firstChild}function Gn(s,t,e){let i=St(s).resolveInner(t.head),n=e?L.closedBy:L.openedBy;for(let a=t.head;;){let c=e?i.childAfter(a):i.childBefore(a);if(!c)break;cp(s,c,n)?i=c:a=e?c.to:c.from}let r=i.type.prop(n),o,l;return r&&(o=e?Xt(s,i.from,1):Xt(s,i.to,-1))&&o.matched?l=e?o.end.to:o.end.from:l=e?i.to:i.from,b.cursor(l,e?-1:1)}const fp=s=>Wt(s,t=>Gn(s.state,t,!dt(s))),up=s=>Wt(s,t=>Gn(s.state,t,dt(s)));function Nh(s,t){return Wt(s,e=>{if(!e.empty)return Un(e,t);let i=s.moveVertically(e,t);return i.head!=e.head?i:s.moveToLineBoundary(e,t)})}const Fh=s=>Nh(s,!1),Vh=s=>Nh(s,!0);function Hh(s){let t=s.scrollDOM.clientHeighto.empty?s.moveVertically(o,t,e.height):Un(o,t));if(n.eq(i.selection))return!1;let r;if(e.selfScroll){let o=s.coordsAtPos(i.selection.main.head),l=s.scrollDOM.getBoundingClientRect(),a=l.top+e.marginTop,c=l.bottom-e.marginBottom;o&&o.top>a&&o.bottomWh(s,!1),lr=s=>Wh(s,!0);function be(s,t,e){let i=s.lineBlockAt(t.head),n=s.moveToLineBoundary(t,e);if(n.head==t.head&&n.head!=(e?i.to:i.from)&&(n=s.moveToLineBoundary(t,e,!1)),!e&&n.head==i.from&&i.length){let r=/^\s*/.exec(s.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;r&&t.head!=i.from+r&&(n=b.cursor(i.from+r))}return n}const dp=s=>Wt(s,t=>be(s,t,!0)),pp=s=>Wt(s,t=>be(s,t,!1)),gp=s=>Wt(s,t=>be(s,t,!dt(s))),mp=s=>Wt(s,t=>be(s,t,dt(s))),yp=s=>Wt(s,t=>b.cursor(s.lineBlockAt(t.head).from,1)),bp=s=>Wt(s,t=>b.cursor(s.lineBlockAt(t.head).to,-1));function xp(s,t,e){let i=!1,n=ni(s.selection,r=>{let o=Xt(s,r.head,-1)||Xt(s,r.head,1)||r.head>0&&Xt(s,r.head-1,1)||r.headxp(s,t);function Ft(s,t){let e=ni(s.state.selection,i=>{let n=t(i);return b.range(i.anchor,n.head,n.goalColumn,n.bidiLevel||void 0)});return e.eq(s.state.selection)?!1:(s.dispatch(te(s.state,e)),!0)}function zh(s,t){return Ft(s,e=>s.moveByChar(e,t))}const qh=s=>zh(s,!dt(s)),Kh=s=>zh(s,dt(s));function $h(s,t){return Ft(s,e=>s.moveByGroup(e,t))}const Sp=s=>$h(s,!dt(s)),kp=s=>$h(s,dt(s)),vp=s=>Ft(s,t=>Gn(s.state,t,!dt(s))),Cp=s=>Ft(s,t=>Gn(s.state,t,dt(s)));function jh(s,t){return Ft(s,e=>s.moveVertically(e,t))}const Uh=s=>jh(s,!1),Gh=s=>jh(s,!0);function Jh(s,t){return Ft(s,e=>s.moveVertically(e,t,Hh(s).height))}const ul=s=>Jh(s,!1),dl=s=>Jh(s,!0),Ap=s=>Ft(s,t=>be(s,t,!0)),Mp=s=>Ft(s,t=>be(s,t,!1)),Dp=s=>Ft(s,t=>be(s,t,!dt(s))),Op=s=>Ft(s,t=>be(s,t,dt(s))),Tp=s=>Ft(s,t=>b.cursor(s.lineBlockAt(t.head).from)),Bp=s=>Ft(s,t=>b.cursor(s.lineBlockAt(t.head).to)),pl=({state:s,dispatch:t})=>(t(te(s,{anchor:0})),!0),gl=({state:s,dispatch:t})=>(t(te(s,{anchor:s.doc.length})),!0),ml=({state:s,dispatch:t})=>(t(te(s,{anchor:s.selection.main.anchor,head:0})),!0),yl=({state:s,dispatch:t})=>(t(te(s,{anchor:s.selection.main.anchor,head:s.doc.length})),!0),Pp=({state:s,dispatch:t})=>(t(s.update({selection:{anchor:0,head:s.doc.length},userEvent:"select"})),!0),Rp=({state:s,dispatch:t})=>{let e=Jn(s).map(({from:i,to:n})=>b.range(i,Math.min(n+1,s.doc.length)));return t(s.update({selection:b.create(e),userEvent:"select"})),!0},Lp=({state:s,dispatch:t})=>{let e=ni(s.selection,i=>{let n=St(s),r=n.resolveStack(i.from,1);if(i.empty){let o=n.resolveStack(i.from,-1);o.node.from>=r.node.from&&o.node.to<=r.node.to&&(r=o)}for(let o=r;o;o=o.next){let{node:l}=o;if((l.from=i.to||l.to>i.to&&l.from<=i.from)&&o.next)return b.range(l.to,l.from)}return i});return e.eq(s.selection)?!1:(t(te(s,e)),!0)},Ep=({state:s,dispatch:t})=>{let e=s.selection,i=null;return e.ranges.length>1?i=b.create([e.main]):e.main.empty||(i=b.create([b.cursor(e.main.head)])),i?(t(te(s,i)),!0):!1};function Vi(s,t){if(s.state.readOnly)return!1;let e="delete.selection",{state:i}=s,n=i.changeByRange(r=>{let{from:o,to:l}=r;if(o==l){let a=t(r);ao&&(e="delete.forward",a=rn(s,a,!0)),o=Math.min(o,a),l=Math.max(l,a)}else o=rn(s,o,!1),l=rn(s,l,!0);return o==l?{range:r}:{changes:{from:o,to:l},range:b.cursor(o,on(s)))i.between(t,t,(n,r)=>{nt&&(t=e?r:n)});return t}const Yh=(s,t,e)=>Vi(s,i=>{let n=i.from,{state:r}=s,o=r.doc.lineAt(n),l,a;if(e&&!t&&n>o.from&&nYh(s,!1,!0),Xh=s=>Yh(s,!0,!1),_h=(s,t)=>Vi(s,e=>{let i=e.head,{state:n}=s,r=n.doc.lineAt(i),o=n.charCategorizer(i);for(let l=null;;){if(i==(t?r.to:r.from)){i==e.head&&r.number!=(t?n.doc.lines:1)&&(i+=t?1:-1);break}let a=ot(r.text,i-r.from,t)+r.from,c=r.text.slice(Math.min(i,a)-r.from,Math.max(i,a)-r.from),h=o(c);if(l!=null&&h!=l)break;(c!=" "||i!=e.head)&&(l=h),i=a}return i}),Qh=s=>_h(s,!1),Ip=s=>_h(s,!0),Np=s=>Vi(s,t=>{let e=s.lineBlockAt(t.head).to;return t.headVi(s,t=>{let e=s.moveToLineBoundary(t,!1).head;return t.head>e?e:Math.max(0,t.head-1)}),Vp=s=>Vi(s,t=>{let e=s.moveToLineBoundary(t,!0).head;return t.head{if(s.readOnly)return!1;let e=s.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:F.of(["",""])},range:b.cursor(i.from)}));return t(s.update(e,{scrollIntoView:!0,userEvent:"input"})),!0},Wp=({state:s,dispatch:t})=>{if(s.readOnly)return!1;let e=s.changeByRange(i=>{if(!i.empty||i.from==0||i.from==s.doc.length)return{range:i};let n=i.from,r=s.doc.lineAt(n),o=n==r.from?n-1:ot(r.text,n-r.from,!1)+r.from,l=n==r.to?n+1:ot(r.text,n-r.from,!0)+r.from;return{changes:{from:o,to:l,insert:s.doc.slice(n,l).append(s.doc.slice(o,n))},range:b.cursor(l)}});return e.changes.empty?!1:(t(s.update(e,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Jn(s){let t=[],e=-1;for(let i of s.selection.ranges){let n=s.doc.lineAt(i.from),r=s.doc.lineAt(i.to);if(!i.empty&&i.to==r.from&&(r=s.doc.lineAt(i.to-1)),e>=n.number){let o=t[t.length-1];o.to=r.to,o.ranges.push(i)}else t.push({from:n.from,to:r.to,ranges:[i]});e=r.number+1}return t}function Zh(s,t,e){if(s.readOnly)return!1;let i=[],n=[];for(let r of Jn(s)){if(e?r.to==s.doc.length:r.from==0)continue;let o=s.doc.lineAt(e?r.to+1:r.from-1),l=o.length+1;if(e){i.push({from:r.to,to:o.to},{from:r.from,insert:o.text+s.lineBreak});for(let a of r.ranges)n.push(b.range(Math.min(s.doc.length,a.anchor+l),Math.min(s.doc.length,a.head+l)))}else{i.push({from:o.from,to:r.from},{from:r.to,insert:s.lineBreak+o.text});for(let a of r.ranges)n.push(b.range(a.anchor-l,a.head-l))}}return i.length?(t(s.update({changes:i,scrollIntoView:!0,selection:b.create(n,s.selection.mainIndex),userEvent:"move.line"})),!0):!1}const zp=({state:s,dispatch:t})=>Zh(s,t,!1),qp=({state:s,dispatch:t})=>Zh(s,t,!0);function tc(s,t,e){if(s.readOnly)return!1;let i=[];for(let n of Jn(s))e?i.push({from:n.from,insert:s.doc.slice(n.from,n.to)+s.lineBreak}):i.push({from:n.to,insert:s.lineBreak+s.doc.slice(n.from,n.to)});return t(s.update({changes:i,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Kp=({state:s,dispatch:t})=>tc(s,t,!1),$p=({state:s,dispatch:t})=>tc(s,t,!0),jp=s=>{if(s.state.readOnly)return!1;let{state:t}=s,e=t.changes(Jn(t).map(({from:n,to:r})=>(n>0?n--:r{let r;if(s.lineWrapping){let o=s.lineBlockAt(n.head),l=s.coordsAtPos(n.head,n.assoc||1);l&&(r=o.bottom+s.documentTop-l.bottom+s.defaultLineHeight/2)}return s.moveVertically(n,!0,r)}).map(e);return s.dispatch({changes:e,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function Up(s,t){if(/\(\)|\[\]|\{\}/.test(s.sliceDoc(t-1,t+1)))return{from:t,to:t};let e=St(s).resolveInner(t),i=e.childBefore(t),n=e.childAfter(t),r;return i&&n&&i.to<=t&&n.from>=t&&(r=i.type.prop(L.closedBy))&&r.indexOf(n.name)>-1&&s.doc.lineAt(i.to).from==s.doc.lineAt(n.from).from&&!/\S/.test(s.sliceDoc(i.to,n.from))?{from:i.to,to:n.from}:null}const bl=ec(!1),Gp=ec(!0);function ec(s){return({state:t,dispatch:e})=>{if(t.readOnly)return!1;let i=t.changeByRange(n=>{let{from:r,to:o}=n,l=t.doc.lineAt(r),a=!s&&r==o&&Up(t,r);s&&(r=o=(o<=l.to?l:t.doc.lineAt(o)).to);let c=new Kn(t,{simulateBreak:r,simulateDoubleBreak:!!a}),h=fh(c,r);for(h==null&&(h=ii(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize));ol.from&&r{let n=[];for(let o=i.from;o<=i.to;){let l=s.doc.lineAt(o);l.number>e&&(i.empty||i.to>l.from)&&(t(l,n,i),e=l.number),o=l.to+1}let r=s.changes(n);return{changes:n,range:b.range(r.mapPos(i.anchor,1),r.mapPos(i.head,1))}})}const Jp=({state:s,dispatch:t})=>{if(s.readOnly)return!1;let e=Object.create(null),i=new Kn(s,{overrideIndentation:r=>{let o=e[r];return o??-1}}),n=Ir(s,(r,o,l)=>{let a=fh(i,r.from);if(a==null)return;/\S/.test(r.text)||(a=0);let c=/^\s*/.exec(r.text)[0],h=Tn(s,a);(c!=h||l.froms.readOnly?!1:(t(s.update(Ir(s,(e,i)=>{i.push({from:e.from,insert:s.facet(qn)})}),{userEvent:"input.indent"})),!0),nc=({state:s,dispatch:t})=>s.readOnly?!1:(t(s.update(Ir(s,(e,i)=>{let n=/^\s*/.exec(e.text)[0];if(!n)return;let r=ii(n,s.tabSize),o=0,l=Tn(s,Math.max(0,r-Le(s)));for(;o(s.setTabFocusMode(),!0),Xp=[{key:"Ctrl-b",run:Lh,shift:qh,preventDefault:!0},{key:"Ctrl-f",run:Eh,shift:Kh},{key:"Ctrl-p",run:Fh,shift:Uh},{key:"Ctrl-n",run:Vh,shift:Gh},{key:"Ctrl-a",run:yp,shift:Tp},{key:"Ctrl-e",run:bp,shift:Bp},{key:"Ctrl-d",run:Xh},{key:"Ctrl-h",run:ar},{key:"Ctrl-k",run:Np},{key:"Ctrl-Alt-h",run:Qh},{key:"Ctrl-o",run:Hp},{key:"Ctrl-t",run:Wp},{key:"Ctrl-v",run:lr}],_p=[{key:"ArrowLeft",run:Lh,shift:qh,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:ap,shift:Sp,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:gp,shift:Dp,preventDefault:!0},{key:"ArrowRight",run:Eh,shift:Kh,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:hp,shift:kp,preventDefault:!0},{mac:"Cmd-ArrowRight",run:mp,shift:Op,preventDefault:!0},{key:"ArrowUp",run:Fh,shift:Uh,preventDefault:!0},{mac:"Cmd-ArrowUp",run:pl,shift:ml},{mac:"Ctrl-ArrowUp",run:fl,shift:ul},{key:"ArrowDown",run:Vh,shift:Gh,preventDefault:!0},{mac:"Cmd-ArrowDown",run:gl,shift:yl},{mac:"Ctrl-ArrowDown",run:lr,shift:dl},{key:"PageUp",run:fl,shift:ul},{key:"PageDown",run:lr,shift:dl},{key:"Home",run:pp,shift:Mp,preventDefault:!0},{key:"Mod-Home",run:pl,shift:ml},{key:"End",run:dp,shift:Ap,preventDefault:!0},{key:"Mod-End",run:gl,shift:yl},{key:"Enter",run:bl,shift:bl},{key:"Mod-a",run:Pp},{key:"Backspace",run:ar,shift:ar},{key:"Delete",run:Xh},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Qh},{key:"Mod-Delete",mac:"Alt-Delete",run:Ip},{mac:"Mod-Backspace",run:Fp},{mac:"Mod-Delete",run:Vp}].concat(Xp.map(s=>({mac:s.key,run:s.run,shift:s.shift}))),Hm=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:fp,shift:vp},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:up,shift:Cp},{key:"Alt-ArrowUp",run:zp},{key:"Shift-Alt-ArrowUp",run:Kp},{key:"Alt-ArrowDown",run:qp},{key:"Shift-Alt-ArrowDown",run:$p},{key:"Escape",run:Ep},{key:"Mod-Enter",run:Gp},{key:"Alt-l",mac:"Ctrl-l",run:Rp},{key:"Mod-i",run:Lp,preventDefault:!0},{key:"Mod-[",run:nc},{key:"Mod-]",run:ic},{key:"Mod-Alt-\\",run:Jp},{key:"Shift-Mod-k",run:jp},{key:"Shift-Mod-\\",run:wp},{key:"Mod-/",run:jd},{key:"Alt-A",run:Gd},{key:"Ctrl-m",mac:"Shift-Alt-m",run:Yp}].concat(_p),Wm={key:"Tab",run:ic,shift:nc};function lt(){var s=arguments[0];typeof s=="string"&&(s=document.createElement(s));var t=1,e=arguments[1];if(e&&typeof e=="object"&&e.nodeType==null&&!Array.isArray(e)){for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var n=e[i];typeof n=="string"?s.setAttribute(i,n):n!=null&&(s[i]=n)}t++}for(;ts.normalize("NFKD"):s=>s;class ei{constructor(t,e,i=0,n=t.length,r,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(i,n),this.bufferStart=i,this.normalize=r?l=>r(xl(l)):xl,this.query=this.normalize(e)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return st(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let e=fr(t),i=this.bufferStart+this.bufferPos;this.bufferPos+=Bt(t);let n=this.normalize(e);if(n.length)for(let r=0,o=i;;r++){let l=n.charCodeAt(r),a=this.match(l,o,this.bufferPos+this.bufferStart);if(r==n.length-1){if(a)return this.value=a,this;break}o==i&&rthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let e=this.matchPos<=this.to&&this.re.exec(this.curLine);if(e){let i=this.curLineStart+e.index,n=i+e[0].length;if(this.matchPos=Pn(this.text,n+(i==n?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(ithis.value.to)&&(!this.test||this.test(i,n,e)))return this.value={from:i,to:n,match:e},this;t=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=i||n.to<=e){let l=new je(e,t.sliceString(e,i));return us.set(t,l),l}if(n.from==e&&n.to==i)return n;let{text:r,from:o}=n;return o>e&&(r=t.sliceString(e,o)+r,o=e),n.to=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,e=this.re.exec(this.flat.text);if(e&&!e[0]&&e.index==t&&(this.re.lastIndex=t+1,e=this.re.exec(this.flat.text)),e){let i=this.flat.from+e.index,n=i+e[0].length;if((this.flat.to>=this.to||e.index+e[0].length<=this.flat.text.length-10)&&(!this.test||this.test(i,n,e)))return this.value={from:i,to:n,match:e},this.matchPos=Pn(this.text,n+(i==n?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=je.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(oc.prototype[Symbol.iterator]=lc.prototype[Symbol.iterator]=function(){return this});function Qp(s){try{return new RegExp(s,Nr),!0}catch{return!1}}function Pn(s,t){if(t>=s.length)return t;let e=s.lineAt(t),i;for(;t=56320&&i<57344;)t++;return t}function hr(s){let t=String(s.state.doc.lineAt(s.state.selection.main.head).number),e=lt("input",{class:"cm-textfield",name:"line",value:t}),i=lt("form",{class:"cm-gotoLine",onkeydown:r=>{r.keyCode==27?(r.preventDefault(),s.dispatch({effects:Rn.of(!1)}),s.focus()):r.keyCode==13&&(r.preventDefault(),n())},onsubmit:r=>{r.preventDefault(),n()}},lt("label",s.state.phrase("Go to line"),": ",e)," ",lt("button",{class:"cm-button",type:"submit"},s.state.phrase("go")));function n(){let r=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(e.value);if(!r)return;let{state:o}=s,l=o.doc.lineAt(o.selection.main.head),[,a,c,h,f]=r,u=h?+h.slice(1):0,d=c?+c:l.number;if(c&&f){let m=d/100;a&&(m=m*(a=="-"?-1:1)+l.number/o.doc.lines),d=Math.round(o.doc.lines*m)}else c&&a&&(d=d*(a=="-"?-1:1)+l.number);let p=o.doc.line(Math.max(1,Math.min(o.doc.lines,d))),g=b.cursor(p.from+Math.max(0,Math.min(u,p.length)));s.dispatch({effects:[Rn.of(!1),O.scrollIntoView(g.from,{y:"center"})],selection:g}),s.focus()}return{dom:i}}const Rn=N.define(),wl=yt.define({create(){return!0},update(s,t){for(let e of t.effects)e.is(Rn)&&(s=e.value);return s},provide:s=>An.from(s,t=>t?hr:null)}),Zp=s=>{let t=Cn(s,hr);if(!t){let e=[Rn.of(!0)];s.state.field(wl,!1)==null&&e.push(N.appendConfig.of([wl,tg])),s.dispatch({effects:e}),t=Cn(s,hr)}return t&&t.dom.querySelector("input").select(),!0},tg=O.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),eg={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},ig=T.define({combine(s){return Ee(s,eg,{highlightWordAroundCursor:(t,e)=>t||e,minSelectionLength:Math.min,maxMatches:Math.min})}});function zm(s){return[lg,og]}const ng=P.mark({class:"cm-selectionMatch"}),sg=P.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Sl(s,t,e,i){return(e==0||s(t.sliceDoc(e-1,e))!=J.Word)&&(i==t.doc.length||s(t.sliceDoc(i,i+1))!=J.Word)}function rg(s,t,e,i){return s(t.sliceDoc(e,e+1))==J.Word&&s(t.sliceDoc(i-1,i))==J.Word}const og=ut.fromClass(class{constructor(s){this.decorations=this.getDeco(s)}update(s){(s.selectionSet||s.docChanged||s.viewportChanged)&&(this.decorations=this.getDeco(s.view))}getDeco(s){let t=s.state.facet(ig),{state:e}=s,i=e.selection;if(i.ranges.length>1)return P.none;let n=i.main,r,o=null;if(n.empty){if(!t.highlightWordAroundCursor)return P.none;let a=e.wordAt(n.head);if(!a)return P.none;o=e.charCategorizer(n.head),r=e.sliceDoc(a.from,a.to)}else{let a=n.to-n.from;if(a200)return P.none;if(t.wholeWords){if(r=e.sliceDoc(n.from,n.to),o=e.charCategorizer(n.head),!(Sl(o,e,n.from,n.to)&&rg(o,e,n.from,n.to)))return P.none}else if(r=e.sliceDoc(n.from,n.to),!r)return P.none}let l=[];for(let a of s.visibleRanges){let c=new ei(e.doc,r,a.from,a.to);for(;!c.next().done;){let{from:h,to:f}=c.value;if((!o||Sl(o,e,h,f))&&(n.empty&&h<=n.from&&f>=n.to?l.push(sg.range(h,f)):(h>=n.to||f<=n.from)&&l.push(ng.range(h,f)),l.length>t.maxMatches))return P.none}}return P.set(l)}},{decorations:s=>s.decorations}),lg=O.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),ag=({state:s,dispatch:t})=>{let{selection:e}=s,i=b.create(e.ranges.map(n=>s.wordAt(n.head)||b.cursor(n.head)),e.mainIndex);return i.eq(e)?!1:(t(s.update({selection:i})),!0)};function hg(s,t){let{main:e,ranges:i}=s.selection,n=s.wordAt(e.head),r=n&&n.from==e.from&&n.to==e.to;for(let o=!1,l=new ei(s.doc,t,i[i.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new ei(s.doc,t,0,Math.max(0,i[i.length-1].from-1)),o=!0}else{if(o&&i.some(a=>a.from==l.value.from))continue;if(r){let a=s.wordAt(l.value.from);if(!a||a.from!=l.value.from||a.to!=l.value.to)continue}return l.value}}const cg=({state:s,dispatch:t})=>{let{ranges:e}=s.selection;if(e.some(r=>r.from===r.to))return ag({state:s,dispatch:t});let i=s.sliceDoc(e[0].from,e[0].to);if(s.selection.ranges.some(r=>s.sliceDoc(r.from,r.to)!=i))return!1;let n=hg(s,i);return n?(t(s.update({selection:s.selection.addRange(b.range(n.from,n.to),!1),effects:O.scrollIntoView(n.to)})),!0):!1},si=T.define({combine(s){return Ee(s,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new Sg(t),scrollToMatch:t=>O.scrollIntoView(t)})}});class ac{constructor(t){this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||Qp(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,(e,i)=>i=="n"?` -`:i=="r"?"\r":i=="t"?" ":"\\")}eq(t){return this.search==t.search&&this.replace==t.replace&&this.caseSensitive==t.caseSensitive&&this.regexp==t.regexp&&this.wholeWord==t.wholeWord}create(){return this.regexp?new pg(this):new ug(this)}getCursor(t,e=0,i){let n=t.doc?t:H.create({doc:t});return i==null&&(i=n.doc.length),this.regexp?He(this,n,e,i):Ve(this,n,e,i)}}class hc{constructor(t){this.spec=t}}function Ve(s,t,e,i){return new ei(t.doc,s.unquoted,e,i,s.caseSensitive?void 0:n=>n.toLowerCase(),s.wholeWord?fg(t.doc,t.charCategorizer(t.selection.main.head)):void 0)}function fg(s,t){return(e,i,n,r)=>((r>e||r+n.length=e)return null;n.push(i.value)}return n}highlight(t,e,i,n){let r=Ve(this.spec,t,Math.max(0,e-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,t.doc.length));for(;!r.next().done;)n(r.value.from,r.value.to)}}function He(s,t,e,i){return new oc(t.doc,s.search,{ignoreCase:!s.caseSensitive,test:s.wholeWord?dg(t.charCategorizer(t.selection.main.head)):void 0},e,i)}function Ln(s,t){return s.slice(ot(s,t,!1),t)}function En(s,t){return s.slice(t,ot(s,t))}function dg(s){return(t,e,i)=>!i[0].length||(s(Ln(i.input,i.index))!=J.Word||s(En(i.input,i.index))!=J.Word)&&(s(En(i.input,i.index+i[0].length))!=J.Word||s(Ln(i.input,i.index+i[0].length))!=J.Word)}class pg extends hc{nextMatch(t,e,i){let n=He(this.spec,t,i,t.doc.length).next();return n.done&&(n=He(this.spec,t,0,e).next()),n.done?null:n.value}prevMatchInRange(t,e,i){for(let n=1;;n++){let r=Math.max(e,i-n*1e4),o=He(this.spec,t,r,i),l=null;for(;!o.next().done;)l=o.value;if(l&&(r==e||l.from>r+10))return l;if(r==e)return null}}prevMatch(t,e,i){return this.prevMatchInRange(t,0,e)||this.prevMatchInRange(t,i,t.doc.length)}getReplacement(t){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,(e,i)=>i=="$"?"$":i=="&"?t.match[0]:i!="0"&&+i=e)return null;n.push(i.value)}return n}highlight(t,e,i,n){let r=He(this.spec,t,Math.max(0,e-250),Math.min(i+250,t.doc.length));for(;!r.next().done;)n(r.value.from,r.value.to)}}const Bi=N.define(),Fr=N.define(),ue=yt.define({create(s){return new ds(cr(s).create(),null)},update(s,t){for(let e of t.effects)e.is(Bi)?s=new ds(e.value.create(),s.panel):e.is(Fr)&&(s=new ds(s.query,e.value?Vr:null));return s},provide:s=>An.from(s,t=>t.panel)});class ds{constructor(t,e){this.query=t,this.panel=e}}const gg=P.mark({class:"cm-searchMatch"}),mg=P.mark({class:"cm-searchMatch cm-searchMatch-selected"}),yg=ut.fromClass(class{constructor(s){this.view=s,this.decorations=this.highlight(s.state.field(ue))}update(s){let t=s.state.field(ue);(t!=s.startState.field(ue)||s.docChanged||s.selectionSet||s.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:s,panel:t}){if(!t||!s.spec.valid)return P.none;let{view:e}=this,i=new Oe;for(let n=0,r=e.visibleRanges,o=r.length;nr[n+1].from-2*250;)a=r[++n].to;s.highlight(e.state,l,a,(c,h)=>{let f=e.state.selection.ranges.some(u=>u.from==c&&u.to==h);i.add(c,h,f?mg:gg)})}return i.finish()}},{decorations:s=>s.decorations});function Hi(s){return t=>{let e=t.state.field(ue,!1);return e&&e.query.spec.valid?s(t,e):uc(t)}}const In=Hi((s,{query:t})=>{let{to:e}=s.state.selection.main,i=t.nextMatch(s.state,e,e);if(!i)return!1;let n=b.single(i.from,i.to),r=s.state.facet(si);return s.dispatch({selection:n,effects:[Hr(s,i),r.scrollToMatch(n.main,s)],userEvent:"select.search"}),fc(s),!0}),Nn=Hi((s,{query:t})=>{let{state:e}=s,{from:i}=e.selection.main,n=t.prevMatch(e,i,i);if(!n)return!1;let r=b.single(n.from,n.to),o=s.state.facet(si);return s.dispatch({selection:r,effects:[Hr(s,n),o.scrollToMatch(r.main,s)],userEvent:"select.search"}),fc(s),!0}),bg=Hi((s,{query:t})=>{let e=t.matchAll(s.state,1e3);return!e||!e.length?!1:(s.dispatch({selection:b.create(e.map(i=>b.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),xg=({state:s,dispatch:t})=>{let e=s.selection;if(e.ranges.length>1||e.main.empty)return!1;let{from:i,to:n}=e.main,r=[],o=0;for(let l=new ei(s.doc,s.sliceDoc(i,n));!l.next().done;){if(r.length>1e3)return!1;l.value.from==i&&(o=r.length),r.push(b.range(l.value.from,l.value.to))}return t(s.update({selection:b.create(r,o),userEvent:"select.search.matches"})),!0},kl=Hi((s,{query:t})=>{let{state:e}=s,{from:i,to:n}=e.selection.main;if(e.readOnly)return!1;let r=t.nextMatch(e,i,i);if(!r)return!1;let o=r,l=[],a,c,h=[];if(o.from==i&&o.to==n&&(c=e.toText(t.getReplacement(o)),l.push({from:o.from,to:o.to,insert:c}),o=t.nextMatch(e,o.from,o.to),h.push(O.announce.of(e.phrase("replaced match on line $",e.doc.lineAt(i).number)+"."))),o){let f=l.length==0||l[0].from>=r.to?0:r.to-r.from-c.length;a=b.single(o.from-f,o.to-f),h.push(Hr(s,o)),h.push(e.facet(si).scrollToMatch(a.main,s))}return s.dispatch({changes:l,selection:a,effects:h,userEvent:"input.replace"}),!0}),wg=Hi((s,{query:t})=>{if(s.state.readOnly)return!1;let e=t.matchAll(s.state,1e9).map(n=>{let{from:r,to:o}=n;return{from:r,to:o,insert:t.getReplacement(n)}});if(!e.length)return!1;let i=s.state.phrase("replaced $ matches",e.length)+".";return s.dispatch({changes:e,effects:O.announce.of(i),userEvent:"input.replace.all"}),!0});function Vr(s){return s.state.facet(si).createPanel(s)}function cr(s,t){var e,i,n,r,o;let l=s.selection.main,a=l.empty||l.to>l.from+100?"":s.sliceDoc(l.from,l.to);if(t&&!a)return t;let c=s.facet(si);return new ac({search:((e=t==null?void 0:t.literal)!==null&&e!==void 0?e:c.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:(i=t==null?void 0:t.caseSensitive)!==null&&i!==void 0?i:c.caseSensitive,literal:(n=t==null?void 0:t.literal)!==null&&n!==void 0?n:c.literal,regexp:(r=t==null?void 0:t.regexp)!==null&&r!==void 0?r:c.regexp,wholeWord:(o=t==null?void 0:t.wholeWord)!==null&&o!==void 0?o:c.wholeWord})}function cc(s){let t=Cn(s,Vr);return t&&t.dom.querySelector("[main-field]")}function fc(s){let t=cc(s);t&&t==s.root.activeElement&&t.select()}const uc=s=>{let t=s.state.field(ue,!1);if(t&&t.panel){let e=cc(s);if(e&&e!=s.root.activeElement){let i=cr(s.state,t.query.spec);i.valid&&s.dispatch({effects:Bi.of(i)}),e.focus(),e.select()}}else s.dispatch({effects:[Fr.of(!0),t?Bi.of(cr(s.state,t.query.spec)):N.appendConfig.of(vg)]});return!0},dc=s=>{let t=s.state.field(ue,!1);if(!t||!t.panel)return!1;let e=Cn(s,Vr);return e&&e.dom.contains(s.root.activeElement)&&s.focus(),s.dispatch({effects:Fr.of(!1)}),!0},qm=[{key:"Mod-f",run:uc,scope:"editor search-panel"},{key:"F3",run:In,shift:Nn,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:In,shift:Nn,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:dc,scope:"editor search-panel"},{key:"Mod-Shift-l",run:xg},{key:"Mod-Alt-g",run:Zp},{key:"Mod-d",run:cg,preventDefault:!0}];class Sg{constructor(t){this.view=t;let e=this.query=t.state.field(ue).query.spec;this.commit=this.commit.bind(this),this.searchField=lt("input",{value:e.search,placeholder:vt(t,"Find"),"aria-label":vt(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=lt("input",{value:e.replace,placeholder:vt(t,"Replace"),"aria-label":vt(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=lt("input",{type:"checkbox",name:"case",form:"",checked:e.caseSensitive,onchange:this.commit}),this.reField=lt("input",{type:"checkbox",name:"re",form:"",checked:e.regexp,onchange:this.commit}),this.wordField=lt("input",{type:"checkbox",name:"word",form:"",checked:e.wholeWord,onchange:this.commit});function i(n,r,o){return lt("button",{class:"cm-button",name:n,onclick:r,type:"button"},o)}this.dom=lt("div",{onkeydown:n=>this.keydown(n),class:"cm-search"},[this.searchField,i("next",()=>In(t),[vt(t,"next")]),i("prev",()=>Nn(t),[vt(t,"previous")]),i("select",()=>bg(t),[vt(t,"all")]),lt("label",null,[this.caseField,vt(t,"match case")]),lt("label",null,[this.reField,vt(t,"regexp")]),lt("label",null,[this.wordField,vt(t,"by word")]),...t.state.readOnly?[]:[lt("br"),this.replaceField,i("replace",()=>kl(t),[vt(t,"replace")]),i("replaceAll",()=>wg(t),[vt(t,"replace all")])],lt("button",{name:"close",onclick:()=>dc(t),"aria-label":vt(t,"close"),type:"button"},["×"])])}commit(){let t=new ac({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});t.eq(this.query)||(this.query=t,this.view.dispatch({effects:Bi.of(t)}))}keydown(t){yu(this.view,t,"search-panel")?t.preventDefault():t.keyCode==13&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?Nn:In)(this.view)):t.keyCode==13&&t.target==this.replaceField&&(t.preventDefault(),kl(this.view))}update(t){for(let e of t.transactions)for(let i of e.effects)i.is(Bi)&&!i.value.eq(this.query)&&this.setQuery(i.value)}setQuery(t){this.query=t,this.searchField.value=t.search,this.replaceField.value=t.replace,this.caseField.checked=t.caseSensitive,this.reField.checked=t.regexp,this.wordField.checked=t.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(si).top}}function vt(s,t){return s.state.phrase(t)}const on=30,ln=/[\s\.,:;?!]/;function Hr(s,{from:t,to:e}){let i=s.state.doc.lineAt(t),n=s.state.doc.lineAt(e).to,r=Math.max(i.from,t-on),o=Math.min(n,e+on),l=s.state.sliceDoc(r,o);if(r!=i.from){for(let a=0;al.length-on;a--)if(!ln.test(l[a-1])&&ln.test(l[a])){l=l.slice(0,a);break}}return O.announce.of(`${s.state.phrase("current match")}. ${l} ${s.state.phrase("on line")} ${i.number}.`)}const kg=O.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),vg=[ue,ye.low(yg),kg];class pc{constructor(t,e,i,n){this.state=t,this.pos=e,this.explicit=i,this.view=n,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(t){let e=St(this.state).resolveInner(this.pos,-1);for(;e&&t.indexOf(e.name)<0;)e=e.parent;return e?{from:e.from,to:this.pos,text:this.state.sliceDoc(e.from,this.pos),type:e.type}:null}matchBefore(t){let e=this.state.doc.lineAt(this.pos),i=Math.max(e.from,this.pos-250),n=e.text.slice(i-e.from,this.pos-e.from),r=n.search(gc(t,!1));return r<0?null:{from:i+r,to:this.pos,text:n.slice(r)}}get aborted(){return this.abortListeners==null}addEventListener(t,e,i){t=="abort"&&this.abortListeners&&(this.abortListeners.push(e),i&&i.onDocChange&&(this.abortOnDocChange=!0))}}function vl(s){let t=Object.keys(s).join(""),e=/\w/.test(t);return e&&(t=t.replace(/\w/g,"")),`[${e?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function Cg(s){let t=Object.create(null),e=Object.create(null);for(let{label:n}of s){t[n[0]]=!0;for(let r=1;rtypeof n=="string"?{label:n}:n),[e,i]=t.every(n=>/^\w+$/.test(n.label))?[/\w*$/,/\w+$/]:Cg(t);return n=>{let r=n.matchBefore(i);return r||n.explicit?{from:r?r.from:n.pos,options:t,validFor:e}:null}}function Km(s,t){return e=>{for(let i=St(e.state).resolveInner(e.pos,-1);i;i=i.parent){if(s.indexOf(i.name)>-1)return null;if(i.type.isTop)break}return t(e)}}class Cl{constructor(t,e,i,n){this.completion=t,this.source=e,this.match=i,this.score=n}}function Me(s){return s.selection.main.from}function gc(s,t){var e;let{source:i}=s,n=t&&i[0]!="^",r=i[i.length-1]!="$";return!n&&!r?s:new RegExp(`${n?"^":""}(?:${i})${r?"$":""}`,(e=s.flags)!==null&&e!==void 0?e:s.ignoreCase?"i":"")}const Wr=re.define();function Mg(s,t,e,i){let{main:n}=s.selection,r=e-n.from,o=i-n.from;return Object.assign(Object.assign({},s.changeByRange(l=>{if(l!=n&&e!=i&&s.sliceDoc(l.from+r,l.from+o)!=s.sliceDoc(e,i))return{range:l};let a=s.toText(t);return{changes:{from:l.from+r,to:i==n.from?l.to:l.from+o,insert:a},range:b.cursor(l.from+r+a.length)}})),{scrollIntoView:!0,userEvent:"input.complete"})}const Al=new WeakMap;function Dg(s){if(!Array.isArray(s))return s;let t=Al.get(s);return t||Al.set(s,t=Ag(s)),t}const Fn=N.define(),Pi=N.define();class Og{constructor(t){this.pattern=t,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let e=0;e=48&&w<=57||w>=97&&w<=122?2:w>=65&&w<=90?1:0:(v=fr(w))!=v.toLowerCase()?1:v!=v.toUpperCase()?2:0;(!x||A==1&&m||k==0&&A!=0)&&(e[f]==w||i[f]==w&&(u=!0)?o[f++]=x:o.length&&(y=!1)),k=A,x+=Bt(w)}return f==a&&o[0]==0&&y?this.result(-100+(u?-200:0),o,t):d==a&&p==0?this.ret(-200-t.length+(g==t.length?0:-100),[0,g]):l>-1?this.ret(-700-t.length,[l,l+this.pattern.length]):d==a?this.ret(-900-t.length,[p,g]):f==a?this.result(-100+(u?-200:0)+-700+(y?0:-1100),o,t):e.length==2?null:this.result((n[0]?-700:0)+-200+-1100,n,t)}result(t,e,i){let n=[],r=0;for(let o of e){let l=o+(this.astral?Bt(st(i,o)):1);r&&n[r-1]==o?n[r-1]=l:(n[r++]=o,n[r++]=l)}return this.ret(t-i.length,n)}}class Tg{constructor(t){this.pattern=t,this.matched=[],this.score=0,this.folded=t.toLowerCase()}match(t){if(t.length!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:Bg,filterStrict:!1,compareCompletions:(t,e)=>t.label.localeCompare(e.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(t,e)=>t&&e,closeOnBlur:(t,e)=>t&&e,icons:(t,e)=>t&&e,tooltipClass:(t,e)=>i=>Ml(t(i),e(i)),optionClass:(t,e)=>i=>Ml(t(i),e(i)),addToOptions:(t,e)=>t.concat(e),filterStrict:(t,e)=>t||e})}});function Ml(s,t){return s?t?s+" "+t:s:t}function Bg(s,t,e,i,n,r){let o=s.textDirection==X.RTL,l=o,a=!1,c="top",h,f,u=t.left-n.left,d=n.right-t.right,p=i.right-i.left,g=i.bottom-i.top;if(l&&u=g||x>t.top?h=e.bottom-t.top:(c="bottom",h=t.bottom-e.top)}let m=(t.bottom-t.top)/r.offsetHeight,y=(t.right-t.left)/r.offsetWidth;return{style:`${c}: ${h/m}px; max-width: ${f/y}px`,class:"cm-completionInfo-"+(a?o?"left-narrow":"right-narrow":l?"left":"right")}}function Pg(s){let t=s.addToOptions.slice();return s.icons&&t.push({render(e){let i=document.createElement("div");return i.classList.add("cm-completionIcon"),e.type&&i.classList.add(...e.type.split(/\s+/g).map(n=>"cm-completionIcon-"+n)),i.setAttribute("aria-hidden","true"),i},position:20}),t.push({render(e,i,n,r){let o=document.createElement("span");o.className="cm-completionLabel";let l=e.displayLabel||e.label,a=0;for(let c=0;ca&&o.appendChild(document.createTextNode(l.slice(a,h)));let u=o.appendChild(document.createElement("span"));u.appendChild(document.createTextNode(l.slice(h,f))),u.className="cm-completionMatchedText",a=f}return ae.position-i.position).map(e=>e.render)}function ps(s,t,e){if(s<=e)return{from:0,to:s};if(t<0&&(t=0),t<=s>>1){let n=Math.floor(t/e);return{from:n*e,to:(n+1)*e}}let i=Math.floor((s-t)/e);return{from:s-(i+1)*e,to:s-i*e}}class Rg{constructor(t,e,i){this.view=t,this.stateField=e,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:a=>this.placeInfo(a),key:this},this.space=null,this.currentClass="";let n=t.state.field(e),{options:r,selected:o}=n.open,l=t.state.facet(et);this.optionContent=Pg(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=ps(r.length,o,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(t.state),this.dom.addEventListener("mousedown",a=>{let{options:c}=t.state.field(e).open;for(let h=a.target,f;h&&h!=this.dom;h=h.parentNode)if(h.nodeName=="LI"&&(f=/-(\d+)$/.exec(h.id))&&+f[1]{let c=t.state.field(this.stateField,!1);c&&c.tooltip&&t.state.facet(et).closeOnBlur&&a.relatedTarget!=t.contentDOM&&t.dispatch({effects:Pi.of(null)})}),this.showOptions(r,n.id)}mount(){this.updateSel()}showOptions(t,e){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t,e,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(t){var e;let i=t.state.field(this.stateField),n=t.startState.field(this.stateField);if(this.updateTooltipClass(t.state),i!=n){let{options:r,selected:o,disabled:l}=i.open;(!n.open||n.open.options!=r)&&(this.range=ps(r.length,o,t.state.facet(et).maxRenderedOptions),this.showOptions(r,i.id)),this.updateSel(),l!=((e=n.open)===null||e===void 0?void 0:e.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(t){let e=this.tooltipClass(t);if(e!=this.currentClass){for(let i of this.currentClass.split(" "))i&&this.dom.classList.remove(i);for(let i of e.split(" "))i&&this.dom.classList.add(i);this.currentClass=e}}positioned(t){this.space=t,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let t=this.view.state.field(this.stateField),e=t.open;if((e.selected>-1&&e.selected=this.range.to)&&(this.range=ps(e.options.length,e.selected,this.view.state.facet(et).maxRenderedOptions),this.showOptions(e.options,t.id)),this.updateSelectedOption(e.selected)){this.destroyInfo();let{completion:i}=e.options[e.selected],{info:n}=i;if(!n)return;let r=typeof n=="string"?document.createTextNode(n):n(i);if(!r)return;"then"in r?r.then(o=>{o&&this.view.state.field(this.stateField,!1)==t&&this.addInfoPane(o,i)}).catch(o=>At(this.view.state,o,"completion info")):this.addInfoPane(r,i)}}addInfoPane(t,e){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",t.nodeType!=null)i.appendChild(t),this.infoDestroy=null;else{let{dom:n,destroy:r}=t;i.appendChild(n),this.infoDestroy=r||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(t){let e=null;for(let i=this.list.firstChild,n=this.range.from;i;i=i.nextSibling,n++)i.nodeName!="LI"||!i.id?n--:n==t?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),e=i):i.hasAttribute("aria-selected")&&i.removeAttribute("aria-selected");return e&&Eg(this.list,e),e}measureInfo(){let t=this.dom.querySelector("[aria-selected]");if(!t||!this.info)return null;let e=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),n=t.getBoundingClientRect(),r=this.space;if(!r){let o=this.dom.ownerDocument.defaultView||window;r={left:0,top:0,right:o.innerWidth,bottom:o.innerHeight}}return n.top>Math.min(r.bottom,e.bottom)-10||n.bottomi.from||i.from==0))if(r=u,typeof c!="string"&&c.header)n.appendChild(c.header(c));else{let d=n.appendChild(document.createElement("completion-section"));d.textContent=u}}const h=n.appendChild(document.createElement("li"));h.id=e+"-"+o,h.setAttribute("role","option");let f=this.optionClass(l);f&&(h.className=f);for(let u of this.optionContent){let d=u(l,this.view.state,this.view,a);d&&h.appendChild(d)}}return i.from&&n.classList.add("cm-completionListIncompleteTop"),i.tonew Rg(e,s,t)}function Eg(s,t){let e=s.getBoundingClientRect(),i=t.getBoundingClientRect(),n=e.height/s.offsetHeight;i.tope.bottom&&(s.scrollTop+=(i.bottom-e.bottom)/n)}function Dl(s){return(s.boost||0)*100+(s.apply?10:0)+(s.info?5:0)+(s.type?1:0)}function Ig(s,t){let e=[],i=null,n=c=>{e.push(c);let{section:h}=c.completion;if(h){i||(i=[]);let f=typeof h=="string"?h:h.name;i.some(u=>u.name==f)||i.push(typeof h=="string"?{name:f}:h)}},r=t.facet(et);for(let c of s)if(c.hasResult()){let h=c.result.getMatch;if(c.result.filter===!1)for(let f of c.result.options)n(new Cl(f,c.source,h?h(f):[],1e9-e.length));else{let f=t.sliceDoc(c.from,c.to),u,d=r.filterStrict?new Tg(f):new Og(f);for(let p of c.result.options)if(u=d.match(p.label)){let g=p.displayLabel?h?h(p,u.matched):[]:u.matched;n(new Cl(p,c.source,g,u.score+(p.boost||0)))}}}if(i){let c=Object.create(null),h=0,f=(u,d)=>{var p,g;return((p=u.rank)!==null&&p!==void 0?p:1e9)-((g=d.rank)!==null&&g!==void 0?g:1e9)||(u.namef.score-h.score||a(h.completion,f.completion))){let h=c.completion;!l||l.label!=h.label||l.detail!=h.detail||l.type!=null&&h.type!=null&&l.type!=h.type||l.apply!=h.apply||l.boost!=h.boost?o.push(c):Dl(c.completion)>Dl(l)&&(o[o.length-1]=c),l=c.completion}return o}class We{constructor(t,e,i,n,r,o){this.options=t,this.attrs=e,this.tooltip=i,this.timestamp=n,this.selected=r,this.disabled=o}setSelected(t,e){return t==this.selected||t>=this.options.length?this:new We(this.options,Ol(e,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,e,i,n,r,o){if(n&&!o&&t.some(c=>c.isPending))return n.setDisabled();let l=Ig(t,e);if(!l.length)return n&&t.some(c=>c.isPending)?n.setDisabled():null;let a=e.facet(et).selectOnOpen?0:-1;if(n&&n.selected!=a&&n.selected!=-1){let c=n.options[n.selected].completion;for(let h=0;hh.hasResult()?Math.min(c,h.from):c,1e8),create:zg,above:r.aboveCursor},n?n.timestamp:Date.now(),a,!1)}map(t){return new We(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:t.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}setDisabled(){return new We(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class Vn{constructor(t,e,i){this.active=t,this.id=e,this.open=i}static start(){return new Vn(Hg,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:e}=t,i=e.facet(et),r=(i.override||e.languageDataAt("autocomplete",Me(e)).map(Dg)).map(a=>(this.active.find(h=>h.source==a)||new Et(a,this.active.some(h=>h.state!=0)?1:0)).update(t,i));r.length==this.active.length&&r.every((a,c)=>a==this.active[c])&&(r=this.active);let o=this.open,l=t.effects.some(a=>a.is(zr));o&&t.docChanged&&(o=o.map(t.changes)),t.selection||r.some(a=>a.hasResult()&&t.changes.touchesRange(a.from,a.to))||!Ng(r,this.active)||l?o=We.build(r,e,this.id,o,i,l):o&&o.disabled&&!r.some(a=>a.isPending)&&(o=null),!o&&r.every(a=>!a.isPending)&&r.some(a=>a.hasResult())&&(r=r.map(a=>a.hasResult()?new Et(a.source,0):a));for(let a of t.effects)a.is(yc)&&(o=o&&o.setSelected(a.value,this.id));return r==this.active&&o==this.open?this:new Vn(r,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?Fg:Vg}}function Ng(s,t){if(s==t)return!0;for(let e=0,i=0;;){for(;e-1&&(e["aria-activedescendant"]=s+"-"+t),e}const Hg=[];function mc(s,t){if(s.isUserEvent("input.complete")){let i=s.annotation(Wr);if(i&&t.activateOnCompletion(i))return 12}let e=s.isUserEvent("input.type");return e&&t.activateOnTyping?5:e?1:s.isUserEvent("delete.backward")?2:s.selection?8:s.docChanged?16:0}class Et{constructor(t,e,i=!1){this.source=t,this.state=e,this.explicit=i}hasResult(){return!1}get isPending(){return this.state==1}update(t,e){let i=mc(t,e),n=this;(i&8||i&16&&this.touches(t))&&(n=new Et(n.source,0)),i&4&&n.state==0&&(n=new Et(this.source,1)),n=n.updateFor(t,i);for(let r of t.effects)if(r.is(Fn))n=new Et(n.source,1,r.value);else if(r.is(Pi))n=new Et(n.source,0);else if(r.is(zr))for(let o of r.value)o.source==n.source&&(n=o);return n}updateFor(t,e){return this.map(t.changes)}map(t){return this}touches(t){return t.changes.touchesRange(Me(t.state))}}class Ue extends Et{constructor(t,e,i,n,r,o){super(t,3,e),this.limit=i,this.result=n,this.from=r,this.to=o}hasResult(){return!0}updateFor(t,e){var i;if(!(e&3))return this.map(t.changes);let n=this.result;n.map&&!t.changes.empty&&(n=n.map(n,t.changes));let r=t.changes.mapPos(this.from),o=t.changes.mapPos(this.to,1),l=Me(t.state);if(l>o||!n||e&2&&(Me(t.startState)==this.from||le.map(t))}}),yc=N.define(),xt=yt.define({create(){return Vn.start()},update(s,t){return s.update(t)},provide:s=>[th.from(s,t=>t.tooltip),O.contentAttributes.from(s,t=>t.attrs)]});function qr(s,t){const e=t.completion.apply||t.completion.label;let i=s.state.field(xt).active.find(n=>n.source==t.source);return i instanceof Ue?(typeof e=="string"?s.dispatch(Object.assign(Object.assign({},Mg(s.state,e,i.from,i.to)),{annotations:Wr.of(t.completion)})):e(s,t.completion,i.from,i.to),!0):!1}const zg=Lg(xt,qr);function an(s,t="option"){return e=>{let i=e.state.field(xt,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp-1?i.open.selected+n*(s?1:-1):s?0:o-1;return l<0?l=t=="page"?0:o-1:l>=o&&(l=t=="page"?o-1:0),e.dispatch({effects:yc.of(l)}),!0}}const qg=s=>{let t=s.state.field(xt,!1);return s.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamps.state.field(xt,!1)?(s.dispatch({effects:Fn.of(!0)}),!0):!1,Kg=s=>{let t=s.state.field(xt,!1);return!t||!t.active.some(e=>e.state!=0)?!1:(s.dispatch({effects:Pi.of(null)}),!0)};class $g{constructor(t,e){this.active=t,this.context=e,this.time=Date.now(),this.updates=[],this.done=void 0}}const jg=50,Ug=1e3,Gg=ut.fromClass(class{constructor(s){this.view=s,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of s.state.field(xt).active)t.isPending&&this.startQuery(t)}update(s){let t=s.state.field(xt),e=s.state.facet(et);if(!s.selectionSet&&!s.docChanged&&s.startState.field(xt)==t)return;let i=s.transactions.some(r=>{let o=mc(r,e);return o&8||(r.selection||r.docChanged)&&!(o&3)});for(let r=0;rjg&&Date.now()-o.time>Ug){for(let l of o.context.abortListeners)try{l()}catch(a){At(this.view.state,a)}o.context.abortListeners=null,this.running.splice(r--,1)}else o.updates.push(...s.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),s.transactions.some(r=>r.effects.some(o=>o.is(Fn)))&&(this.pendingStart=!0);let n=this.pendingStart?50:e.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(r=>r.isPending&&!this.running.some(o=>o.active.source==r.source))?setTimeout(()=>this.startUpdate(),n):-1,this.composing!=0)for(let r of s.transactions)r.isUserEvent("input.type")?this.composing=2:this.composing==2&&r.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:s}=this.view,t=s.field(xt);for(let e of t.active)e.isPending&&!this.running.some(i=>i.active.source==e.source)&&this.startQuery(e);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(et).updateSyncTime))}startQuery(s){let{state:t}=this.view,e=Me(t),i=new pc(t,e,s.explicit,this.view),n=new $g(s,i);this.running.push(n),Promise.resolve(s.source(i)).then(r=>{n.context.aborted||(n.done=r||null,this.scheduleAccept())},r=>{this.view.dispatch({effects:Pi.of(null)}),At(this.view.state,r)})}scheduleAccept(){this.running.every(s=>s.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(et).updateSyncTime))}accept(){var s;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],e=this.view.state.facet(et),i=this.view.state.field(xt);for(let n=0;nl.source==r.active.source);if(o&&o.isPending)if(r.done==null){let l=new Et(r.active.source,0);for(let a of r.updates)l=l.update(a,e);l.isPending||t.push(l)}else this.startQuery(o)}(t.length||i.open&&i.open.disabled)&&this.view.dispatch({effects:zr.of(t)})}},{eventHandlers:{blur(s){let t=this.view.state.field(xt,!1);if(t&&t.tooltip&&this.view.state.facet(et).closeOnBlur){let e=t.open&&eh(this.view,t.open.tooltip);(!e||!e.dom.contains(s.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:Pi.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Fn.of(!1)}),20),this.composing=0}}}),Jg=typeof navigator=="object"&&/Win/.test(navigator.platform),Yg=ye.highest(O.domEventHandlers({keydown(s,t){let e=t.state.field(xt,!1);if(!e||!e.open||e.open.disabled||e.open.selected<0||s.key.length>1||s.ctrlKey&&!(Jg&&s.altKey)||s.metaKey)return!1;let i=e.open.options[e.open.selected],n=e.active.find(o=>o.source==i.source),r=i.completion.commitCharacters||n.result.commitCharacters;return r&&r.indexOf(s.key)>-1&&qr(t,i),!1}})),bc=O.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class Xg{constructor(t,e,i,n){this.field=t,this.line=e,this.from=i,this.to=n}}class Kr{constructor(t,e,i){this.field=t,this.from=e,this.to=i}map(t){let e=t.mapPos(this.from,-1,ht.TrackDel),i=t.mapPos(this.to,1,ht.TrackDel);return e==null||i==null?null:new Kr(this.field,e,i)}}class $r{constructor(t,e){this.lines=t,this.fieldPositions=e}instantiate(t,e){let i=[],n=[e],r=t.doc.lineAt(e),o=/^\s*/.exec(r.text)[0];for(let a of this.lines){if(i.length){let c=o,h=/^\t*/.exec(a)[0].length;for(let f=0;fnew Kr(a.field,n[a.line]+a.from,n[a.line]+a.to));return{text:i,ranges:l}}static parse(t){let e=[],i=[],n=[],r;for(let o of t.split(/\r\n?|\n/)){for(;r=/[#$]\{(?:(\d+)(?::([^}]*))?|((?:\\[{}]|[^}])*))\}/.exec(o);){let l=r[1]?+r[1]:null,a=r[2]||r[3]||"",c=-1,h=a.replace(/\\[{}]/g,f=>f[1]);for(let f=0;f=c&&u.field++}n.push(new Xg(c,i.length,r.index,r.index+h.length)),o=o.slice(0,r.index)+a+o.slice(r.index+r[0].length)}o=o.replace(/\\([{}])/g,(l,a,c)=>{for(let h of n)h.line==i.length&&h.from>c&&(h.from--,h.to--);return a}),i.push(o)}return new $r(i,n)}}let _g=P.widget({widget:new class extends Ie{toDOM(){let s=document.createElement("span");return s.className="cm-snippetFieldPosition",s}ignoreEvent(){return!1}}}),Qg=P.mark({class:"cm-snippetField"});class ri{constructor(t,e){this.ranges=t,this.active=e,this.deco=P.set(t.map(i=>(i.from==i.to?_g:Qg).range(i.from,i.to)))}map(t){let e=[];for(let i of this.ranges){let n=i.map(t);if(!n)return null;e.push(n)}return new ri(e,this.active)}selectionInsideField(t){return t.ranges.every(e=>this.ranges.some(i=>i.field==this.active&&i.from<=e.from&&i.to>=e.to))}}const Wi=N.define({map(s,t){return s&&s.map(t)}}),Zg=N.define(),Ri=yt.define({create(){return null},update(s,t){for(let e of t.effects){if(e.is(Wi))return e.value;if(e.is(Zg)&&s)return new ri(s.ranges,e.value)}return s&&t.docChanged&&(s=s.map(t.changes)),s&&t.selection&&!s.selectionInsideField(t.selection)&&(s=null),s},provide:s=>O.decorations.from(s,t=>t?t.deco:P.none)});function jr(s,t){return b.create(s.filter(e=>e.field==t).map(e=>b.range(e.from,e.to)))}function tm(s){let t=$r.parse(s);return(e,i,n,r)=>{let{text:o,ranges:l}=t.instantiate(e.state,n),a={changes:{from:n,to:r,insert:F.of(o)},scrollIntoView:!0,annotations:i?[Wr.of(i),Z.userEvent.of("input.complete")]:void 0};if(l.length&&(a.selection=jr(l,0)),l.some(c=>c.field>0)){let c=new ri(l,0),h=a.effects=[Wi.of(c)];e.state.field(Ri,!1)===void 0&&h.push(N.appendConfig.of([Ri,rm,om,bc]))}e.dispatch(e.state.update(a))}}function xc(s){return({state:t,dispatch:e})=>{let i=t.field(Ri,!1);if(!i||s<0&&i.active==0)return!1;let n=i.active+s,r=s>0&&!i.ranges.some(o=>o.field==n+s);return e(t.update({selection:jr(i.ranges,n),effects:Wi.of(r?null:new ri(i.ranges,n)),scrollIntoView:!0})),!0}}const em=({state:s,dispatch:t})=>s.field(Ri,!1)?(t(s.update({effects:Wi.of(null)})),!0):!1,im=xc(1),nm=xc(-1),sm=[{key:"Tab",run:im,shift:nm},{key:"Escape",run:em}],Bl=T.define({combine(s){return s.length?s[0]:sm}}),rm=ye.highest(Ar.compute([Bl],s=>s.facet(Bl)));function $m(s,t){return Object.assign(Object.assign({},t),{apply:tm(s)})}const om=O.domEventHandlers({mousedown(s,t){let e=t.state.field(Ri,!1),i;if(!e||(i=t.posAtCoords({x:s.clientX,y:s.clientY}))==null)return!1;let n=e.ranges.find(r=>r.from<=i&&r.to>=i);return!n||n.field==e.active?!1:(t.dispatch({selection:jr(e.ranges,n.field),effects:Wi.of(e.ranges.some(r=>r.field>n.field)?new ri(e.ranges,n.field):null),scrollIntoView:!0}),!0)}}),Li={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Ae=N.define({map(s,t){let e=t.mapPos(s,-1,ht.TrackAfter);return e??void 0}}),Ur=new class extends De{};Ur.startSide=1;Ur.endSide=-1;const wc=yt.define({create(){return K.empty},update(s,t){if(s=s.map(t.changes),t.selection){let e=t.state.doc.lineAt(t.selection.main.head);s=s.update({filter:i=>i>=e.from&&i<=e.to})}for(let e of t.effects)e.is(Ae)&&(s=s.update({add:[Ur.range(e.value,e.value+1)]}));return s}});function jm(){return[am,wc]}const gs="()[]{}<>";function Sc(s){for(let t=0;t{if((lm?s.composing:s.compositionStarted)||s.state.readOnly)return!1;let n=s.state.selection.main;if(i.length>2||i.length==2&&Bt(st(i,0))==1||t!=n.from||e!=n.to)return!1;let r=cm(s.state,i);return r?(s.dispatch(r),!0):!1}),hm=({state:s,dispatch:t})=>{if(s.readOnly)return!1;let i=kc(s,s.selection.main.head).brackets||Li.brackets,n=null,r=s.changeByRange(o=>{if(o.empty){let l=fm(s.doc,o.head);for(let a of i)if(a==l&&Yn(s.doc,o.head)==Sc(st(a,0)))return{changes:{from:o.head-a.length,to:o.head+a.length},range:b.cursor(o.head-a.length)}}return{range:n=o}});return n||t(s.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!n},Um=[{key:"Backspace",run:hm}];function cm(s,t){let e=kc(s,s.selection.main.head),i=e.brackets||Li.brackets;for(let n of i){let r=Sc(st(n,0));if(t==n)return r==n?pm(s,n,i.indexOf(n+n+n)>-1,e):um(s,n,r,e.before||Li.before);if(t==r&&vc(s,s.selection.main.from))return dm(s,n,r)}return null}function vc(s,t){let e=!1;return s.field(wc).between(0,s.doc.length,i=>{i==t&&(e=!0)}),e}function Yn(s,t){let e=s.sliceString(t,t+2);return e.slice(0,Bt(st(e,0)))}function fm(s,t){let e=s.sliceString(t-2,t);return Bt(st(e,0))==e.length?e:e.slice(1)}function um(s,t,e,i){let n=null,r=s.changeByRange(o=>{if(!o.empty)return{changes:[{insert:t,from:o.from},{insert:e,from:o.to}],effects:Ae.of(o.to+t.length),range:b.range(o.anchor+t.length,o.head+t.length)};let l=Yn(s.doc,o.head);return!l||/\s/.test(l)||i.indexOf(l)>-1?{changes:{insert:t+e,from:o.head},effects:Ae.of(o.head+t.length),range:b.cursor(o.head+t.length)}:{range:n=o}});return n?null:s.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function dm(s,t,e){let i=null,n=s.changeByRange(r=>r.empty&&Yn(s.doc,r.head)==e?{changes:{from:r.head,to:r.head+e.length,insert:e},range:b.cursor(r.head+e.length)}:i={range:r});return i?null:s.update(n,{scrollIntoView:!0,userEvent:"input.type"})}function pm(s,t,e,i){let n=i.stringPrefixes||Li.stringPrefixes,r=null,o=s.changeByRange(l=>{if(!l.empty)return{changes:[{insert:t,from:l.from},{insert:t,from:l.to}],effects:Ae.of(l.to+t.length),range:b.range(l.anchor+t.length,l.head+t.length)};let a=l.head,c=Yn(s.doc,a),h;if(c==t){if(Pl(s,a))return{changes:{insert:t+t,from:a},effects:Ae.of(a+t.length),range:b.cursor(a+t.length)};if(vc(s,a)){let u=e&&s.sliceDoc(a,a+t.length*3)==t+t+t?t+t+t:t;return{changes:{from:a,to:a+u.length,insert:u},range:b.cursor(a+u.length)}}}else{if(e&&s.sliceDoc(a-2*t.length,a)==t+t&&(h=Rl(s,a-2*t.length,n))>-1&&Pl(s,h))return{changes:{insert:t+t+t+t,from:a},effects:Ae.of(a+t.length),range:b.cursor(a+t.length)};if(s.charCategorizer(a)(c)!=J.Word&&Rl(s,a,n)>-1&&!gm(s,a,t,n))return{changes:{insert:t+t,from:a},effects:Ae.of(a+t.length),range:b.cursor(a+t.length)}}return{range:r=l}});return r?null:s.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function Pl(s,t){let e=St(s).resolveInner(t+1);return e.parent&&e.from==t}function gm(s,t,e,i){let n=St(s).resolveInner(t,-1),r=i.reduce((o,l)=>Math.max(o,l.length),0);for(let o=0;o<5;o++){let l=s.sliceDoc(n.from,Math.min(n.to,n.from+e.length+r)),a=l.indexOf(e);if(!a||a>-1&&i.indexOf(l.slice(0,a))>-1){let h=n.firstChild;for(;h&&h.from==n.from&&h.to-h.from>e.length+a;){if(s.sliceDoc(h.to-e.length,h.to)==e)return!1;h=h.firstChild}return!0}let c=n.to==t&&n.parent;if(!c)break;n=c}return!1}function Rl(s,t,e){let i=s.charCategorizer(t);if(i(s.sliceDoc(t-1,t))!=J.Word)return t;for(let n of e){let r=t-n.length;if(s.sliceDoc(r,t)==n&&i(s.sliceDoc(r-1,r))!=J.Word)return r}return-1}function Gm(s={}){return[Yg,xt,et.of(s),Gg,ym,bc]}const mm=[{key:"Ctrl-Space",run:Tl},{mac:"Alt-`",run:Tl},{key:"Escape",run:Kg},{key:"ArrowDown",run:an(!0)},{key:"ArrowUp",run:an(!1)},{key:"PageDown",run:an(!0,"page")},{key:"PageUp",run:an(!1,"page")},{key:"Enter",run:qg}],ym=ye.highest(Ar.computeN([et],s=>s.facet(et).defaultKeymap?[mm]:[]));export{Mm as A,uh as B,Hn as C,Ju as D,O as E,Pm as F,Rm as G,Lm as H,Y as I,Om as J,Am as K,er as L,Bm as M,Mr as N,Tm as O,oh as P,yd as Q,Km as R,wh as S,U as T,Ag as U,b as V,$m as W,hh as X,Id as Y,mm as a,H as b,Um as c,Hm as d,Cm as e,Sm as f,Fm as g,Vm as h,xm as i,wm as j,Em as k,Nm as l,jm as m,zm as n,Ar as o,Gm as p,km as q,vm as r,qm as s,Wm as t,Im as u,St as v,mt as w,L as x,ud as y,M as z}; diff --git a/ui/dist/assets/index-rWxFAXsK.js b/ui/dist/assets/index-C58oTbH7.js similarity index 95% rename from ui/dist/assets/index-rWxFAXsK.js rename to ui/dist/assets/index-C58oTbH7.js index 78bee807..3b7c0275 100644 --- a/ui/dist/assets/index-rWxFAXsK.js +++ b/ui/dist/assets/index-C58oTbH7.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./FilterAutocompleteInput-Ek7e14PX.js","./index-C-PlLH2L.js","./ListApiDocs-D54ZVVWM.js","./FieldsQueryParam-DmBOgcIi.js","./ListApiDocs-ByASLUZu.css","./ViewApiDocs-DZ9ip2ya.js","./CreateApiDocs-BzGj6G0X.js","./UpdateApiDocs-DiOtUnmN.js","./AuthMethodsDocs-DA2FbqWG.js","./AuthWithPasswordDocs-B5NyrXaF.js","./AuthWithOAuth2Docs-B4NAwTzv.js","./AuthRefreshDocs-C-YzpWeh.js","./CodeEditor-Dl2IHbSx.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./FilterAutocompleteInput-DNssmiMR.js","./index-CH-gyH77.js","./ListApiDocs-C43-0tDt.js","./FieldsQueryParam-B-V1imBW.js","./ListApiDocs-ByASLUZu.css","./ViewApiDocs-DL4sWQDZ.js","./CreateApiDocs-D603KXnO.js","./UpdateApiDocs-Qjcnv2Ln.js","./AuthMethodsDocs-LOcNuTNq.js","./AuthWithPasswordDocs-p2UV8l8M.js","./AuthWithOAuth2Docs-Bjy57_lX.js","./AuthRefreshDocs-tAKBTotE.js","./CodeEditor-B_VWhJeL.js"])))=>i.map(i=>d[i]); var Dy=Object.defineProperty;var Iy=(n,e,t)=>e in n?Dy(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var pt=(n,e,t)=>Iy(n,typeof e!="symbol"?e+"":e,t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))i(l);new MutationObserver(l=>{for(const s of l)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(l){const s={};return l.integrity&&(s.integrity=l.integrity),l.referrerPolicy&&(s.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?s.credentials="include":l.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(l){if(l.ep)return;l.ep=!0;const s=t(l);fetch(l.href,s)}})();function te(){}const lo=n=>n;function je(n,e){for(const t in e)n[t]=e[t];return n}function Ly(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function Ub(n){return n()}function df(){return Object.create(null)}function Ie(n){n.forEach(Ub)}function It(n){return typeof n=="function"}function ke(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let So;function bn(n,e){return n===e?!0:(So||(So=document.createElement("a")),So.href=e,n===So.href)}function Ay(n){return Object.keys(n).length===0}function cu(n,...e){if(n==null){for(const i of e)i(void 0);return te}const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function Vb(n){let e;return cu(n,t=>e=t)(),e}function Qe(n,e,t){n.$$.on_destroy.push(cu(e,t))}function Lt(n,e,t,i){if(n){const l=Bb(n,e,t,i);return n[0](l)}}function Bb(n,e,t,i){return n[1]&&i?je(t.ctx.slice(),n[1](i(e))):t.ctx}function At(n,e,t,i){if(n[2]&&i){const l=n[2](i(t));if(e.dirty===void 0)return l;if(typeof l=="object"){const s=[],o=Math.max(e.dirty.length,l.length);for(let r=0;r32){const e=[],t=n.ctx.length/32;for(let i=0;iwindow.performance.now():()=>Date.now(),du=Wb?n=>requestAnimationFrame(n):te;const Zl=new Set;function Yb(n){Zl.forEach(e=>{e.c(n)||(Zl.delete(e),e.f())}),Zl.size!==0&&du(Yb)}function Or(n){let e;return Zl.size===0&&du(Yb),{promise:new Promise(t=>{Zl.add(e={c:n,f:t})}),abort(){Zl.delete(e)}}}function w(n,e){n.appendChild(e)}function Kb(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function Py(n){const e=b("style");return e.textContent="/* empty */",Ny(Kb(n),e),e.sheet}function Ny(n,e){return w(n.head||n,e),e.sheet}function v(n,e,t){n.insertBefore(e,t||null)}function y(n){n.parentNode&&n.parentNode.removeChild(n)}function dt(n,e){for(let t=0;tn.removeEventListener(e,t,i)}function nt(n){return function(e){return e.preventDefault(),n.call(this,e)}}function On(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function p(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}const Ry=["width","height"];function ei(n,e){const t=Object.getOwnPropertyDescriptors(n.__proto__);for(const i in e)e[i]==null?n.removeAttribute(i):i==="style"?n.style.cssText=e[i]:i==="__value"?n.value=n[i]=e[i]:t[i]&&t[i].set&&Ry.indexOf(i)===-1?n[i]=e[i]:p(n,i,e[i])}function Fy(n){let e;return{p(...t){e=t,e.forEach(i=>n.push(i))},r(){e.forEach(t=>n.splice(n.indexOf(t),1))}}}function gt(n){return n===""?null:+n}function qy(n){return Array.from(n.childNodes)}function oe(n,e){e=""+e,n.data!==e&&(n.data=e)}function he(n,e){n.value=e??""}function Hy(n,e,t,i){t==null?n.style.removeProperty(e):n.style.setProperty(e,t,"")}function ee(n,e,t){n.classList.toggle(e,!!t)}function Jb(n,e,{bubbles:t=!1,cancelable:i=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:i})}function zt(n,e){return new n(e)}const fr=new Map;let cr=0;function jy(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function zy(n,e){const t={stylesheet:Py(e),rules:{}};return fr.set(n,t),t}function Us(n,e,t,i,l,s,o,r=0){const a=16.666/i;let u=`{ `;for(let _=0;_<=1;_+=a){const k=e+(t-e)*s(_);u+=_*100+`%{${o(k,1-k)}} `}const f=u+`100% {${o(t,1-t)}} @@ -10,9 +10,9 @@ var Dy=Object.defineProperty;var Iy=(n,e,t)=>e in n?Dy(n,e,{enumerable:!0,config opacity: ${a-f*_}`}}function mt(n,{delay:e=0,duration:t=400,easing:i=Ar,axis:l="y"}={}){const s=getComputedStyle(n),o=+s.opacity,r=l==="y"?"height":"width",a=parseFloat(s[r]),u=l==="y"?["top","bottom"]:["left","right"],f=u.map(k=>`${k[0].toUpperCase()}${k.slice(1)}`),c=parseFloat(s[`padding${f[0]}`]),d=parseFloat(s[`padding${f[1]}`]),m=parseFloat(s[`margin${f[0]}`]),h=parseFloat(s[`margin${f[1]}`]),g=parseFloat(s[`border${f[0]}Width`]),_=parseFloat(s[`border${f[1]}Width`]);return{delay:e,duration:t,easing:i,css:k=>`overflow: hidden;opacity: ${Math.min(k*20,1)*o};${r}: ${k*a}px;padding-${u[0]}: ${k*c}px;padding-${u[1]}: ${k*d}px;margin-${u[0]}: ${k*m}px;margin-${u[1]}: ${k*h}px;border-${u[0]}-width: ${k*g}px;border-${u[1]}-width: ${k*_}px;`}}function $t(n,{delay:e=0,duration:t=400,easing:i=Ar,start:l=0,opacity:s=0}={}){const o=getComputedStyle(n),r=+o.opacity,a=o.transform==="none"?"":o.transform,u=1-l,f=r*(1-s);return{delay:e,duration:t,easing:i,css:(c,d)=>` transform: ${a} scale(${1-u*d}); opacity: ${r-f*d} - `}}const lw=n=>({}),Yf=n=>({}),sw=n=>({}),Kf=n=>({});function Jf(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$=n[4]&&!n[2]&&Zf(n);const T=n[19].header,O=Lt(T,n,n[18],Kf);let E=n[4]&&n[2]&&Gf(n);const L=n[19].default,I=Lt(L,n,n[18],null),A=n[19].footer,P=Lt(A,n,n[18],Yf);return{c(){e=b("div"),t=b("div"),l=C(),s=b("div"),o=b("div"),$&&$.c(),r=C(),O&&O.c(),a=C(),E&&E.c(),u=C(),f=b("div"),I&&I.c(),c=C(),d=b("div"),P&&P.c(),p(t,"class","overlay"),p(o,"class","overlay-panel-section panel-header"),p(f,"class","overlay-panel-section panel-content"),p(d,"class","overlay-panel-section panel-footer"),p(s,"class",m="overlay-panel "+n[1]+" "+n[8]),ee(s,"popup",n[2]),p(e,"class","overlay-panel-container"),ee(e,"padded",n[2]),ee(e,"active",n[0])},m(N,R){v(N,e,R),w(e,t),w(e,l),w(e,s),w(s,o),$&&$.m(o,null),w(o,r),O&&O.m(o,null),w(o,a),E&&E.m(o,null),w(s,u),w(s,f),I&&I.m(f,null),n[21](f),w(s,c),w(s,d),P&&P.m(d,null),_=!0,k||(S=[W(t,"click",nt(n[20])),W(f,"scroll",n[22])],k=!0)},p(N,R){n=N,n[4]&&!n[2]?$?($.p(n,R),R[0]&20&&M($,1)):($=Zf(n),$.c(),M($,1),$.m(o,r)):$&&(re(),D($,1,1,()=>{$=null}),ae()),O&&O.p&&(!_||R[0]&262144)&&Pt(O,T,n,n[18],_?At(T,n[18],R,sw):Nt(n[18]),Kf),n[4]&&n[2]?E?E.p(n,R):(E=Gf(n),E.c(),E.m(o,null)):E&&(E.d(1),E=null),I&&I.p&&(!_||R[0]&262144)&&Pt(I,L,n,n[18],_?At(L,n[18],R,null):Nt(n[18]),null),P&&P.p&&(!_||R[0]&262144)&&Pt(P,A,n,n[18],_?At(A,n[18],R,lw):Nt(n[18]),Yf),(!_||R[0]&258&&m!==(m="overlay-panel "+n[1]+" "+n[8]))&&p(s,"class",m),(!_||R[0]&262)&&ee(s,"popup",n[2]),(!_||R[0]&4)&&ee(e,"padded",n[2]),(!_||R[0]&1)&&ee(e,"active",n[0])},i(N){_||(N&&tt(()=>{_&&(i||(i=He(t,Ys,{duration:Zi,opacity:0},!0)),i.run(1))}),M($),M(O,N),M(I,N),M(P,N),N&&tt(()=>{_&&(g&&g.end(1),h=Qb(s,qn,n[2]?{duration:Zi,y:-10}:{duration:Zi,x:50}),h.start())}),_=!0)},o(N){N&&(i||(i=He(t,Ys,{duration:Zi,opacity:0},!1)),i.run(0)),D($),D(O,N),D(I,N),D(P,N),h&&h.invalidate(),N&&(g=_u(s,qn,n[2]?{duration:Zi,y:10}:{duration:Zi,x:50})),_=!1},d(N){N&&y(e),N&&i&&i.end(),$&&$.d(),O&&O.d(N),E&&E.d(),I&&I.d(N),n[21](null),P&&P.d(N),N&&g&&g.end(),k=!1,Ie(S)}}}function Zf(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Close"),p(e,"class","overlay-close")},m(o,r){v(o,e,r),i=!0,l||(s=W(e,"click",nt(n[5])),l=!0)},p(o,r){n=o},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,Ys,{duration:Zi},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Ys,{duration:Zi},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function Gf(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Close"),p(e,"class","btn btn-sm btn-circle btn-transparent btn-close m-l-auto")},m(l,s){v(l,e,s),t||(i=W(e,"click",nt(n[5])),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function ow(n){let e,t,i,l,s=n[0]&&Jf(n);return{c(){e=b("div"),s&&s.c(),p(e,"class","overlay-panel-wrapper"),p(e,"tabindex","-1")},m(o,r){v(o,e,r),s&&s.m(e,null),n[23](e),t=!0,i||(l=[W(window,"resize",n[10]),W(window,"keydown",n[9])],i=!0)},p(o,r){o[0]?s?(s.p(o,r),r[0]&1&&M(s,1)):(s=Jf(o),s.c(),M(s,1),s.m(e,null)):s&&(re(),D(s,1,1,()=>{s=null}),ae())},i(o){t||(M(s),t=!0)},o(o){D(s),t=!1},d(o){o&&y(e),s&&s.d(),n[23](null),i=!1,Ie(l)}}}let gl,la=[];function tk(){return gl=gl||document.querySelector(".overlays"),gl||(gl=document.createElement("div"),gl.classList.add("overlays"),document.body.appendChild(gl)),gl}let Zi=150;function Xf(){return 1e3+tk().querySelectorAll(".overlay-panel-container.active").length}function rw(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,{active:o=!1}=e,{popup:r=!1}=e,{overlayClose:a=!0}=e,{btnClose:u=!0}=e,{escClose:f=!0}=e,{beforeOpen:c=void 0}=e,{beforeHide:d=void 0}=e;const m=kt(),h="op_"+V.randomString(10);let g,_,k,S,$="",T=o;function O(){typeof c=="function"&&c()===!1||t(0,o=!0)}function E(){typeof d=="function"&&d()===!1||t(0,o=!1)}function L(){return o}async function I(G){t(17,T=G),G?(k=document.activeElement,m("show"),g==null||g.focus()):(clearTimeout(S),m("hide"),k==null||k.focus()),await dn(),A()}function A(){g&&(o?t(6,g.style.zIndex=Xf(),g):t(6,g.style="",g))}function P(){V.pushUnique(la,h),document.body.classList.add("overlay-active")}function N(){V.removeByValue(la,h),la.length||document.body.classList.remove("overlay-active")}function R(G){o&&f&&G.code=="Escape"&&!V.isInput(G.target)&&g&&g.style.zIndex==Xf()&&(G.preventDefault(),E())}function z(G){o&&F(_)}function F(G,pe){pe&&t(8,$=""),!(!G||S)&&(S=setTimeout(()=>{if(clearTimeout(S),S=null,!G)return;if(G.scrollHeight-G.offsetHeight>0)t(8,$="scrollable");else{t(8,$="");return}G.scrollTop==0?t(8,$+=" scroll-top-reached"):G.scrollTop+G.offsetHeight==G.scrollHeight&&t(8,$+=" scroll-bottom-reached")},100))}Xt(()=>{tk().appendChild(g);let G=g;return()=>{clearTimeout(S),N(),G==null||G.remove()}});const U=()=>a?E():!0;function J(G){ie[G?"unshift":"push"](()=>{_=G,t(7,_)})}const Y=G=>F(G.target);function Z(G){ie[G?"unshift":"push"](()=>{g=G,t(6,g)})}return n.$$set=G=>{"class"in G&&t(1,s=G.class),"active"in G&&t(0,o=G.active),"popup"in G&&t(2,r=G.popup),"overlayClose"in G&&t(3,a=G.overlayClose),"btnClose"in G&&t(4,u=G.btnClose),"escClose"in G&&t(12,f=G.escClose),"beforeOpen"in G&&t(13,c=G.beforeOpen),"beforeHide"in G&&t(14,d=G.beforeHide),"$$scope"in G&&t(18,l=G.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&131073&&T!=o&&I(o),n.$$.dirty[0]&128&&F(_,!0),n.$$.dirty[0]&64&&g&&A(),n.$$.dirty[0]&1&&(o?P():N())},[o,s,r,a,u,E,g,_,$,R,z,F,f,c,d,O,L,T,l,i,U,J,Y,Z]}class Qt extends Se{constructor(e){super(),we(this,e,rw,ow,ke,{class:1,active:0,popup:2,overlayClose:3,btnClose:4,escClose:12,beforeOpen:13,beforeHide:14,show:15,hide:5,isActive:16},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[5]}get isActive(){return this.$$.ctx[16]}}const Bl=[];function nk(n,e){return{subscribe:Hn(n,e).subscribe}}function Hn(n,e=te){let t;const i=new Set;function l(r){if(ke(n,r)&&(n=r,t)){const a=!Bl.length;for(const u of i)u[1](),Bl.push(u,n);if(a){for(let u=0;u{i.delete(u),i.size===0&&t&&(t(),t=null)}}return{set:l,update:s,subscribe:o}}function ik(n,e,t){const i=!Array.isArray(n),l=i?[n]:n;if(!l.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const s=e.length<2;return nk(t,(o,r)=>{let a=!1;const u=[];let f=0,c=te;const d=()=>{if(f)return;c();const h=e(i?u[0]:u,o,r);s?o(h):c=It(h)?h:te},m=l.map((h,g)=>cu(h,_=>{u[g]=_,f&=~(1<{f|=1<t(1,i=c));let l,s=!1,o=!1;const r=()=>{t(3,o=!1),l==null||l.hide()},a=async()=>{i!=null&&i.yesCallback&&(t(2,s=!0),await Promise.resolve(i.yesCallback()),t(2,s=!1)),t(3,o=!0),l==null||l.hide()};function u(c){ie[c?"unshift":"push"](()=>{l=c,t(0,l)})}const f=async()=>{!o&&(i!=null&&i.noCallback)&&i.noCallback(),await dn(),t(3,o=!1),lk()};return n.$$.update=()=>{n.$$.dirty&3&&i!=null&&i.text&&(t(3,o=!1),l==null||l.show())},[l,i,s,o,r,a,u,f]}class dw extends Se{constructor(e){super(),we(this,e,cw,fw,ke,{})}}function pw(n){let e;return{c(){e=b("textarea"),p(e,"id",n[0]),Hy(e,"visibility","hidden")},m(t,i){v(t,e,i),n[15](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&y(e),n[15](null)}}}function mw(n){let e;return{c(){e=b("div"),p(e,"id",n[0])},m(t,i){v(t,e,i),n[14](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&y(e),n[14](null)}}}function hw(n){let e;function t(s,o){return s[1]?mw:pw}let i=t(n),l=i(n);return{c(){e=b("div"),l.c(),p(e,"class",n[2])},m(s,o){v(s,e,o),l.m(e,null),n[16](e)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e,null))),o&4&&p(e,"class",s[2])},i:te,o:te,d(s){s&&y(e),l.d(),n[16](null)}}}function _w(){let n={listeners:[],scriptLoaded:!1,injected:!1};function e(i,l,s){n.injected=!0;const o=i.createElement("script");o.referrerPolicy="origin",o.type="application/javascript",o.src=l,o.onload=()=>{s()},i.head&&i.head.appendChild(o)}function t(i,l,s){n.scriptLoaded?s():(n.listeners.push(s),n.injected||e(i,l,()=>{n.listeners.forEach(o=>o()),n.scriptLoaded=!0}))}return{load:t}}let gw=_w();function sa(){return window&&window.tinymce?window.tinymce:null}function bw(n,e,t){let{id:i="tinymce_svelte"+V.randomString(7)}=e,{inline:l=void 0}=e,{disabled:s=!1}=e,{scriptSrc:o="./libs/tinymce/tinymce.min.js"}=e,{conf:r={}}=e,{modelEvents:a="change input undo redo"}=e,{value:u=""}=e,{text:f=""}=e,{cssClass:c="tinymce-wrapper"}=e;const d=["Activate","AddUndo","BeforeAddUndo","BeforeExecCommand","BeforeGetContent","BeforeRenderUI","BeforeSetContent","BeforePaste","Blur","Change","ClearUndos","Click","ContextMenu","Copy","Cut","Dblclick","Deactivate","Dirty","Drag","DragDrop","DragEnd","DragGesture","DragOver","Drop","ExecCommand","Focus","FocusIn","FocusOut","GetContent","Hide","Init","KeyDown","KeyPress","KeyUp","LoadContent","MouseDown","MouseEnter","MouseLeave","MouseMove","MouseOut","MouseOver","MouseUp","NodeChange","ObjectResizeStart","ObjectResized","ObjectSelected","Paste","PostProcess","PostRender","PreProcess","ProgressState","Redo","Remove","Reset","ResizeEditor","SaveContent","SelectionChange","SetAttrib","SetContent","Show","Submit","Undo","VisualAid"],m=(I,A)=>{d.forEach(P=>{I.on(P,N=>{A(P.toLowerCase(),{eventName:P,event:N,editor:I})})})};let h,g,_,k=u,S=s;const $=kt();function T(){const I={...r,target:g,inline:l!==void 0?l:r.inline!==void 0?r.inline:!1,readonly:s,setup:A=>{t(11,_=A),A.on("init",()=>{A.setContent(u),A.on(a,()=>{t(12,k=A.getContent()),k!==u&&(t(5,u=k),t(6,f=A.getContent({format:"text"})))})}),m(A,$),typeof r.setup=="function"&&r.setup(A)}};t(4,g.style.visibility="",g),sa().init(I)}Xt(()=>(sa()!==null?T():gw.load(h.ownerDocument,o,()=>{h&&T()}),()=>{var I,A;try{_&&((I=_.dom)==null||I.unbind(document),(A=sa())==null||A.remove(_))}catch{}}));function O(I){ie[I?"unshift":"push"](()=>{g=I,t(4,g)})}function E(I){ie[I?"unshift":"push"](()=>{g=I,t(4,g)})}function L(I){ie[I?"unshift":"push"](()=>{h=I,t(3,h)})}return n.$$set=I=>{"id"in I&&t(0,i=I.id),"inline"in I&&t(1,l=I.inline),"disabled"in I&&t(7,s=I.disabled),"scriptSrc"in I&&t(8,o=I.scriptSrc),"conf"in I&&t(9,r=I.conf),"modelEvents"in I&&t(10,a=I.modelEvents),"value"in I&&t(5,u=I.value),"text"in I&&t(6,f=I.text),"cssClass"in I&&t(2,c=I.cssClass)},n.$$.update=()=>{var I;if(n.$$.dirty&14496)try{_&&k!==u&&(_.setContent(u),t(6,f=_.getContent({format:"text"}))),_&&s!==S&&(t(13,S=s),typeof((I=_.mode)==null?void 0:I.set)=="function"?_.mode.set(s?"readonly":"design"):_.setMode(s?"readonly":"design"))}catch(A){console.warn("TinyMCE reactive error:",A)}},[i,l,c,h,g,u,f,s,o,r,a,_,k,S,O,E,L]}class Cu extends Se{constructor(e){super(),we(this,e,bw,hw,ke,{id:0,inline:1,disabled:7,scriptSrc:8,conf:9,modelEvents:10,value:5,text:6,cssClass:2})}}function kw(n,{from:e,to:t},i={}){const l=getComputedStyle(n),s=l.transform==="none"?"":l.transform,[o,r]=l.transformOrigin.split(" ").map(parseFloat),a=e.left+e.width*o/t.width-(t.left+o),u=e.top+e.height*r/t.height-(t.top+r),{delay:f=0,duration:c=m=>Math.sqrt(m)*120,easing:d=Ar}=i;return{delay:f,duration:It(c)?c(Math.sqrt(a*a+u*u)):c,easing:d,css:(m,h)=>{const g=h*a,_=h*u,k=m+h*e.width/t.width,S=m+h*e.height/t.height;return`transform: ${s} translate(${g}px, ${_}px) scale(${k}, ${S});`}}}const Pr=Hn([]);function Ks(n,e=4e3){return Nr(n,"info",e)}function nn(n,e=3e3){return Nr(n,"success",e)}function Ci(n,e=4500){return Nr(n,"error",e)}function yw(n,e=4500){return Nr(n,"warning",e)}function Nr(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{sk(i)},t)};Pr.update(l=>(Ou(l,i.message),V.pushOrReplaceByKey(l,i,"message"),l))}function sk(n){Pr.update(e=>(Ou(e,n),e))}function Ls(){Pr.update(n=>{for(let e of n)Ou(n,e);return[]})}function Ou(n,e){let t;typeof e=="string"?t=V.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),V.removeByKey(n,"message",t.message))}function Qf(n,e,t){const i=n.slice();return i[2]=e[t],i}function vw(n){let e;return{c(){e=b("i"),p(e,"class","ri-alert-line")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function ww(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-line")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function Sw(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-line")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function Tw(n){let e;return{c(){e=b("i"),p(e,"class","ri-information-line")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function xf(n,e){let t,i,l,s,o=e[2].message+"",r,a,u,f,c,d,m,h=te,g,_,k;function S(E,L){return E[2].type==="info"?Tw:E[2].type==="success"?Sw:E[2].type==="warning"?ww:vw}let $=S(e),T=$(e);function O(){return e[1](e[2])}return{key:n,first:null,c(){t=b("div"),i=b("div"),T.c(),l=C(),s=b("div"),r=B(o),a=C(),u=b("button"),u.innerHTML='',f=C(),p(i,"class","icon"),p(s,"class","content"),p(u,"type","button"),p(u,"class","close"),p(t,"class","alert txt-break"),ee(t,"alert-info",e[2].type=="info"),ee(t,"alert-success",e[2].type=="success"),ee(t,"alert-danger",e[2].type=="error"),ee(t,"alert-warning",e[2].type=="warning"),this.first=t},m(E,L){v(E,t,L),w(t,i),T.m(i,null),w(t,l),w(t,s),w(s,r),w(t,a),w(t,u),w(t,f),g=!0,_||(k=W(u,"click",nt(O)),_=!0)},p(E,L){e=E,$!==($=S(e))&&(T.d(1),T=$(e),T&&(T.c(),T.m(i,null))),(!g||L&1)&&o!==(o=e[2].message+"")&&oe(r,o),(!g||L&1)&&ee(t,"alert-info",e[2].type=="info"),(!g||L&1)&&ee(t,"alert-success",e[2].type=="success"),(!g||L&1)&&ee(t,"alert-danger",e[2].type=="error"),(!g||L&1)&&ee(t,"alert-warning",e[2].type=="warning")},r(){m=t.getBoundingClientRect()},f(){By(t),h(),Zb(t,m)},a(){h(),h=Vy(t,m,kw,{duration:150})},i(E){g||(E&&tt(()=>{g&&(d&&d.end(1),c=Qb(t,mt,{duration:150}),c.start())}),g=!0)},o(E){c&&c.invalidate(),E&&(d=_u(t,Ys,{duration:150})),g=!1},d(E){E&&y(t),T.d(),E&&d&&d.end(),_=!1,k()}}}function $w(n){let e,t=[],i=new Map,l,s=de(n[0]);const o=r=>r[2].message;for(let r=0;rt(0,i=s)),[i,s=>sk(s)]}class Ow extends Se{constructor(e){super(),we(this,e,Cw,$w,ke,{})}}function ec(n){let e,t,i;const l=n[18].default,s=Lt(l,n,n[17],null);return{c(){e=b("div"),s&&s.c(),p(e,"class",n[1]),ee(e,"active",n[0])},m(o,r){v(o,e,r),s&&s.m(e,null),n[19](e),i=!0},p(o,r){s&&s.p&&(!i||r[0]&131072)&&Pt(s,l,o,o[17],i?At(l,o[17],r,null):Nt(o[17]),null),(!i||r[0]&2)&&p(e,"class",o[1]),(!i||r[0]&3)&&ee(e,"active",o[0])},i(o){i||(M(s,o),o&&tt(()=>{i&&(t||(t=He(e,qn,{duration:150,y:3},!0)),t.run(1))}),i=!0)},o(o){D(s,o),o&&(t||(t=He(e,qn,{duration:150,y:3},!1)),t.run(0)),i=!1},d(o){o&&y(e),s&&s.d(o),n[19](null),o&&t&&t.end()}}}function Mw(n){let e,t,i,l,s=n[0]&&ec(n);return{c(){e=b("div"),s&&s.c(),p(e,"class","toggler-container"),p(e,"tabindex","-1"),p(e,"role","menu")},m(o,r){v(o,e,r),s&&s.m(e,null),n[20](e),t=!0,i||(l=[W(window,"click",n[7]),W(window,"mousedown",n[6]),W(window,"keydown",n[5]),W(window,"focusin",n[4])],i=!0)},p(o,r){o[0]?s?(s.p(o,r),r[0]&1&&M(s,1)):(s=ec(o),s.c(),M(s,1),s.m(e,null)):s&&(re(),D(s,1,1,()=>{s=null}),ae())},i(o){t||(M(s),t=!0)},o(o){D(s),t=!1},d(o){o&&y(e),s&&s.d(),n[20](null),i=!1,Ie(l)}}}function Ew(n,e,t){let{$$slots:i={},$$scope:l}=e,{trigger:s=void 0}=e,{active:o=!1}=e,{escClose:r=!0}=e,{autoScroll:a=!0}=e,{closableClass:u="closable"}=e,{class:f=""}=e,c,d,m,h,g,_=!1;const k=kt();function S(G=0){o&&(clearTimeout(g),g=setTimeout($,G))}function $(){o&&(t(0,o=!1),_=!1,clearTimeout(h),clearTimeout(g))}function T(){clearTimeout(g),clearTimeout(h),!o&&(t(0,o=!0),m!=null&&m.contains(c)||c==null||c.focus(),h=setTimeout(()=>{a&&(d!=null&&d.scrollIntoViewIfNeeded?d==null||d.scrollIntoViewIfNeeded():d!=null&&d.scrollIntoView&&(d==null||d.scrollIntoView({behavior:"smooth",block:"nearest"})))},180))}function O(){o?$():T()}function E(G){return!c||G.classList.contains(u)||c.contains(G)&&G.closest&&G.closest("."+u)}function L(G){I(),c==null||c.addEventListener("click",A),c==null||c.addEventListener("keydown",P),t(16,m=G||(c==null?void 0:c.parentNode)),m==null||m.addEventListener("click",N),m==null||m.addEventListener("keydown",R)}function I(){clearTimeout(h),clearTimeout(g),c==null||c.removeEventListener("click",A),c==null||c.removeEventListener("keydown",P),m==null||m.removeEventListener("click",N),m==null||m.removeEventListener("keydown",R)}function A(G){G.stopPropagation(),E(G.target)&&$()}function P(G){(G.code==="Enter"||G.code==="Space")&&(G.stopPropagation(),E(G.target)&&S(150))}function N(G){G.preventDefault(),G.stopPropagation(),O()}function R(G){(G.code==="Enter"||G.code==="Space")&&(G.preventDefault(),G.stopPropagation(),O())}function z(G){o&&!(m!=null&&m.contains(G.target))&&!(c!=null&&c.contains(G.target))&&O()}function F(G){o&&r&&G.code==="Escape"&&(G.preventDefault(),$())}function U(G){o&&(_=!(c!=null&&c.contains(G.target)))}function J(G){var pe;o&&_&&!(c!=null&&c.contains(G.target))&&!(m!=null&&m.contains(G.target))&&!((pe=G.target)!=null&&pe.closest(".flatpickr-calendar"))&&$()}Xt(()=>(L(),()=>I()));function Y(G){ie[G?"unshift":"push"](()=>{d=G,t(3,d)})}function Z(G){ie[G?"unshift":"push"](()=>{c=G,t(2,c)})}return n.$$set=G=>{"trigger"in G&&t(8,s=G.trigger),"active"in G&&t(0,o=G.active),"escClose"in G&&t(9,r=G.escClose),"autoScroll"in G&&t(10,a=G.autoScroll),"closableClass"in G&&t(11,u=G.closableClass),"class"in G&&t(1,f=G.class),"$$scope"in G&&t(17,l=G.$$scope)},n.$$.update=()=>{var G,pe;n.$$.dirty[0]&260&&c&&L(s),n.$$.dirty[0]&65537&&(o?((G=m==null?void 0:m.classList)==null||G.add("active"),m==null||m.setAttribute("aria-expanded",!0),k("show")):((pe=m==null?void 0:m.classList)==null||pe.remove("active"),m==null||m.setAttribute("aria-expanded",!1),k("hide")))},[o,f,c,d,z,F,U,J,s,r,a,u,S,$,T,O,m,l,i,Y,Z]}class jn extends Se{constructor(e){super(),we(this,e,Ew,Mw,ke,{trigger:8,active:0,escClose:9,autoScroll:10,closableClass:11,class:1,hideWithDelay:12,hide:13,show:14,toggle:15},null,[-1,-1])}get hideWithDelay(){return this.$$.ctx[12]}get hide(){return this.$$.ctx[13]}get show(){return this.$$.ctx[14]}get toggle(){return this.$$.ctx[15]}}const un=Hn(""),_r=Hn(""),Dl=Hn(!1),yn=Hn({});function Ut(n){yn.set(n||{})}function Yn(n){yn.update(e=>(V.deleteByPath(e,n),e))}const Rr=Hn({});function tc(n){Rr.set(n||{})}class Fn extends Error{constructor(e){var t,i,l,s;super("ClientResponseError"),this.url="",this.status=0,this.response={},this.isAbort=!1,this.originalError=null,Object.setPrototypeOf(this,Fn.prototype),e!==null&&typeof e=="object"&&(this.url=typeof e.url=="string"?e.url:"",this.status=typeof e.status=="number"?e.status:0,this.isAbort=!!e.isAbort,this.originalError=e.originalError,e.response!==null&&typeof e.response=="object"?this.response=e.response:e.data!==null&&typeof e.data=="object"?this.response=e.data:this.response={}),this.originalError||e instanceof Fn||(this.originalError=e),typeof DOMException<"u"&&e instanceof DOMException&&(this.isAbort=!0),this.name="ClientResponseError "+this.status,this.message=(t=this.response)==null?void 0:t.message,this.message||(this.isAbort?this.message="The request was autocancelled. You can find more info in https://github.com/pocketbase/js-sdk#auto-cancellation.":(s=(l=(i=this.originalError)==null?void 0:i.cause)==null?void 0:l.message)!=null&&s.includes("ECONNREFUSED ::1")?this.message="Failed to connect to the PocketBase server. Try changing the SDK URL from localhost to 127.0.0.1 (https://github.com/pocketbase/js-sdk/issues/21).":this.message="Something went wrong while processing your request.")}get data(){return this.response}toJSON(){return{...this}}}const Do=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function Dw(n,e){const t={};if(typeof n!="string")return t;const i=Object.assign({},{}).decode||Iw;let l=0;for(;l0&&(!t.exp||t.exp-e>Date.now()/1e3))}ok=typeof atob!="function"||Aw?n=>{let e=String(n).replace(/=+$/,"");if(e.length%4==1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(var t,i,l=0,s=0,o="";i=e.charAt(s++);~i&&(t=l%4?64*t+i:i,l++%4)?o+=String.fromCharCode(255&t>>(-2*l&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return o}:atob;const ic="pb_auth";class Mu{constructor(){this.baseToken="",this.baseModel=null,this._onChangeCallbacks=[]}get token(){return this.baseToken}get record(){return this.baseModel}get model(){return this.baseModel}get isValid(){return!Fr(this.token)}get isSuperuser(){var t,i;let e=xl(this.token);return e.type=="auth"&&(((t=this.record)==null?void 0:t.collectionName)=="_superusers"||!((i=this.record)!=null&&i.collectionName)&&e.collectionId=="pbc_3142635823")}get isAdmin(){return console.warn("Please replace pb.authStore.isAdmin with pb.authStore.isSuperuser OR simply check the value of pb.authStore.record?.collectionName"),this.isSuperuser}get isAuthRecord(){return console.warn("Please replace pb.authStore.isAuthRecord with !pb.authStore.isSuperuser OR simply check the value of pb.authStore.record?.collectionName"),xl(this.token).type=="auth"&&!this.isSuperuser}save(e,t){this.baseToken=e||"",this.baseModel=t||null,this.triggerChange()}clear(){this.baseToken="",this.baseModel=null,this.triggerChange()}loadFromCookie(e,t=ic){const i=Dw(e||"")[t]||"";let l={};try{l=JSON.parse(i),(typeof l===null||typeof l!="object"||Array.isArray(l))&&(l={})}catch{}this.save(l.token||"",l.record||l.model||null)}exportToCookie(e,t=ic){var a,u;const i={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},l=xl(this.token);i.expires=l!=null&&l.exp?new Date(1e3*l.exp):new Date("1970-01-01"),e=Object.assign({},i,e);const s={token:this.token,record:this.record?JSON.parse(JSON.stringify(this.record)):null};let o=nc(t,JSON.stringify(s),e);const r=typeof Blob<"u"?new Blob([o]).size:o.length;if(s.record&&r>4096){s.record={id:(a=s.record)==null?void 0:a.id,email:(u=s.record)==null?void 0:u.email};const f=["collectionId","collectionName","verified"];for(const c in this.record)f.includes(c)&&(s.record[c]=this.record[c]);o=nc(t,JSON.stringify(s),e)}return o}onChange(e,t=!1){return this._onChangeCallbacks.push(e),t&&e(this.token,this.record),()=>{for(let i=this._onChangeCallbacks.length-1;i>=0;i--)if(this._onChangeCallbacks[i]==e)return delete this._onChangeCallbacks[i],void this._onChangeCallbacks.splice(i,1)}}triggerChange(){for(const e of this._onChangeCallbacks)e&&e(this.token,this.record)}}class rk extends Mu{constructor(e="pocketbase_auth"){super(),this.storageFallback={},this.storageKey=e,this._bindStorageEvent()}get token(){return(this._storageGet(this.storageKey)||{}).token||""}get record(){const e=this._storageGet(this.storageKey)||{};return e.record||e.model||null}get model(){return this.record}save(e,t){this._storageSet(this.storageKey,{token:e,record:t}),super.save(e,t)}clear(){this._storageRemove(this.storageKey),super.clear()}_storageGet(e){if(typeof window<"u"&&(window!=null&&window.localStorage)){const t=window.localStorage.getItem(e)||"";try{return JSON.parse(t)}catch{return t}}return this.storageFallback[e]}_storageSet(e,t){if(typeof window<"u"&&(window!=null&&window.localStorage)){let i=t;typeof t!="string"&&(i=JSON.stringify(t)),window.localStorage.setItem(e,i)}else this.storageFallback[e]=t}_storageRemove(e){var t;typeof window<"u"&&(window!=null&&window.localStorage)&&((t=window.localStorage)==null||t.removeItem(e)),delete this.storageFallback[e]}_bindStorageEvent(){typeof window<"u"&&(window!=null&&window.localStorage)&&window.addEventListener&&window.addEventListener("storage",e=>{if(e.key!=this.storageKey)return;const t=this._storageGet(this.storageKey)||{};super.save(t.token||"",t.record||t.model||null)})}}class al{constructor(e){this.client=e}}class Pw extends al{async getAll(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/settings",e)}async update(e,t){return t=Object.assign({method:"PATCH",body:e},t),this.client.send("/api/settings",t)}async testS3(e="storage",t){return t=Object.assign({method:"POST",body:{filesystem:e}},t),this.client.send("/api/settings/test/s3",t).then(()=>!0)}async testEmail(e,t,i,l){return l=Object.assign({method:"POST",body:{email:t,template:i,collection:e}},l),this.client.send("/api/settings/test/email",l).then(()=>!0)}async generateAppleClientSecret(e,t,i,l,s,o){return o=Object.assign({method:"POST",body:{clientId:e,teamId:t,keyId:i,privateKey:l,duration:s}},o),this.client.send("/api/settings/apple/generate-client-secret",o)}}const Nw=["requestKey","$cancelKey","$autoCancel","fetch","headers","body","query","params","cache","credentials","headers","integrity","keepalive","method","mode","redirect","referrer","referrerPolicy","signal","window"];function Eu(n){if(n){n.query=n.query||{};for(let e in n)Nw.includes(e)||(n.query[e]=n[e],delete n[e])}}function ak(n){const e=[];for(const t in n){if(n[t]===null)continue;const i=n[t],l=encodeURIComponent(t);if(Array.isArray(i))for(const s of i)e.push(l+"="+encodeURIComponent(s));else i instanceof Date?e.push(l+"="+encodeURIComponent(i.toISOString())):typeof i!==null&&typeof i=="object"?e.push(l+"="+encodeURIComponent(JSON.stringify(i))):e.push(l+"="+encodeURIComponent(i))}return e.join("&")}class uk extends al{constructor(){super(...arguments),this.clientId="",this.eventSource=null,this.subscriptions={},this.lastSentSubscriptions=[],this.maxConnectTimeout=15e3,this.reconnectAttempts=0,this.maxReconnectAttempts=1/0,this.predefinedReconnectIntervals=[200,300,500,1e3,1200,1500,2e3],this.pendingConnects=[]}get isConnected(){return!!this.eventSource&&!!this.clientId&&!this.pendingConnects.length}async subscribe(e,t,i){var o;if(!e)throw new Error("topic must be set.");let l=e;if(i){Eu(i=Object.assign({},i));const r="options="+encodeURIComponent(JSON.stringify({query:i.query,headers:i.headers}));l+=(l.includes("?")?"&":"?")+r}const s=function(r){const a=r;let u;try{u=JSON.parse(a==null?void 0:a.data)}catch{}t(u||{})};return this.subscriptions[l]||(this.subscriptions[l]=[]),this.subscriptions[l].push(s),this.isConnected?this.subscriptions[l].length===1?await this.submitSubscriptions():(o=this.eventSource)==null||o.addEventListener(l,s):await this.connect(),async()=>this.unsubscribeByTopicAndListener(e,s)}async unsubscribe(e){var i;let t=!1;if(e){const l=this.getSubscriptionsByTopic(e);for(let s in l)if(this.hasSubscriptionListeners(s)){for(let o of this.subscriptions[s])(i=this.eventSource)==null||i.removeEventListener(s,o);delete this.subscriptions[s],t||(t=!0)}}else this.subscriptions={};this.hasSubscriptionListeners()?t&&await this.submitSubscriptions():this.disconnect()}async unsubscribeByPrefix(e){var i;let t=!1;for(let l in this.subscriptions)if((l+"?").startsWith(e)){t=!0;for(let s of this.subscriptions[l])(i=this.eventSource)==null||i.removeEventListener(l,s);delete this.subscriptions[l]}t&&(this.hasSubscriptionListeners()?await this.submitSubscriptions():this.disconnect())}async unsubscribeByTopicAndListener(e,t){var s;let i=!1;const l=this.getSubscriptionsByTopic(e);for(let o in l){if(!Array.isArray(this.subscriptions[o])||!this.subscriptions[o].length)continue;let r=!1;for(let a=this.subscriptions[o].length-1;a>=0;a--)this.subscriptions[o][a]===t&&(r=!0,delete this.subscriptions[o][a],this.subscriptions[o].splice(a,1),(s=this.eventSource)==null||s.removeEventListener(o,t));r&&(this.subscriptions[o].length||delete this.subscriptions[o],i||this.hasSubscriptionListeners(o)||(i=!0))}this.hasSubscriptionListeners()?i&&await this.submitSubscriptions():this.disconnect()}hasSubscriptionListeners(e){var t,i;if(this.subscriptions=this.subscriptions||{},e)return!!((t=this.subscriptions[e])!=null&&t.length);for(let l in this.subscriptions)if((i=this.subscriptions[l])!=null&&i.length)return!0;return!1}async submitSubscriptions(){if(this.clientId)return this.addAllSubscriptionListeners(),this.lastSentSubscriptions=this.getNonEmptySubscriptionKeys(),this.client.send("/api/realtime",{method:"POST",body:{clientId:this.clientId,subscriptions:this.lastSentSubscriptions},requestKey:this.getSubscriptionsCancelKey()}).catch(e=>{if(!(e!=null&&e.isAbort))throw e})}getSubscriptionsCancelKey(){return"realtime_"+this.clientId}getSubscriptionsByTopic(e){const t={};e=e.includes("?")?e:e+"?";for(let i in this.subscriptions)(i+"?").startsWith(e)&&(t[i]=this.subscriptions[i]);return t}getNonEmptySubscriptionKeys(){const e=[];for(let t in this.subscriptions)this.subscriptions[t].length&&e.push(t);return e}addAllSubscriptionListeners(){if(this.eventSource){this.removeAllSubscriptionListeners();for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.addEventListener(e,t)}}removeAllSubscriptionListeners(){if(this.eventSource)for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.removeEventListener(e,t)}async connect(){if(!(this.reconnectAttempts>0))return new Promise((e,t)=>{this.pendingConnects.push({resolve:e,reject:t}),this.pendingConnects.length>1||this.initConnect()})}initConnect(){this.disconnect(!0),clearTimeout(this.connectTimeoutId),this.connectTimeoutId=setTimeout(()=>{this.connectErrorHandler(new Error("EventSource connect took too long."))},this.maxConnectTimeout),this.eventSource=new EventSource(this.client.buildURL("/api/realtime")),this.eventSource.onerror=e=>{this.connectErrorHandler(new Error("Failed to establish realtime connection."))},this.eventSource.addEventListener("PB_CONNECT",e=>{const t=e;this.clientId=t==null?void 0:t.lastEventId,this.submitSubscriptions().then(async()=>{let i=3;for(;this.hasUnsentSubscriptions()&&i>0;)i--,await this.submitSubscriptions()}).then(()=>{for(let l of this.pendingConnects)l.resolve();this.pendingConnects=[],this.reconnectAttempts=0,clearTimeout(this.reconnectTimeoutId),clearTimeout(this.connectTimeoutId);const i=this.getSubscriptionsByTopic("PB_CONNECT");for(let l in i)for(let s of i[l])s(e)}).catch(i=>{this.clientId="",this.connectErrorHandler(i)})})}hasUnsentSubscriptions(){const e=this.getNonEmptySubscriptionKeys();if(e.length!=this.lastSentSubscriptions.length)return!0;for(const t of e)if(!this.lastSentSubscriptions.includes(t))return!0;return!1}connectErrorHandler(e){if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),!this.clientId&&!this.reconnectAttempts||this.reconnectAttempts>this.maxReconnectAttempts){for(let i of this.pendingConnects)i.reject(new Fn(e));return this.pendingConnects=[],void this.disconnect()}this.disconnect(!0);const t=this.predefinedReconnectIntervals[this.reconnectAttempts]||this.predefinedReconnectIntervals[this.predefinedReconnectIntervals.length-1];this.reconnectAttempts++,this.reconnectTimeoutId=setTimeout(()=>{this.initConnect()},t)}disconnect(e=!1){var t;if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),this.removeAllSubscriptionListeners(),this.client.cancelRequest(this.getSubscriptionsCancelKey()),(t=this.eventSource)==null||t.close(),this.eventSource=null,this.clientId="",!e){this.reconnectAttempts=0;for(let i of this.pendingConnects)i.resolve();this.pendingConnects=[]}}}class fk extends al{decode(e){return e}async getFullList(e,t){if(typeof e=="number")return this._getFullList(e,t);let i=500;return(t=Object.assign({},e,t)).batch&&(i=t.batch,delete t.batch),this._getFullList(i,t)}async getList(e=1,t=30,i){return(i=Object.assign({method:"GET"},i)).query=Object.assign({page:e,perPage:t},i.query),this.client.send(this.baseCrudPath,i).then(l=>{var s;return l.items=((s=l.items)==null?void 0:s.map(o=>this.decode(o)))||[],l})}async getFirstListItem(e,t){return(t=Object.assign({requestKey:"one_by_filter_"+this.baseCrudPath+"_"+e},t)).query=Object.assign({filter:e,skipTotal:1},t.query),this.getList(1,1,t).then(i=>{var l;if(!((l=i==null?void 0:i.items)!=null&&l.length))throw new Fn({status:404,response:{code:404,message:"The requested resource wasn't found.",data:{}}});return i.items[0]})}async getOne(e,t){if(!e)throw new Fn({url:this.client.buildURL(this.baseCrudPath+"/"),status:404,response:{code:404,message:"Missing required record id.",data:{}}});return t=Object.assign({method:"GET"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(i=>this.decode(i))}async create(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send(this.baseCrudPath,t).then(i=>this.decode(i))}async update(e,t,i){return i=Object.assign({method:"PATCH",body:t},i),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),i).then(l=>this.decode(l))}async delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(()=>!0)}_getFullList(e=500,t){(t=t||{}).query=Object.assign({skipTotal:1},t.query);let i=[],l=async s=>this.getList(s,e||500,t).then(o=>{const r=o.items;return i=i.concat(r),r.length==o.perPage?l(s+1):i});return l(1)}}function Ki(n,e,t,i){const l=i!==void 0;return l||t!==void 0?l?(console.warn(n),e.body=Object.assign({},e.body,t),e.query=Object.assign({},e.query,i),e):Object.assign(e,t):e}function oa(n){var e;(e=n._resetAutoRefresh)==null||e.call(n)}class Rw extends fk{constructor(e,t){super(e),this.collectionIdOrName=t}get baseCrudPath(){return this.baseCollectionPath+"/records"}get baseCollectionPath(){return"/api/collections/"+encodeURIComponent(this.collectionIdOrName)}get isSuperusers(){return this.collectionIdOrName=="_superusers"||this.collectionIdOrName=="_pbc_2773867675"}async subscribe(e,t,i){if(!e)throw new Error("Missing topic.");if(!t)throw new Error("Missing subscription callback.");return this.client.realtime.subscribe(this.collectionIdOrName+"/"+e,t,i)}async unsubscribe(e){return e?this.client.realtime.unsubscribe(this.collectionIdOrName+"/"+e):this.client.realtime.unsubscribeByPrefix(this.collectionIdOrName)}async getFullList(e,t){if(typeof e=="number")return super.getFullList(e,t);const i=Object.assign({},e,t);return super.getFullList(i)}async getList(e=1,t=30,i){return super.getList(e,t,i)}async getFirstListItem(e,t){return super.getFirstListItem(e,t)}async getOne(e,t){return super.getOne(e,t)}async create(e,t){return super.create(e,t)}async update(e,t,i){return super.update(e,t,i).then(l=>{var s,o,r;if(((s=this.client.authStore.record)==null?void 0:s.id)===(l==null?void 0:l.id)&&(((o=this.client.authStore.record)==null?void 0:o.collectionId)===this.collectionIdOrName||((r=this.client.authStore.record)==null?void 0:r.collectionName)===this.collectionIdOrName)){let a=Object.assign({},this.client.authStore.record.expand),u=Object.assign({},this.client.authStore.record,l);a&&(u.expand=Object.assign(a,l.expand)),this.client.authStore.save(this.client.authStore.token,u)}return l})}async delete(e,t){return super.delete(e,t).then(i=>{var l,s,o;return!i||((l=this.client.authStore.record)==null?void 0:l.id)!==e||((s=this.client.authStore.record)==null?void 0:s.collectionId)!==this.collectionIdOrName&&((o=this.client.authStore.record)==null?void 0:o.collectionName)!==this.collectionIdOrName||this.client.authStore.clear(),i})}authResponse(e){const t=this.decode((e==null?void 0:e.record)||{});return this.client.authStore.save(e==null?void 0:e.token,t),Object.assign({},e,{token:(e==null?void 0:e.token)||"",record:t})}async listAuthMethods(e){return e=Object.assign({method:"GET",fields:"mfa,otp,password,oauth2"},e),this.client.send(this.baseCollectionPath+"/auth-methods",e)}async authWithPassword(e,t,i){let l;i=Object.assign({method:"POST",body:{identity:e,password:t}},i),this.isSuperusers&&(l=i.autoRefreshThreshold,delete i.autoRefreshThreshold,i.autoRefresh||oa(this.client));let s=await this.client.send(this.baseCollectionPath+"/auth-with-password",i);return s=this.authResponse(s),l&&this.isSuperusers&&function(r,a,u,f){oa(r);const c=r.beforeSend,d=r.authStore.record,m=r.authStore.onChange((h,g)=>{(!h||(g==null?void 0:g.id)!=(d==null?void 0:d.id)||(g!=null&&g.collectionId||d!=null&&d.collectionId)&&(g==null?void 0:g.collectionId)!=(d==null?void 0:d.collectionId))&&oa(r)});r._resetAutoRefresh=function(){m(),r.beforeSend=c,delete r._resetAutoRefresh},r.beforeSend=async(h,g)=>{var $;const _=r.authStore.token;if(($=g.query)!=null&&$.autoRefresh)return c?c(h,g):{url:h,sendOptions:g};let k=r.authStore.isValid;if(k&&Fr(r.authStore.token,a))try{await u()}catch{k=!1}k||await f();const S=g.headers||{};for(let T in S)if(T.toLowerCase()=="authorization"&&_==S[T]&&r.authStore.token){S[T]=r.authStore.token;break}return g.headers=S,c?c(h,g):{url:h,sendOptions:g}}}(this.client,l,()=>this.authRefresh({autoRefresh:!0}),()=>this.authWithPassword(e,t,Object.assign({autoRefresh:!0},i))),s}async authWithOAuth2Code(e,t,i,l,s,o,r){let a={method:"POST",body:{provider:e,code:t,codeVerifier:i,redirectURL:l,createData:s}};return a=Ki("This form of authWithOAuth2Code(provider, code, codeVerifier, redirectURL, createData?, body?, query?) is deprecated. Consider replacing it with authWithOAuth2Code(provider, code, codeVerifier, redirectURL, createData?, options?).",a,o,r),this.client.send(this.baseCollectionPath+"/auth-with-oauth2",a).then(u=>this.authResponse(u))}authWithOAuth2(...e){if(e.length>1||typeof(e==null?void 0:e[0])=="string")return console.warn("PocketBase: This form of authWithOAuth2() is deprecated and may get removed in the future. Please replace with authWithOAuth2Code() OR use the authWithOAuth2() realtime form as shown in https://pocketbase.io/docs/authentication/#oauth2-integration."),this.authWithOAuth2Code((e==null?void 0:e[0])||"",(e==null?void 0:e[1])||"",(e==null?void 0:e[2])||"",(e==null?void 0:e[3])||"",(e==null?void 0:e[4])||{},(e==null?void 0:e[5])||{},(e==null?void 0:e[6])||{});const t=(e==null?void 0:e[0])||{};let i=null;t.urlCallback||(i=lc(void 0));const l=new uk(this.client);function s(){i==null||i.close(),l.unsubscribe()}const o={},r=t.requestKey;return r&&(o.requestKey=r),this.listAuthMethods(o).then(a=>{var d;const u=a.oauth2.providers.find(m=>m.name===t.provider);if(!u)throw new Fn(new Error(`Missing or invalid provider "${t.provider}".`));const f=this.client.buildURL("/api/oauth2-redirect"),c=r?(d=this.client.cancelControllers)==null?void 0:d[r]:void 0;return c&&(c.signal.onabort=()=>{s()}),new Promise(async(m,h)=>{var g;try{await l.subscribe("@oauth2",async $=>{var O;const T=l.clientId;try{if(!$.state||T!==$.state)throw new Error("State parameters don't match.");if($.error||!$.code)throw new Error("OAuth2 redirect error or missing code: "+$.error);const E=Object.assign({},t);delete E.provider,delete E.scopes,delete E.createData,delete E.urlCallback,(O=c==null?void 0:c.signal)!=null&&O.onabort&&(c.signal.onabort=null);const L=await this.authWithOAuth2Code(u.name,$.code,u.codeVerifier,f,t.createData,E);m(L)}catch(E){h(new Fn(E))}s()});const _={state:l.clientId};(g=t.scopes)!=null&&g.length&&(_.scope=t.scopes.join(" "));const k=this._replaceQueryParams(u.authURL+f,_);await(t.urlCallback||function($){i?i.location.href=$:i=lc($)})(k)}catch(_){s(),h(new Fn(_))}})}).catch(a=>{throw s(),a})}async authRefresh(e,t){let i={method:"POST"};return i=Ki("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",i,e,t),this.client.send(this.baseCollectionPath+"/auth-refresh",i).then(l=>this.authResponse(l))}async requestPasswordReset(e,t,i){let l={method:"POST",body:{email:e}};return l=Ki("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-password-reset",l).then(()=>!0)}async confirmPasswordReset(e,t,i,l,s){let o={method:"POST",body:{token:e,password:t,passwordConfirm:i}};return o=Ki("This form of confirmPasswordReset(token, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(token, password, passwordConfirm, options?).",o,l,s),this.client.send(this.baseCollectionPath+"/confirm-password-reset",o).then(()=>!0)}async requestVerification(e,t,i){let l={method:"POST",body:{email:e}};return l=Ki("This form of requestVerification(email, body?, query?) is deprecated. Consider replacing it with requestVerification(email, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-verification",l).then(()=>!0)}async confirmVerification(e,t,i){let l={method:"POST",body:{token:e}};return l=Ki("This form of confirmVerification(token, body?, query?) is deprecated. Consider replacing it with confirmVerification(token, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/confirm-verification",l).then(()=>{const s=xl(e),o=this.client.authStore.record;return o&&!o.verified&&o.id===s.id&&o.collectionId===s.collectionId&&(o.verified=!0,this.client.authStore.save(this.client.authStore.token,o)),!0})}async requestEmailChange(e,t,i){let l={method:"POST",body:{newEmail:e}};return l=Ki("This form of requestEmailChange(newEmail, body?, query?) is deprecated. Consider replacing it with requestEmailChange(newEmail, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-email-change",l).then(()=>!0)}async confirmEmailChange(e,t,i,l){let s={method:"POST",body:{token:e,password:t}};return s=Ki("This form of confirmEmailChange(token, password, body?, query?) is deprecated. Consider replacing it with confirmEmailChange(token, password, options?).",s,i,l),this.client.send(this.baseCollectionPath+"/confirm-email-change",s).then(()=>{const o=xl(e),r=this.client.authStore.record;return r&&r.id===o.id&&r.collectionId===o.collectionId&&this.client.authStore.clear(),!0})}async listExternalAuths(e,t){return this.client.collection("_externalAuths").getFullList(Object.assign({},t,{filter:this.client.filter("recordRef = {:id}",{id:e})}))}async unlinkExternalAuth(e,t,i){const l=await this.client.collection("_externalAuths").getFirstListItem(this.client.filter("recordRef = {:recordId} && provider = {:provider}",{recordId:e,provider:t}));return this.client.collection("_externalAuths").delete(l.id,i).then(()=>!0)}async requestOTP(e,t){return t=Object.assign({method:"POST",body:{email:e}},t),this.client.send(this.baseCollectionPath+"/request-otp",t)}async authWithOTP(e,t,i){return i=Object.assign({method:"POST",body:{otpId:e,password:t}},i),this.client.send(this.baseCollectionPath+"/auth-with-otp",i).then(l=>this.authResponse(l))}async impersonate(e,t,i){(i=Object.assign({method:"POST",body:{duration:t}},i)).headers=i.headers||{},i.headers.Authorization||(i.headers.Authorization=this.client.authStore.token);const l=new co(this.client.baseURL,new Mu,this.client.lang),s=await l.send(this.baseCollectionPath+"/impersonate/"+encodeURIComponent(e),i);return l.authStore.save(s==null?void 0:s.token,this.decode((s==null?void 0:s.record)||{})),l}_replaceQueryParams(e,t={}){let i=e,l="";e.indexOf("?")>=0&&(i=e.substring(0,e.indexOf("?")),l=e.substring(e.indexOf("?")+1));const s={},o=l.split("&");for(const r of o){if(r=="")continue;const a=r.split("=");s[decodeURIComponent(a[0].replace(/\+/g," "))]=decodeURIComponent((a[1]||"").replace(/\+/g," "))}for(let r in t)t.hasOwnProperty(r)&&(t[r]==null?delete s[r]:s[r]=t[r]);l="";for(let r in s)s.hasOwnProperty(r)&&(l!=""&&(l+="&"),l+=encodeURIComponent(r.replace(/%20/g,"+"))+"="+encodeURIComponent(s[r].replace(/%20/g,"+")));return l!=""?i+"?"+l:i}}function lc(n){if(typeof window>"u"||!(window!=null&&window.open))throw new Fn(new Error("Not in a browser context - please pass a custom urlCallback function."));let e=1024,t=768,i=window.innerWidth,l=window.innerHeight;e=e>i?i:e,t=t>l?l:t;let s=i/2-e/2,o=l/2-t/2;return window.open(n,"popup_window","width="+e+",height="+t+",top="+o+",left="+s+",resizable,menubar=no")}class Fw extends fk{get baseCrudPath(){return"/api/collections"}async import(e,t=!1,i){return i=Object.assign({method:"PUT",body:{collections:e,deleteMissing:t}},i),this.client.send(this.baseCrudPath+"/import",i).then(()=>!0)}async getScaffolds(e){return e=Object.assign({method:"GET"},e),this.client.send(this.baseCrudPath+"/meta/scaffolds",e)}async truncate(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e)+"/truncate",t).then(()=>!0)}}class qw extends al{async getList(e=1,t=30,i){return(i=Object.assign({method:"GET"},i)).query=Object.assign({page:e,perPage:t},i.query),this.client.send("/api/logs",i)}async getOne(e,t){if(!e)throw new Fn({url:this.client.buildURL("/api/logs/"),status:404,response:{code:404,message:"Missing required log id.",data:{}}});return t=Object.assign({method:"GET"},t),this.client.send("/api/logs/"+encodeURIComponent(e),t)}async getStats(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/logs/stats",e)}}class Hw extends al{async check(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/health",e)}}class jw extends al{getUrl(e,t,i={}){return console.warn("Please replace pb.files.getUrl() with pb.files.getURL()"),this.getURL(e,t,i)}getURL(e,t,i={}){if(!t||!(e!=null&&e.id)||!(e!=null&&e.collectionId)&&!(e!=null&&e.collectionName))return"";const l=[];l.push("api"),l.push("files"),l.push(encodeURIComponent(e.collectionId||e.collectionName)),l.push(encodeURIComponent(e.id)),l.push(encodeURIComponent(t));let s=this.client.buildURL(l.join("/"));if(Object.keys(i).length){i.download===!1&&delete i.download;const o=new URLSearchParams(i);s+=(s.includes("?")?"&":"?")+o}return s}async getToken(e){return e=Object.assign({method:"POST"},e),this.client.send("/api/files/token",e).then(t=>(t==null?void 0:t.token)||"")}}class zw extends al{async getFullList(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/backups",e)}async create(e,t){return t=Object.assign({method:"POST",body:{name:e}},t),this.client.send("/api/backups",t).then(()=>!0)}async upload(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send("/api/backups/upload",t).then(()=>!0)}async delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}`,t).then(()=>!0)}async restore(e,t){return t=Object.assign({method:"POST"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}/restore`,t).then(()=>!0)}getDownloadUrl(e,t){return console.warn("Please replace pb.backups.getDownloadUrl() with pb.backups.getDownloadURL()"),this.getDownloadURL(e,t)}getDownloadURL(e,t){return this.client.buildURL(`/api/backups/${encodeURIComponent(t)}?token=${encodeURIComponent(e)}`)}}function Ya(n){return typeof Blob<"u"&&n instanceof Blob||typeof File<"u"&&n instanceof File||n!==null&&typeof n=="object"&&n.uri&&(typeof navigator<"u"&&navigator.product==="ReactNative"||typeof global<"u"&&global.HermesInternal)}function sc(n){return n&&(n.constructor.name==="FormData"||typeof FormData<"u"&&n instanceof FormData)}function oc(n){for(const e in n){const t=Array.isArray(n[e])?n[e]:[n[e]];for(const i of t)if(Ya(i))return!0}return!1}class Uw extends al{constructor(){super(...arguments),this.requests=[],this.subs={}}collection(e){return this.subs[e]||(this.subs[e]=new Vw(this.requests,e)),this.subs[e]}async send(e){const t=new FormData,i=[];for(let l=0;l0&&s.length==l.length){e.files[i]=e.files[i]||[];for(let r of s)e.files[i].push(r)}else if(e.json[i]=o,s.length>0){let r=i;i.startsWith("+")||i.endsWith("+")||(r+="+"),e.files[r]=e.files[r]||[];for(let a of s)e.files[r].push(a)}}else e.json[i]=l}}}class co{get baseUrl(){return this.baseURL}set baseUrl(e){this.baseURL=e}constructor(e="/",t,i="en-US"){this.cancelControllers={},this.recordServices={},this.enableAutoCancellation=!0,this.baseURL=e,this.lang=i,t?this.authStore=t:typeof window<"u"&&window.Deno?this.authStore=new Mu:this.authStore=new rk,this.collections=new Fw(this),this.files=new jw(this),this.logs=new qw(this),this.settings=new Pw(this),this.realtime=new uk(this),this.health=new Hw(this),this.backups=new zw(this)}get admins(){return this.collection("_superusers")}createBatch(){return new Uw(this)}collection(e){return this.recordServices[e]||(this.recordServices[e]=new Rw(this,e)),this.recordServices[e]}autoCancellation(e){return this.enableAutoCancellation=!!e,this}cancelRequest(e){return this.cancelControllers[e]&&(this.cancelControllers[e].abort(),delete this.cancelControllers[e]),this}cancelAllRequests(){for(let e in this.cancelControllers)this.cancelControllers[e].abort();return this.cancelControllers={},this}filter(e,t){if(!t)return e;for(let i in t){let l=t[i];switch(typeof l){case"boolean":case"number":l=""+l;break;case"string":l="'"+l.replace(/'/g,"\\'")+"'";break;default:l=l===null?"null":l instanceof Date?"'"+l.toISOString().replace("T"," ")+"'":"'"+JSON.stringify(l).replace(/'/g,"\\'")+"'"}e=e.replaceAll("{:"+i+"}",l)}return e}getFileUrl(e,t,i={}){return console.warn("Please replace pb.getFileUrl() with pb.files.getURL()"),this.files.getURL(e,t,i)}buildUrl(e){return console.warn("Please replace pb.buildUrl() with pb.buildURL()"),this.buildURL(e)}buildURL(e){var i;let t=this.baseURL;return typeof window>"u"||!window.location||t.startsWith("https://")||t.startsWith("http://")||(t=(i=window.location.origin)!=null&&i.endsWith("/")?window.location.origin.substring(0,window.location.origin.length-1):window.location.origin||"",this.baseURL.startsWith("/")||(t+=window.location.pathname||"/",t+=t.endsWith("/")?"":"/"),t+=this.baseURL),e&&(t+=t.endsWith("/")?"":"/",t+=e.startsWith("/")?e.substring(1):e),t}async send(e,t){t=this.initSendOptions(e,t);let i=this.buildURL(e);if(this.beforeSend){const l=Object.assign({},await this.beforeSend(i,t));l.url!==void 0||l.options!==void 0?(i=l.url||i,t=l.options||t):Object.keys(l).length&&(t=l,console!=null&&console.warn&&console.warn("Deprecated format of beforeSend return: please use `return { url, options }`, instead of `return options`."))}if(t.query!==void 0){const l=ak(t.query);l&&(i+=(i.includes("?")?"&":"?")+l),delete t.query}return this.getHeader(t.headers,"Content-Type")=="application/json"&&t.body&&typeof t.body!="string"&&(t.body=JSON.stringify(t.body)),(t.fetch||fetch)(i,t).then(async l=>{let s={};try{s=await l.json()}catch{}if(this.afterSend&&(s=await this.afterSend(l,s,t)),l.status>=400)throw new Fn({url:l.url,status:l.status,data:s});return s}).catch(l=>{throw new Fn(l)})}initSendOptions(e,t){if((t=Object.assign({method:"GET"},t)).body=function(l){if(typeof FormData>"u"||l===void 0||typeof l!="object"||l===null||sc(l)||!oc(l))return l;const s=new FormData;for(const o in l){const r=l[o];if(typeof r!="object"||oc({data:r})){const a=Array.isArray(r)?r:[r];for(let u of a)s.append(o,u)}else{let a={};a[o]=r,s.append("@jsonPayload",JSON.stringify(a))}}return s}(t.body),Eu(t),t.query=Object.assign({},t.params,t.query),t.requestKey===void 0&&(t.$autoCancel===!1||t.query.$autoCancel===!1?t.requestKey=null:(t.$cancelKey||t.query.$cancelKey)&&(t.requestKey=t.$cancelKey||t.query.$cancelKey)),delete t.$autoCancel,delete t.query.$autoCancel,delete t.$cancelKey,delete t.query.$cancelKey,this.getHeader(t.headers,"Content-Type")!==null||sc(t.body)||(t.headers=Object.assign({},t.headers,{"Content-Type":"application/json"})),this.getHeader(t.headers,"Accept-Language")===null&&(t.headers=Object.assign({},t.headers,{"Accept-Language":this.lang})),this.authStore.token&&this.getHeader(t.headers,"Authorization")===null&&(t.headers=Object.assign({},t.headers,{Authorization:this.authStore.token})),this.enableAutoCancellation&&t.requestKey!==null){const i=t.requestKey||(t.method||"GET")+e;delete t.requestKey,this.cancelRequest(i);const l=new AbortController;this.cancelControllers[i]=l,t.signal=l.signal}return t}getHeader(e,t){e=e||{},t=t.toLowerCase();for(let i in e)if(i.toLowerCase()==t)return e[i];return null}}const Mn=Hn([]),ti=Hn({}),Js=Hn(!1),ck=Hn({}),Du=Hn({});let As;typeof BroadcastChannel<"u"&&(As=new BroadcastChannel("collections"),As.onmessage=()=>{var n;Iu((n=Vb(ti))==null?void 0:n.id)});function dk(){As==null||As.postMessage("reload")}function Bw(n){Mn.update(e=>{const t=e.find(i=>i.id==n||i.name==n);return t?ti.set(t):e.length&&ti.set(e.find(i=>!i.system)||e[0]),e})}function Ww(n){ti.update(e=>V.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),Mn.update(e=>(V.pushOrReplaceByKey(e,n,"id"),Lu(),dk(),V.sortCollections(e)))}function Yw(n){Mn.update(e=>(V.removeByKey(e,"id",n.id),ti.update(t=>t.id===n.id?e.find(i=>!i.system)||e[0]:t),Lu(),dk(),e))}async function Iu(n=null){Js.set(!0);try{let e=await _e.collections.getFullList(200,{sort:"+name"});e=V.sortCollections(e),Mn.set(e);const t=n&&e.find(i=>i.id==n||i.name==n);t?ti.set(t):e.length&&ti.set(e.find(i=>!i.system)||e[0]),Lu(),Du.set(await _e.collections.getScaffolds())}catch(e){_e.error(e)}Js.set(!1)}function Lu(){ck.update(n=>(Mn.update(e=>{var t;for(let i of e)n[i.id]=!!((t=i.fields)!=null&&t.find(l=>l.type=="file"&&l.protected));return e}),n))}function pk(n,e){if(n instanceof RegExp)return{keys:!1,pattern:n};var t,i,l,s,o=[],r="",a=n.split("/");for(a[0]||a.shift();l=a.shift();)t=l[0],t==="*"?(o.push("wild"),r+="/(.*)"):t===":"?(i=l.indexOf("?",1),s=l.indexOf(".",1),o.push(l.substring(1,~i?i:~s?s:l.length)),r+=~i&&!~s?"(?:/([^/]+?))?":"/([^/]+?)",~s&&(r+=(~i?"?":"")+"\\"+l.substring(s))):r+="/"+l;return{keys:o,pattern:new RegExp("^"+r+"/?$","i")}}function Kw(n){let e,t,i;const l=[n[2]];var s=n[0];function o(r,a){let u={};for(let f=0;f{H(u,1)}),ae()}s?(e=zt(s,o(r,a)),e.$on("routeEvent",r[7]),j(e.$$.fragment),M(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(s){const u=a&4?wt(l,[Rt(r[2])]):{};e.$set(u)}},i(r){i||(e&&M(e.$$.fragment,r),i=!0)},o(r){e&&D(e.$$.fragment,r),i=!1},d(r){r&&y(t),e&&H(e,r)}}}function Jw(n){let e,t,i;const l=[{params:n[1]},n[2]];var s=n[0];function o(r,a){let u={};for(let f=0;f{H(u,1)}),ae()}s?(e=zt(s,o(r,a)),e.$on("routeEvent",r[6]),j(e.$$.fragment),M(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(s){const u=a&6?wt(l,[a&2&&{params:r[1]},a&4&&Rt(r[2])]):{};e.$set(u)}},i(r){i||(e&&M(e.$$.fragment,r),i=!0)},o(r){e&&D(e.$$.fragment,r),i=!1},d(r){r&&y(t),e&&H(e,r)}}}function Zw(n){let e,t,i,l;const s=[Jw,Kw],o=[];function r(a,u){return a[1]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),v(a,i,u),l=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),D(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&y(i),o[e].d(a)}}}function rc(){const n=window.location.href.indexOf("#/");let e=n>-1?window.location.href.substr(n+1):"/";const t=e.indexOf("?");let i="";return t>-1&&(i=e.substr(t+1),e=e.substr(0,t)),{location:e,querystring:i}}const qr=nk(null,function(e){e(rc());const t=()=>{e(rc())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});ik(qr,n=>n.location);const Au=ik(qr,n=>n.querystring),ac=Hn(void 0);async function is(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await dn();const e=(n.charAt(0)=="#"?"":"#")+n;try{const t={...history.state};delete t.__svelte_spa_router_scrollX,delete t.__svelte_spa_router_scrollY,window.history.replaceState(t,void 0,e)}catch{console.warn("Caught exception while replacing the current page. If you're running this in the Svelte REPL, please note that the `replace` method might not work in this environment.")}window.dispatchEvent(new Event("hashchange"))}function Bn(n,e){if(e=fc(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with tags');return uc(n,e),{update(t){t=fc(t),uc(n,t)}}}function Gw(n){n?window.scrollTo(n.__svelte_spa_router_scrollX,n.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function uc(n,e){let t=e.href||n.getAttribute("href");if(t&&t.charAt(0)=="/")t="#"+t;else if(!t||t.length<2||t.slice(0,2)!="#/")throw Error('Invalid value for "href" attribute: '+t);n.setAttribute("href",t),n.addEventListener("click",i=>{i.preventDefault(),e.disabled||Xw(i.currentTarget.getAttribute("href"))})}function fc(n){return n&&typeof n=="string"?{href:n}:n||{}}function Xw(n){history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=n}function Qw(n,e,t){let{routes:i={}}=e,{prefix:l=""}=e,{restoreScrollState:s=!1}=e;class o{constructor(O,E){if(!E||typeof E!="function"&&(typeof E!="object"||E._sveltesparouter!==!0))throw Error("Invalid component object");if(!O||typeof O=="string"&&(O.length<1||O.charAt(0)!="/"&&O.charAt(0)!="*")||typeof O=="object"&&!(O instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:L,keys:I}=pk(O);this.path=O,typeof E=="object"&&E._sveltesparouter===!0?(this.component=E.component,this.conditions=E.conditions||[],this.userData=E.userData,this.props=E.props||{}):(this.component=()=>Promise.resolve(E),this.conditions=[],this.props={}),this._pattern=L,this._keys=I}match(O){if(l){if(typeof l=="string")if(O.startsWith(l))O=O.substr(l.length)||"/";else return null;else if(l instanceof RegExp){const A=O.match(l);if(A&&A[0])O=O.substr(A[0].length)||"/";else return null}}const E=this._pattern.exec(O);if(E===null)return null;if(this._keys===!1)return E;const L={};let I=0;for(;I{r.push(new o(O,T))}):Object.keys(i).forEach(T=>{r.push(new o(T,i[T]))});let a=null,u=null,f={};const c=kt();async function d(T,O){await dn(),c(T,O)}let m=null,h=null;s&&(h=T=>{T.state&&(T.state.__svelte_spa_router_scrollY||T.state.__svelte_spa_router_scrollX)?m=T.state:m=null},window.addEventListener("popstate",h),Wy(()=>{Gw(m)}));let g=null,_=null;const k=qr.subscribe(async T=>{g=T;let O=0;for(;O{ac.set(u)});return}t(0,a=null),_=null,ac.set(void 0)});oo(()=>{k(),h&&window.removeEventListener("popstate",h)});function S(T){Pe.call(this,n,T)}function $(T){Pe.call(this,n,T)}return n.$$set=T=>{"routes"in T&&t(3,i=T.routes),"prefix"in T&&t(4,l=T.prefix),"restoreScrollState"in T&&t(5,s=T.restoreScrollState)},n.$$.update=()=>{n.$$.dirty&32&&(history.scrollRestoration=s?"manual":"auto")},[a,u,f,i,l,s,S,$]}class xw extends Se{constructor(e){super(),we(this,e,Qw,Zw,ke,{routes:3,prefix:4,restoreScrollState:5})}}const ra="pb_superuser_file_token";co.prototype.logout=function(n=!0){this.authStore.clear(),n&&is("/login")};co.prototype.error=function(n,e=!0,t=""){if(!n||!(n instanceof Error)||n.isAbort)return;const i=(n==null?void 0:n.status)<<0||400,l=(n==null?void 0:n.data)||{},s=l.message||n.message||t;if(e&&s&&Ci(s),V.isEmpty(l.data)||Ut(l.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),is("/")};co.prototype.getSuperuserFileToken=async function(n=""){let e=!0;if(n){const i=Vb(ck);e=typeof i[n]<"u"?i[n]:!0}if(!e)return"";let t=localStorage.getItem(ra)||"";return(!t||Fr(t,10))&&(t&&localStorage.removeItem(ra),this._superuserFileTokenRequest||(this._superuserFileTokenRequest=this.files.getToken()),t=await this._superuserFileTokenRequest,localStorage.setItem(ra,t),this._superuserFileTokenRequest=null),t};class e3 extends rk{constructor(e="__pb_superuser_auth__"){super(e),this.save(this.token,this.record)}save(e,t){super.save(e,t),(t==null?void 0:t.collectionName)=="_superusers"&&tc(t)}clear(){super.clear(),tc(null)}}const _e=new co("../",new e3);_e.authStore.isValid&&_e.collection(_e.authStore.record.collectionName).authRefresh().catch(n=>{console.warn("Failed to refresh the existing auth token:",n);const e=(n==null?void 0:n.status)<<0;(e==401||e==403)&&_e.authStore.clear()});const nr=[];let mk;function hk(n){const e=n.pattern.test(mk);cc(n,n.className,e),cc(n,n.inactiveClassName,!e)}function cc(n,e,t){(e||"").split(" ").forEach(i=>{i&&(n.node.classList.remove(i),t&&n.node.classList.add(i))})}qr.subscribe(n=>{mk=n.location+(n.querystring?"?"+n.querystring:""),nr.map(hk)});function qi(n,e){if(e&&(typeof e=="string"||typeof e=="object"&&e instanceof RegExp)?e={path:e}:e=e||{},!e.path&&n.hasAttribute("href")&&(e.path=n.getAttribute("href"),e.path&&e.path.length>1&&e.path.charAt(0)=="#"&&(e.path=e.path.substring(1))),e.className||(e.className="active"),!e.path||typeof e.path=="string"&&(e.path.length<1||e.path.charAt(0)!="/"&&e.path.charAt(0)!="*"))throw Error('Invalid value for "path" argument');const{pattern:t}=typeof e.path=="string"?pk(e.path):{pattern:e.path},i={node:n,className:e.className,inactiveClassName:e.inactiveClassName,pattern:t};return nr.push(i),hk(i),{destroy(){nr.splice(nr.indexOf(i),1)}}}const t3="modulepreload",n3=function(n,e){return new URL(n,e).href},dc={},Tt=function(e,t,i){let l=Promise.resolve();if(t&&t.length>0){const o=document.getElementsByTagName("link"),r=document.querySelector("meta[property=csp-nonce]"),a=(r==null?void 0:r.nonce)||(r==null?void 0:r.getAttribute("nonce"));l=Promise.allSettled(t.map(u=>{if(u=n3(u,i),u in dc)return;dc[u]=!0;const f=u.endsWith(".css"),c=f?'[rel="stylesheet"]':"";if(!!i)for(let h=o.length-1;h>=0;h--){const g=o[h];if(g.href===u&&(!f||g.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${u}"]${c}`))return;const m=document.createElement("link");if(m.rel=f?"stylesheet":t3,f||(m.as="script"),m.crossOrigin="",m.href=u,a&&m.setAttribute("nonce",a),document.head.appendChild(m),f)return new Promise((h,g)=>{m.addEventListener("load",h),m.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(o){const r=new Event("vite:preloadError",{cancelable:!0});if(r.payload=o,window.dispatchEvent(r),!r.defaultPrevented)throw o}return l.then(o=>{for(const r of o||[])r.status==="rejected"&&s(r.reason);return e().catch(s)})};function i3(n){e();function e(){_e.authStore.isValid?is("/collections"):_e.logout()}return[]}class l3 extends Se{constructor(e){super(),we(this,e,i3,null,ke,{})}}function pc(n,e,t){const i=n.slice();return i[12]=e[t],i}const s3=n=>({}),mc=n=>({uniqueId:n[4]});function o3(n){let e,t,i=de(n[3]),l=[];for(let o=0;oD(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;o({}),Yf=n=>({}),sw=n=>({}),Kf=n=>({});function Jf(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$=n[4]&&!n[2]&&Zf(n);const T=n[19].header,O=Lt(T,n,n[18],Kf);let E=n[4]&&n[2]&&Gf(n);const L=n[19].default,I=Lt(L,n,n[18],null),A=n[19].footer,P=Lt(A,n,n[18],Yf);return{c(){e=b("div"),t=b("div"),l=C(),s=b("div"),o=b("div"),$&&$.c(),r=C(),O&&O.c(),a=C(),E&&E.c(),u=C(),f=b("div"),I&&I.c(),c=C(),d=b("div"),P&&P.c(),p(t,"class","overlay"),p(o,"class","overlay-panel-section panel-header"),p(f,"class","overlay-panel-section panel-content"),p(d,"class","overlay-panel-section panel-footer"),p(s,"class",m="overlay-panel "+n[1]+" "+n[8]),ee(s,"popup",n[2]),p(e,"class","overlay-panel-container"),ee(e,"padded",n[2]),ee(e,"active",n[0])},m(N,R){v(N,e,R),w(e,t),w(e,l),w(e,s),w(s,o),$&&$.m(o,null),w(o,r),O&&O.m(o,null),w(o,a),E&&E.m(o,null),w(s,u),w(s,f),I&&I.m(f,null),n[21](f),w(s,c),w(s,d),P&&P.m(d,null),_=!0,k||(S=[W(t,"click",nt(n[20])),W(f,"scroll",n[22])],k=!0)},p(N,R){n=N,n[4]&&!n[2]?$?($.p(n,R),R[0]&20&&M($,1)):($=Zf(n),$.c(),M($,1),$.m(o,r)):$&&(re(),D($,1,1,()=>{$=null}),ae()),O&&O.p&&(!_||R[0]&262144)&&Pt(O,T,n,n[18],_?At(T,n[18],R,sw):Nt(n[18]),Kf),n[4]&&n[2]?E?E.p(n,R):(E=Gf(n),E.c(),E.m(o,null)):E&&(E.d(1),E=null),I&&I.p&&(!_||R[0]&262144)&&Pt(I,L,n,n[18],_?At(L,n[18],R,null):Nt(n[18]),null),P&&P.p&&(!_||R[0]&262144)&&Pt(P,A,n,n[18],_?At(A,n[18],R,lw):Nt(n[18]),Yf),(!_||R[0]&258&&m!==(m="overlay-panel "+n[1]+" "+n[8]))&&p(s,"class",m),(!_||R[0]&262)&&ee(s,"popup",n[2]),(!_||R[0]&4)&&ee(e,"padded",n[2]),(!_||R[0]&1)&&ee(e,"active",n[0])},i(N){_||(N&&tt(()=>{_&&(i||(i=He(t,Ys,{duration:Zi,opacity:0},!0)),i.run(1))}),M($),M(O,N),M(I,N),M(P,N),N&&tt(()=>{_&&(g&&g.end(1),h=Qb(s,qn,n[2]?{duration:Zi,y:-10}:{duration:Zi,x:50}),h.start())}),_=!0)},o(N){N&&(i||(i=He(t,Ys,{duration:Zi,opacity:0},!1)),i.run(0)),D($),D(O,N),D(I,N),D(P,N),h&&h.invalidate(),N&&(g=_u(s,qn,n[2]?{duration:Zi,y:10}:{duration:Zi,x:50})),_=!1},d(N){N&&y(e),N&&i&&i.end(),$&&$.d(),O&&O.d(N),E&&E.d(),I&&I.d(N),n[21](null),P&&P.d(N),N&&g&&g.end(),k=!1,Ie(S)}}}function Zf(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Close"),p(e,"class","overlay-close")},m(o,r){v(o,e,r),i=!0,l||(s=W(e,"click",nt(n[5])),l=!0)},p(o,r){n=o},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,Ys,{duration:Zi},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Ys,{duration:Zi},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function Gf(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Close"),p(e,"class","btn btn-sm btn-circle btn-transparent btn-close m-l-auto")},m(l,s){v(l,e,s),t||(i=W(e,"click",nt(n[5])),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function ow(n){let e,t,i,l,s=n[0]&&Jf(n);return{c(){e=b("div"),s&&s.c(),p(e,"class","overlay-panel-wrapper"),p(e,"tabindex","-1")},m(o,r){v(o,e,r),s&&s.m(e,null),n[23](e),t=!0,i||(l=[W(window,"resize",n[10]),W(window,"keydown",n[9])],i=!0)},p(o,r){o[0]?s?(s.p(o,r),r[0]&1&&M(s,1)):(s=Jf(o),s.c(),M(s,1),s.m(e,null)):s&&(re(),D(s,1,1,()=>{s=null}),ae())},i(o){t||(M(s),t=!0)},o(o){D(s),t=!1},d(o){o&&y(e),s&&s.d(),n[23](null),i=!1,Ie(l)}}}let gl,la=[];function tk(){return gl=gl||document.querySelector(".overlays"),gl||(gl=document.createElement("div"),gl.classList.add("overlays"),document.body.appendChild(gl)),gl}let Zi=150;function Xf(){return 1e3+tk().querySelectorAll(".overlay-panel-container.active").length}function rw(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,{active:o=!1}=e,{popup:r=!1}=e,{overlayClose:a=!0}=e,{btnClose:u=!0}=e,{escClose:f=!0}=e,{beforeOpen:c=void 0}=e,{beforeHide:d=void 0}=e;const m=kt(),h="op_"+V.randomString(10);let g,_,k,S,$="",T=o;function O(){typeof c=="function"&&c()===!1||t(0,o=!0)}function E(){typeof d=="function"&&d()===!1||t(0,o=!1)}function L(){return o}async function I(G){t(17,T=G),G?(k=document.activeElement,m("show"),g==null||g.focus()):(clearTimeout(S),m("hide"),k==null||k.focus()),await dn(),A()}function A(){g&&(o?t(6,g.style.zIndex=Xf(),g):t(6,g.style="",g))}function P(){V.pushUnique(la,h),document.body.classList.add("overlay-active")}function N(){V.removeByValue(la,h),la.length||document.body.classList.remove("overlay-active")}function R(G){o&&f&&G.code=="Escape"&&!V.isInput(G.target)&&g&&g.style.zIndex==Xf()&&(G.preventDefault(),E())}function z(G){o&&F(_)}function F(G,pe){pe&&t(8,$=""),!(!G||S)&&(S=setTimeout(()=>{if(clearTimeout(S),S=null,!G)return;if(G.scrollHeight-G.offsetHeight>0)t(8,$="scrollable");else{t(8,$="");return}G.scrollTop==0?t(8,$+=" scroll-top-reached"):G.scrollTop+G.offsetHeight==G.scrollHeight&&t(8,$+=" scroll-bottom-reached")},100))}Xt(()=>{tk().appendChild(g);let G=g;return()=>{clearTimeout(S),N(),G==null||G.remove()}});const U=()=>a?E():!0;function J(G){ie[G?"unshift":"push"](()=>{_=G,t(7,_)})}const Y=G=>F(G.target);function Z(G){ie[G?"unshift":"push"](()=>{g=G,t(6,g)})}return n.$$set=G=>{"class"in G&&t(1,s=G.class),"active"in G&&t(0,o=G.active),"popup"in G&&t(2,r=G.popup),"overlayClose"in G&&t(3,a=G.overlayClose),"btnClose"in G&&t(4,u=G.btnClose),"escClose"in G&&t(12,f=G.escClose),"beforeOpen"in G&&t(13,c=G.beforeOpen),"beforeHide"in G&&t(14,d=G.beforeHide),"$$scope"in G&&t(18,l=G.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&131073&&T!=o&&I(o),n.$$.dirty[0]&128&&F(_,!0),n.$$.dirty[0]&64&&g&&A(),n.$$.dirty[0]&1&&(o?P():N())},[o,s,r,a,u,E,g,_,$,R,z,F,f,c,d,O,L,T,l,i,U,J,Y,Z]}class Qt extends Se{constructor(e){super(),we(this,e,rw,ow,ke,{class:1,active:0,popup:2,overlayClose:3,btnClose:4,escClose:12,beforeOpen:13,beforeHide:14,show:15,hide:5,isActive:16},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[5]}get isActive(){return this.$$.ctx[16]}}const Bl=[];function nk(n,e){return{subscribe:Hn(n,e).subscribe}}function Hn(n,e=te){let t;const i=new Set;function l(r){if(ke(n,r)&&(n=r,t)){const a=!Bl.length;for(const u of i)u[1](),Bl.push(u,n);if(a){for(let u=0;u{i.delete(u),i.size===0&&t&&(t(),t=null)}}return{set:l,update:s,subscribe:o}}function ik(n,e,t){const i=!Array.isArray(n),l=i?[n]:n;if(!l.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const s=e.length<2;return nk(t,(o,r)=>{let a=!1;const u=[];let f=0,c=te;const d=()=>{if(f)return;c();const h=e(i?u[0]:u,o,r);s?o(h):c=It(h)?h:te},m=l.map((h,g)=>cu(h,_=>{u[g]=_,f&=~(1<{f|=1<t(1,i=c));let l,s=!1,o=!1;const r=()=>{t(3,o=!1),l==null||l.hide()},a=async()=>{i!=null&&i.yesCallback&&(t(2,s=!0),await Promise.resolve(i.yesCallback()),t(2,s=!1)),t(3,o=!0),l==null||l.hide()};function u(c){ie[c?"unshift":"push"](()=>{l=c,t(0,l)})}const f=async()=>{!o&&(i!=null&&i.noCallback)&&i.noCallback(),await dn(),t(3,o=!1),lk()};return n.$$.update=()=>{n.$$.dirty&3&&i!=null&&i.text&&(t(3,o=!1),l==null||l.show())},[l,i,s,o,r,a,u,f]}class dw extends Se{constructor(e){super(),we(this,e,cw,fw,ke,{})}}function pw(n){let e;return{c(){e=b("textarea"),p(e,"id",n[0]),Hy(e,"visibility","hidden")},m(t,i){v(t,e,i),n[15](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&y(e),n[15](null)}}}function mw(n){let e;return{c(){e=b("div"),p(e,"id",n[0])},m(t,i){v(t,e,i),n[14](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&y(e),n[14](null)}}}function hw(n){let e;function t(s,o){return s[1]?mw:pw}let i=t(n),l=i(n);return{c(){e=b("div"),l.c(),p(e,"class",n[2])},m(s,o){v(s,e,o),l.m(e,null),n[16](e)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e,null))),o&4&&p(e,"class",s[2])},i:te,o:te,d(s){s&&y(e),l.d(),n[16](null)}}}function _w(){let n={listeners:[],scriptLoaded:!1,injected:!1};function e(i,l,s){n.injected=!0;const o=i.createElement("script");o.referrerPolicy="origin",o.type="application/javascript",o.src=l,o.onload=()=>{s()},i.head&&i.head.appendChild(o)}function t(i,l,s){n.scriptLoaded?s():(n.listeners.push(s),n.injected||e(i,l,()=>{n.listeners.forEach(o=>o()),n.scriptLoaded=!0}))}return{load:t}}let gw=_w();function sa(){return window&&window.tinymce?window.tinymce:null}function bw(n,e,t){let{id:i="tinymce_svelte"+V.randomString(7)}=e,{inline:l=void 0}=e,{disabled:s=!1}=e,{scriptSrc:o="./libs/tinymce/tinymce.min.js"}=e,{conf:r={}}=e,{modelEvents:a="change input undo redo"}=e,{value:u=""}=e,{text:f=""}=e,{cssClass:c="tinymce-wrapper"}=e;const d=["Activate","AddUndo","BeforeAddUndo","BeforeExecCommand","BeforeGetContent","BeforeRenderUI","BeforeSetContent","BeforePaste","Blur","Change","ClearUndos","Click","ContextMenu","Copy","Cut","Dblclick","Deactivate","Dirty","Drag","DragDrop","DragEnd","DragGesture","DragOver","Drop","ExecCommand","Focus","FocusIn","FocusOut","GetContent","Hide","Init","KeyDown","KeyPress","KeyUp","LoadContent","MouseDown","MouseEnter","MouseLeave","MouseMove","MouseOut","MouseOver","MouseUp","NodeChange","ObjectResizeStart","ObjectResized","ObjectSelected","Paste","PostProcess","PostRender","PreProcess","ProgressState","Redo","Remove","Reset","ResizeEditor","SaveContent","SelectionChange","SetAttrib","SetContent","Show","Submit","Undo","VisualAid"],m=(I,A)=>{d.forEach(P=>{I.on(P,N=>{A(P.toLowerCase(),{eventName:P,event:N,editor:I})})})};let h,g,_,k=u,S=s;const $=kt();function T(){const I={...r,target:g,inline:l!==void 0?l:r.inline!==void 0?r.inline:!1,readonly:s,setup:A=>{t(11,_=A),A.on("init",()=>{A.setContent(u),A.on(a,()=>{t(12,k=A.getContent()),k!==u&&(t(5,u=k),t(6,f=A.getContent({format:"text"})))})}),m(A,$),typeof r.setup=="function"&&r.setup(A)}};t(4,g.style.visibility="",g),sa().init(I)}Xt(()=>(sa()!==null?T():gw.load(h.ownerDocument,o,()=>{h&&T()}),()=>{var I,A;try{_&&((I=_.dom)==null||I.unbind(document),(A=sa())==null||A.remove(_))}catch{}}));function O(I){ie[I?"unshift":"push"](()=>{g=I,t(4,g)})}function E(I){ie[I?"unshift":"push"](()=>{g=I,t(4,g)})}function L(I){ie[I?"unshift":"push"](()=>{h=I,t(3,h)})}return n.$$set=I=>{"id"in I&&t(0,i=I.id),"inline"in I&&t(1,l=I.inline),"disabled"in I&&t(7,s=I.disabled),"scriptSrc"in I&&t(8,o=I.scriptSrc),"conf"in I&&t(9,r=I.conf),"modelEvents"in I&&t(10,a=I.modelEvents),"value"in I&&t(5,u=I.value),"text"in I&&t(6,f=I.text),"cssClass"in I&&t(2,c=I.cssClass)},n.$$.update=()=>{var I;if(n.$$.dirty&14496)try{_&&k!==u&&(_.setContent(u),t(6,f=_.getContent({format:"text"}))),_&&s!==S&&(t(13,S=s),typeof((I=_.mode)==null?void 0:I.set)=="function"?_.mode.set(s?"readonly":"design"):_.setMode(s?"readonly":"design"))}catch(A){console.warn("TinyMCE reactive error:",A)}},[i,l,c,h,g,u,f,s,o,r,a,_,k,S,O,E,L]}class Cu extends Se{constructor(e){super(),we(this,e,bw,hw,ke,{id:0,inline:1,disabled:7,scriptSrc:8,conf:9,modelEvents:10,value:5,text:6,cssClass:2})}}function kw(n,{from:e,to:t},i={}){const l=getComputedStyle(n),s=l.transform==="none"?"":l.transform,[o,r]=l.transformOrigin.split(" ").map(parseFloat),a=e.left+e.width*o/t.width-(t.left+o),u=e.top+e.height*r/t.height-(t.top+r),{delay:f=0,duration:c=m=>Math.sqrt(m)*120,easing:d=Ar}=i;return{delay:f,duration:It(c)?c(Math.sqrt(a*a+u*u)):c,easing:d,css:(m,h)=>{const g=h*a,_=h*u,k=m+h*e.width/t.width,S=m+h*e.height/t.height;return`transform: ${s} translate(${g}px, ${_}px) scale(${k}, ${S});`}}}const Pr=Hn([]);function Ks(n,e=4e3){return Nr(n,"info",e)}function nn(n,e=3e3){return Nr(n,"success",e)}function Ci(n,e=4500){return Nr(n,"error",e)}function yw(n,e=4500){return Nr(n,"warning",e)}function Nr(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{sk(i)},t)};Pr.update(l=>(Ou(l,i.message),V.pushOrReplaceByKey(l,i,"message"),l))}function sk(n){Pr.update(e=>(Ou(e,n),e))}function Ls(){Pr.update(n=>{for(let e of n)Ou(n,e);return[]})}function Ou(n,e){let t;typeof e=="string"?t=V.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),V.removeByKey(n,"message",t.message))}function Qf(n,e,t){const i=n.slice();return i[2]=e[t],i}function vw(n){let e;return{c(){e=b("i"),p(e,"class","ri-alert-line")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function ww(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-line")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function Sw(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-line")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function Tw(n){let e;return{c(){e=b("i"),p(e,"class","ri-information-line")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function xf(n,e){let t,i,l,s,o=e[2].message+"",r,a,u,f,c,d,m,h=te,g,_,k;function S(E,L){return E[2].type==="info"?Tw:E[2].type==="success"?Sw:E[2].type==="warning"?ww:vw}let $=S(e),T=$(e);function O(){return e[1](e[2])}return{key:n,first:null,c(){t=b("div"),i=b("div"),T.c(),l=C(),s=b("div"),r=B(o),a=C(),u=b("button"),u.innerHTML='',f=C(),p(i,"class","icon"),p(s,"class","content"),p(u,"type","button"),p(u,"class","close"),p(t,"class","alert txt-break"),ee(t,"alert-info",e[2].type=="info"),ee(t,"alert-success",e[2].type=="success"),ee(t,"alert-danger",e[2].type=="error"),ee(t,"alert-warning",e[2].type=="warning"),this.first=t},m(E,L){v(E,t,L),w(t,i),T.m(i,null),w(t,l),w(t,s),w(s,r),w(t,a),w(t,u),w(t,f),g=!0,_||(k=W(u,"click",nt(O)),_=!0)},p(E,L){e=E,$!==($=S(e))&&(T.d(1),T=$(e),T&&(T.c(),T.m(i,null))),(!g||L&1)&&o!==(o=e[2].message+"")&&oe(r,o),(!g||L&1)&&ee(t,"alert-info",e[2].type=="info"),(!g||L&1)&&ee(t,"alert-success",e[2].type=="success"),(!g||L&1)&&ee(t,"alert-danger",e[2].type=="error"),(!g||L&1)&&ee(t,"alert-warning",e[2].type=="warning")},r(){m=t.getBoundingClientRect()},f(){By(t),h(),Zb(t,m)},a(){h(),h=Vy(t,m,kw,{duration:150})},i(E){g||(E&&tt(()=>{g&&(d&&d.end(1),c=Qb(t,mt,{duration:150}),c.start())}),g=!0)},o(E){c&&c.invalidate(),E&&(d=_u(t,Ys,{duration:150})),g=!1},d(E){E&&y(t),T.d(),E&&d&&d.end(),_=!1,k()}}}function $w(n){let e,t=[],i=new Map,l,s=de(n[0]);const o=r=>r[2].message;for(let r=0;rt(0,i=s)),[i,s=>sk(s)]}class Ow extends Se{constructor(e){super(),we(this,e,Cw,$w,ke,{})}}function ec(n){let e,t,i;const l=n[18].default,s=Lt(l,n,n[17],null);return{c(){e=b("div"),s&&s.c(),p(e,"class",n[1]),ee(e,"active",n[0])},m(o,r){v(o,e,r),s&&s.m(e,null),n[19](e),i=!0},p(o,r){s&&s.p&&(!i||r[0]&131072)&&Pt(s,l,o,o[17],i?At(l,o[17],r,null):Nt(o[17]),null),(!i||r[0]&2)&&p(e,"class",o[1]),(!i||r[0]&3)&&ee(e,"active",o[0])},i(o){i||(M(s,o),o&&tt(()=>{i&&(t||(t=He(e,qn,{duration:150,y:3},!0)),t.run(1))}),i=!0)},o(o){D(s,o),o&&(t||(t=He(e,qn,{duration:150,y:3},!1)),t.run(0)),i=!1},d(o){o&&y(e),s&&s.d(o),n[19](null),o&&t&&t.end()}}}function Mw(n){let e,t,i,l,s=n[0]&&ec(n);return{c(){e=b("div"),s&&s.c(),p(e,"class","toggler-container"),p(e,"tabindex","-1"),p(e,"role","menu")},m(o,r){v(o,e,r),s&&s.m(e,null),n[20](e),t=!0,i||(l=[W(window,"click",n[7]),W(window,"mousedown",n[6]),W(window,"keydown",n[5]),W(window,"focusin",n[4])],i=!0)},p(o,r){o[0]?s?(s.p(o,r),r[0]&1&&M(s,1)):(s=ec(o),s.c(),M(s,1),s.m(e,null)):s&&(re(),D(s,1,1,()=>{s=null}),ae())},i(o){t||(M(s),t=!0)},o(o){D(s),t=!1},d(o){o&&y(e),s&&s.d(),n[20](null),i=!1,Ie(l)}}}function Ew(n,e,t){let{$$slots:i={},$$scope:l}=e,{trigger:s=void 0}=e,{active:o=!1}=e,{escClose:r=!0}=e,{autoScroll:a=!0}=e,{closableClass:u="closable"}=e,{class:f=""}=e,c,d,m,h,g,_=!1;const k=kt();function S(G=0){o&&(clearTimeout(g),g=setTimeout($,G))}function $(){o&&(t(0,o=!1),_=!1,clearTimeout(h),clearTimeout(g))}function T(){clearTimeout(g),clearTimeout(h),!o&&(t(0,o=!0),m!=null&&m.contains(c)||c==null||c.focus(),h=setTimeout(()=>{a&&(d!=null&&d.scrollIntoViewIfNeeded?d==null||d.scrollIntoViewIfNeeded():d!=null&&d.scrollIntoView&&(d==null||d.scrollIntoView({behavior:"smooth",block:"nearest"})))},180))}function O(){o?$():T()}function E(G){return!c||G.classList.contains(u)||c.contains(G)&&G.closest&&G.closest("."+u)}function L(G){I(),c==null||c.addEventListener("click",A),c==null||c.addEventListener("keydown",P),t(16,m=G||(c==null?void 0:c.parentNode)),m==null||m.addEventListener("click",N),m==null||m.addEventListener("keydown",R)}function I(){clearTimeout(h),clearTimeout(g),c==null||c.removeEventListener("click",A),c==null||c.removeEventListener("keydown",P),m==null||m.removeEventListener("click",N),m==null||m.removeEventListener("keydown",R)}function A(G){G.stopPropagation(),E(G.target)&&$()}function P(G){(G.code==="Enter"||G.code==="Space")&&(G.stopPropagation(),E(G.target)&&S(150))}function N(G){G.preventDefault(),G.stopPropagation(),O()}function R(G){(G.code==="Enter"||G.code==="Space")&&(G.preventDefault(),G.stopPropagation(),O())}function z(G){o&&!(m!=null&&m.contains(G.target))&&!(c!=null&&c.contains(G.target))&&O()}function F(G){o&&r&&G.code==="Escape"&&(G.preventDefault(),$())}function U(G){o&&(_=!(c!=null&&c.contains(G.target)))}function J(G){var pe;o&&_&&!(c!=null&&c.contains(G.target))&&!(m!=null&&m.contains(G.target))&&!((pe=G.target)!=null&&pe.closest(".flatpickr-calendar"))&&$()}Xt(()=>(L(),()=>I()));function Y(G){ie[G?"unshift":"push"](()=>{d=G,t(3,d)})}function Z(G){ie[G?"unshift":"push"](()=>{c=G,t(2,c)})}return n.$$set=G=>{"trigger"in G&&t(8,s=G.trigger),"active"in G&&t(0,o=G.active),"escClose"in G&&t(9,r=G.escClose),"autoScroll"in G&&t(10,a=G.autoScroll),"closableClass"in G&&t(11,u=G.closableClass),"class"in G&&t(1,f=G.class),"$$scope"in G&&t(17,l=G.$$scope)},n.$$.update=()=>{var G,pe;n.$$.dirty[0]&260&&c&&L(s),n.$$.dirty[0]&65537&&(o?((G=m==null?void 0:m.classList)==null||G.add("active"),m==null||m.setAttribute("aria-expanded",!0),k("show")):((pe=m==null?void 0:m.classList)==null||pe.remove("active"),m==null||m.setAttribute("aria-expanded",!1),k("hide")))},[o,f,c,d,z,F,U,J,s,r,a,u,S,$,T,O,m,l,i,Y,Z]}class jn extends Se{constructor(e){super(),we(this,e,Ew,Mw,ke,{trigger:8,active:0,escClose:9,autoScroll:10,closableClass:11,class:1,hideWithDelay:12,hide:13,show:14,toggle:15},null,[-1,-1])}get hideWithDelay(){return this.$$.ctx[12]}get hide(){return this.$$.ctx[13]}get show(){return this.$$.ctx[14]}get toggle(){return this.$$.ctx[15]}}const un=Hn(""),_r=Hn(""),Dl=Hn(!1),yn=Hn({});function Ut(n){yn.set(n||{})}function Yn(n){yn.update(e=>(V.deleteByPath(e,n),e))}const Rr=Hn({});function tc(n){Rr.set(n||{})}class Fn extends Error{constructor(e){var t,i,l,s;super("ClientResponseError"),this.url="",this.status=0,this.response={},this.isAbort=!1,this.originalError=null,Object.setPrototypeOf(this,Fn.prototype),e!==null&&typeof e=="object"&&(this.url=typeof e.url=="string"?e.url:"",this.status=typeof e.status=="number"?e.status:0,this.isAbort=!!e.isAbort,this.originalError=e.originalError,e.response!==null&&typeof e.response=="object"?this.response=e.response:e.data!==null&&typeof e.data=="object"?this.response=e.data:this.response={}),this.originalError||e instanceof Fn||(this.originalError=e),typeof DOMException<"u"&&e instanceof DOMException&&(this.isAbort=!0),this.name="ClientResponseError "+this.status,this.message=(t=this.response)==null?void 0:t.message,this.message||(this.isAbort?this.message="The request was autocancelled. You can find more info in https://github.com/pocketbase/js-sdk#auto-cancellation.":(s=(l=(i=this.originalError)==null?void 0:i.cause)==null?void 0:l.message)!=null&&s.includes("ECONNREFUSED ::1")?this.message="Failed to connect to the PocketBase server. Try changing the SDK URL from localhost to 127.0.0.1 (https://github.com/pocketbase/js-sdk/issues/21).":this.message="Something went wrong while processing your request.")}get data(){return this.response}toJSON(){return{...this}}}const Do=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function Dw(n,e){const t={};if(typeof n!="string")return t;const i=Object.assign({},{}).decode||Iw;let l=0;for(;l0&&(!t.exp||t.exp-e>Date.now()/1e3))}ok=typeof atob!="function"||Aw?n=>{let e=String(n).replace(/=+$/,"");if(e.length%4==1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(var t,i,l=0,s=0,o="";i=e.charAt(s++);~i&&(t=l%4?64*t+i:i,l++%4)?o+=String.fromCharCode(255&t>>(-2*l&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return o}:atob;const ic="pb_auth";class Mu{constructor(){this.baseToken="",this.baseModel=null,this._onChangeCallbacks=[]}get token(){return this.baseToken}get record(){return this.baseModel}get model(){return this.baseModel}get isValid(){return!Fr(this.token)}get isSuperuser(){var t,i;let e=xl(this.token);return e.type=="auth"&&(((t=this.record)==null?void 0:t.collectionName)=="_superusers"||!((i=this.record)!=null&&i.collectionName)&&e.collectionId=="pbc_3142635823")}get isAdmin(){return console.warn("Please replace pb.authStore.isAdmin with pb.authStore.isSuperuser OR simply check the value of pb.authStore.record?.collectionName"),this.isSuperuser}get isAuthRecord(){return console.warn("Please replace pb.authStore.isAuthRecord with !pb.authStore.isSuperuser OR simply check the value of pb.authStore.record?.collectionName"),xl(this.token).type=="auth"&&!this.isSuperuser}save(e,t){this.baseToken=e||"",this.baseModel=t||null,this.triggerChange()}clear(){this.baseToken="",this.baseModel=null,this.triggerChange()}loadFromCookie(e,t=ic){const i=Dw(e||"")[t]||"";let l={};try{l=JSON.parse(i),(typeof l===null||typeof l!="object"||Array.isArray(l))&&(l={})}catch{}this.save(l.token||"",l.record||l.model||null)}exportToCookie(e,t=ic){var a,u;const i={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},l=xl(this.token);i.expires=l!=null&&l.exp?new Date(1e3*l.exp):new Date("1970-01-01"),e=Object.assign({},i,e);const s={token:this.token,record:this.record?JSON.parse(JSON.stringify(this.record)):null};let o=nc(t,JSON.stringify(s),e);const r=typeof Blob<"u"?new Blob([o]).size:o.length;if(s.record&&r>4096){s.record={id:(a=s.record)==null?void 0:a.id,email:(u=s.record)==null?void 0:u.email};const f=["collectionId","collectionName","verified"];for(const c in this.record)f.includes(c)&&(s.record[c]=this.record[c]);o=nc(t,JSON.stringify(s),e)}return o}onChange(e,t=!1){return this._onChangeCallbacks.push(e),t&&e(this.token,this.record),()=>{for(let i=this._onChangeCallbacks.length-1;i>=0;i--)if(this._onChangeCallbacks[i]==e)return delete this._onChangeCallbacks[i],void this._onChangeCallbacks.splice(i,1)}}triggerChange(){for(const e of this._onChangeCallbacks)e&&e(this.token,this.record)}}class rk extends Mu{constructor(e="pocketbase_auth"){super(),this.storageFallback={},this.storageKey=e,this._bindStorageEvent()}get token(){return(this._storageGet(this.storageKey)||{}).token||""}get record(){const e=this._storageGet(this.storageKey)||{};return e.record||e.model||null}get model(){return this.record}save(e,t){this._storageSet(this.storageKey,{token:e,record:t}),super.save(e,t)}clear(){this._storageRemove(this.storageKey),super.clear()}_storageGet(e){if(typeof window<"u"&&(window!=null&&window.localStorage)){const t=window.localStorage.getItem(e)||"";try{return JSON.parse(t)}catch{return t}}return this.storageFallback[e]}_storageSet(e,t){if(typeof window<"u"&&(window!=null&&window.localStorage)){let i=t;typeof t!="string"&&(i=JSON.stringify(t)),window.localStorage.setItem(e,i)}else this.storageFallback[e]=t}_storageRemove(e){var t;typeof window<"u"&&(window!=null&&window.localStorage)&&((t=window.localStorage)==null||t.removeItem(e)),delete this.storageFallback[e]}_bindStorageEvent(){typeof window<"u"&&(window!=null&&window.localStorage)&&window.addEventListener&&window.addEventListener("storage",e=>{if(e.key!=this.storageKey)return;const t=this._storageGet(this.storageKey)||{};super.save(t.token||"",t.record||t.model||null)})}}class al{constructor(e){this.client=e}}class Pw extends al{async getAll(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/settings",e)}async update(e,t){return t=Object.assign({method:"PATCH",body:e},t),this.client.send("/api/settings",t)}async testS3(e="storage",t){return t=Object.assign({method:"POST",body:{filesystem:e}},t),this.client.send("/api/settings/test/s3",t).then(()=>!0)}async testEmail(e,t,i,l){return l=Object.assign({method:"POST",body:{email:t,template:i,collection:e}},l),this.client.send("/api/settings/test/email",l).then(()=>!0)}async generateAppleClientSecret(e,t,i,l,s,o){return o=Object.assign({method:"POST",body:{clientId:e,teamId:t,keyId:i,privateKey:l,duration:s}},o),this.client.send("/api/settings/apple/generate-client-secret",o)}}const Nw=["requestKey","$cancelKey","$autoCancel","fetch","headers","body","query","params","cache","credentials","headers","integrity","keepalive","method","mode","redirect","referrer","referrerPolicy","signal","window"];function Eu(n){if(n){n.query=n.query||{};for(let e in n)Nw.includes(e)||(n.query[e]=n[e],delete n[e])}}function ak(n){const e=[];for(const t in n){if(n[t]===null)continue;const i=n[t],l=encodeURIComponent(t);if(Array.isArray(i))for(const s of i)e.push(l+"="+encodeURIComponent(s));else i instanceof Date?e.push(l+"="+encodeURIComponent(i.toISOString())):typeof i!==null&&typeof i=="object"?e.push(l+"="+encodeURIComponent(JSON.stringify(i))):e.push(l+"="+encodeURIComponent(i))}return e.join("&")}class uk extends al{constructor(){super(...arguments),this.clientId="",this.eventSource=null,this.subscriptions={},this.lastSentSubscriptions=[],this.maxConnectTimeout=15e3,this.reconnectAttempts=0,this.maxReconnectAttempts=1/0,this.predefinedReconnectIntervals=[200,300,500,1e3,1200,1500,2e3],this.pendingConnects=[]}get isConnected(){return!!this.eventSource&&!!this.clientId&&!this.pendingConnects.length}async subscribe(e,t,i){var o;if(!e)throw new Error("topic must be set.");let l=e;if(i){Eu(i=Object.assign({},i));const r="options="+encodeURIComponent(JSON.stringify({query:i.query,headers:i.headers}));l+=(l.includes("?")?"&":"?")+r}const s=function(r){const a=r;let u;try{u=JSON.parse(a==null?void 0:a.data)}catch{}t(u||{})};return this.subscriptions[l]||(this.subscriptions[l]=[]),this.subscriptions[l].push(s),this.isConnected?this.subscriptions[l].length===1?await this.submitSubscriptions():(o=this.eventSource)==null||o.addEventListener(l,s):await this.connect(),async()=>this.unsubscribeByTopicAndListener(e,s)}async unsubscribe(e){var i;let t=!1;if(e){const l=this.getSubscriptionsByTopic(e);for(let s in l)if(this.hasSubscriptionListeners(s)){for(let o of this.subscriptions[s])(i=this.eventSource)==null||i.removeEventListener(s,o);delete this.subscriptions[s],t||(t=!0)}}else this.subscriptions={};this.hasSubscriptionListeners()?t&&await this.submitSubscriptions():this.disconnect()}async unsubscribeByPrefix(e){var i;let t=!1;for(let l in this.subscriptions)if((l+"?").startsWith(e)){t=!0;for(let s of this.subscriptions[l])(i=this.eventSource)==null||i.removeEventListener(l,s);delete this.subscriptions[l]}t&&(this.hasSubscriptionListeners()?await this.submitSubscriptions():this.disconnect())}async unsubscribeByTopicAndListener(e,t){var s;let i=!1;const l=this.getSubscriptionsByTopic(e);for(let o in l){if(!Array.isArray(this.subscriptions[o])||!this.subscriptions[o].length)continue;let r=!1;for(let a=this.subscriptions[o].length-1;a>=0;a--)this.subscriptions[o][a]===t&&(r=!0,delete this.subscriptions[o][a],this.subscriptions[o].splice(a,1),(s=this.eventSource)==null||s.removeEventListener(o,t));r&&(this.subscriptions[o].length||delete this.subscriptions[o],i||this.hasSubscriptionListeners(o)||(i=!0))}this.hasSubscriptionListeners()?i&&await this.submitSubscriptions():this.disconnect()}hasSubscriptionListeners(e){var t,i;if(this.subscriptions=this.subscriptions||{},e)return!!((t=this.subscriptions[e])!=null&&t.length);for(let l in this.subscriptions)if((i=this.subscriptions[l])!=null&&i.length)return!0;return!1}async submitSubscriptions(){if(this.clientId)return this.addAllSubscriptionListeners(),this.lastSentSubscriptions=this.getNonEmptySubscriptionKeys(),this.client.send("/api/realtime",{method:"POST",body:{clientId:this.clientId,subscriptions:this.lastSentSubscriptions},requestKey:this.getSubscriptionsCancelKey()}).catch(e=>{if(!(e!=null&&e.isAbort))throw e})}getSubscriptionsCancelKey(){return"realtime_"+this.clientId}getSubscriptionsByTopic(e){const t={};e=e.includes("?")?e:e+"?";for(let i in this.subscriptions)(i+"?").startsWith(e)&&(t[i]=this.subscriptions[i]);return t}getNonEmptySubscriptionKeys(){const e=[];for(let t in this.subscriptions)this.subscriptions[t].length&&e.push(t);return e}addAllSubscriptionListeners(){if(this.eventSource){this.removeAllSubscriptionListeners();for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.addEventListener(e,t)}}removeAllSubscriptionListeners(){if(this.eventSource)for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.removeEventListener(e,t)}async connect(){if(!(this.reconnectAttempts>0))return new Promise((e,t)=>{this.pendingConnects.push({resolve:e,reject:t}),this.pendingConnects.length>1||this.initConnect()})}initConnect(){this.disconnect(!0),clearTimeout(this.connectTimeoutId),this.connectTimeoutId=setTimeout(()=>{this.connectErrorHandler(new Error("EventSource connect took too long."))},this.maxConnectTimeout),this.eventSource=new EventSource(this.client.buildURL("/api/realtime")),this.eventSource.onerror=e=>{this.connectErrorHandler(new Error("Failed to establish realtime connection."))},this.eventSource.addEventListener("PB_CONNECT",e=>{const t=e;this.clientId=t==null?void 0:t.lastEventId,this.submitSubscriptions().then(async()=>{let i=3;for(;this.hasUnsentSubscriptions()&&i>0;)i--,await this.submitSubscriptions()}).then(()=>{for(let l of this.pendingConnects)l.resolve();this.pendingConnects=[],this.reconnectAttempts=0,clearTimeout(this.reconnectTimeoutId),clearTimeout(this.connectTimeoutId);const i=this.getSubscriptionsByTopic("PB_CONNECT");for(let l in i)for(let s of i[l])s(e)}).catch(i=>{this.clientId="",this.connectErrorHandler(i)})})}hasUnsentSubscriptions(){const e=this.getNonEmptySubscriptionKeys();if(e.length!=this.lastSentSubscriptions.length)return!0;for(const t of e)if(!this.lastSentSubscriptions.includes(t))return!0;return!1}connectErrorHandler(e){if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),!this.clientId&&!this.reconnectAttempts||this.reconnectAttempts>this.maxReconnectAttempts){for(let i of this.pendingConnects)i.reject(new Fn(e));return this.pendingConnects=[],void this.disconnect()}this.disconnect(!0);const t=this.predefinedReconnectIntervals[this.reconnectAttempts]||this.predefinedReconnectIntervals[this.predefinedReconnectIntervals.length-1];this.reconnectAttempts++,this.reconnectTimeoutId=setTimeout(()=>{this.initConnect()},t)}disconnect(e=!1){var t;if(this.clientId&&this.onDisconnect&&this.onDisconnect(Object.keys(this.subscriptions)),clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),this.removeAllSubscriptionListeners(),this.client.cancelRequest(this.getSubscriptionsCancelKey()),(t=this.eventSource)==null||t.close(),this.eventSource=null,this.clientId="",!e){this.reconnectAttempts=0;for(let i of this.pendingConnects)i.resolve();this.pendingConnects=[]}}}class fk extends al{decode(e){return e}async getFullList(e,t){if(typeof e=="number")return this._getFullList(e,t);let i=500;return(t=Object.assign({},e,t)).batch&&(i=t.batch,delete t.batch),this._getFullList(i,t)}async getList(e=1,t=30,i){return(i=Object.assign({method:"GET"},i)).query=Object.assign({page:e,perPage:t},i.query),this.client.send(this.baseCrudPath,i).then(l=>{var s;return l.items=((s=l.items)==null?void 0:s.map(o=>this.decode(o)))||[],l})}async getFirstListItem(e,t){return(t=Object.assign({requestKey:"one_by_filter_"+this.baseCrudPath+"_"+e},t)).query=Object.assign({filter:e,skipTotal:1},t.query),this.getList(1,1,t).then(i=>{var l;if(!((l=i==null?void 0:i.items)!=null&&l.length))throw new Fn({status:404,response:{code:404,message:"The requested resource wasn't found.",data:{}}});return i.items[0]})}async getOne(e,t){if(!e)throw new Fn({url:this.client.buildURL(this.baseCrudPath+"/"),status:404,response:{code:404,message:"Missing required record id.",data:{}}});return t=Object.assign({method:"GET"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(i=>this.decode(i))}async create(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send(this.baseCrudPath,t).then(i=>this.decode(i))}async update(e,t,i){return i=Object.assign({method:"PATCH",body:t},i),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),i).then(l=>this.decode(l))}async delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(()=>!0)}_getFullList(e=500,t){(t=t||{}).query=Object.assign({skipTotal:1},t.query);let i=[],l=async s=>this.getList(s,e||500,t).then(o=>{const r=o.items;return i=i.concat(r),r.length==o.perPage?l(s+1):i});return l(1)}}function Ki(n,e,t,i){const l=i!==void 0;return l||t!==void 0?l?(console.warn(n),e.body=Object.assign({},e.body,t),e.query=Object.assign({},e.query,i),e):Object.assign(e,t):e}function oa(n){var e;(e=n._resetAutoRefresh)==null||e.call(n)}class Rw extends fk{constructor(e,t){super(e),this.collectionIdOrName=t}get baseCrudPath(){return this.baseCollectionPath+"/records"}get baseCollectionPath(){return"/api/collections/"+encodeURIComponent(this.collectionIdOrName)}get isSuperusers(){return this.collectionIdOrName=="_superusers"||this.collectionIdOrName=="_pbc_2773867675"}async subscribe(e,t,i){if(!e)throw new Error("Missing topic.");if(!t)throw new Error("Missing subscription callback.");return this.client.realtime.subscribe(this.collectionIdOrName+"/"+e,t,i)}async unsubscribe(e){return e?this.client.realtime.unsubscribe(this.collectionIdOrName+"/"+e):this.client.realtime.unsubscribeByPrefix(this.collectionIdOrName)}async getFullList(e,t){if(typeof e=="number")return super.getFullList(e,t);const i=Object.assign({},e,t);return super.getFullList(i)}async getList(e=1,t=30,i){return super.getList(e,t,i)}async getFirstListItem(e,t){return super.getFirstListItem(e,t)}async getOne(e,t){return super.getOne(e,t)}async create(e,t){return super.create(e,t)}async update(e,t,i){return super.update(e,t,i).then(l=>{var s,o,r;if(((s=this.client.authStore.record)==null?void 0:s.id)===(l==null?void 0:l.id)&&(((o=this.client.authStore.record)==null?void 0:o.collectionId)===this.collectionIdOrName||((r=this.client.authStore.record)==null?void 0:r.collectionName)===this.collectionIdOrName)){let a=Object.assign({},this.client.authStore.record.expand),u=Object.assign({},this.client.authStore.record,l);a&&(u.expand=Object.assign(a,l.expand)),this.client.authStore.save(this.client.authStore.token,u)}return l})}async delete(e,t){return super.delete(e,t).then(i=>{var l,s,o;return!i||((l=this.client.authStore.record)==null?void 0:l.id)!==e||((s=this.client.authStore.record)==null?void 0:s.collectionId)!==this.collectionIdOrName&&((o=this.client.authStore.record)==null?void 0:o.collectionName)!==this.collectionIdOrName||this.client.authStore.clear(),i})}authResponse(e){const t=this.decode((e==null?void 0:e.record)||{});return this.client.authStore.save(e==null?void 0:e.token,t),Object.assign({},e,{token:(e==null?void 0:e.token)||"",record:t})}async listAuthMethods(e){return e=Object.assign({method:"GET",fields:"mfa,otp,password,oauth2"},e),this.client.send(this.baseCollectionPath+"/auth-methods",e)}async authWithPassword(e,t,i){let l;i=Object.assign({method:"POST",body:{identity:e,password:t}},i),this.isSuperusers&&(l=i.autoRefreshThreshold,delete i.autoRefreshThreshold,i.autoRefresh||oa(this.client));let s=await this.client.send(this.baseCollectionPath+"/auth-with-password",i);return s=this.authResponse(s),l&&this.isSuperusers&&function(r,a,u,f){oa(r);const c=r.beforeSend,d=r.authStore.record,m=r.authStore.onChange((h,g)=>{(!h||(g==null?void 0:g.id)!=(d==null?void 0:d.id)||(g!=null&&g.collectionId||d!=null&&d.collectionId)&&(g==null?void 0:g.collectionId)!=(d==null?void 0:d.collectionId))&&oa(r)});r._resetAutoRefresh=function(){m(),r.beforeSend=c,delete r._resetAutoRefresh},r.beforeSend=async(h,g)=>{var $;const _=r.authStore.token;if(($=g.query)!=null&&$.autoRefresh)return c?c(h,g):{url:h,sendOptions:g};let k=r.authStore.isValid;if(k&&Fr(r.authStore.token,a))try{await u()}catch{k=!1}k||await f();const S=g.headers||{};for(let T in S)if(T.toLowerCase()=="authorization"&&_==S[T]&&r.authStore.token){S[T]=r.authStore.token;break}return g.headers=S,c?c(h,g):{url:h,sendOptions:g}}}(this.client,l,()=>this.authRefresh({autoRefresh:!0}),()=>this.authWithPassword(e,t,Object.assign({autoRefresh:!0},i))),s}async authWithOAuth2Code(e,t,i,l,s,o,r){let a={method:"POST",body:{provider:e,code:t,codeVerifier:i,redirectURL:l,createData:s}};return a=Ki("This form of authWithOAuth2Code(provider, code, codeVerifier, redirectURL, createData?, body?, query?) is deprecated. Consider replacing it with authWithOAuth2Code(provider, code, codeVerifier, redirectURL, createData?, options?).",a,o,r),this.client.send(this.baseCollectionPath+"/auth-with-oauth2",a).then(u=>this.authResponse(u))}authWithOAuth2(...e){if(e.length>1||typeof(e==null?void 0:e[0])=="string")return console.warn("PocketBase: This form of authWithOAuth2() is deprecated and may get removed in the future. Please replace with authWithOAuth2Code() OR use the authWithOAuth2() realtime form as shown in https://pocketbase.io/docs/authentication/#oauth2-integration."),this.authWithOAuth2Code((e==null?void 0:e[0])||"",(e==null?void 0:e[1])||"",(e==null?void 0:e[2])||"",(e==null?void 0:e[3])||"",(e==null?void 0:e[4])||{},(e==null?void 0:e[5])||{},(e==null?void 0:e[6])||{});const t=(e==null?void 0:e[0])||{};let i=null;t.urlCallback||(i=lc(void 0));const l=new uk(this.client);function s(){i==null||i.close(),l.unsubscribe()}const o={},r=t.requestKey;return r&&(o.requestKey=r),this.listAuthMethods(o).then(a=>{var d;const u=a.oauth2.providers.find(m=>m.name===t.provider);if(!u)throw new Fn(new Error(`Missing or invalid provider "${t.provider}".`));const f=this.client.buildURL("/api/oauth2-redirect"),c=r?(d=this.client.cancelControllers)==null?void 0:d[r]:void 0;return c&&(c.signal.onabort=()=>{s()}),new Promise(async(m,h)=>{var g;try{await l.subscribe("@oauth2",async $=>{var O;const T=l.clientId;try{if(!$.state||T!==$.state)throw new Error("State parameters don't match.");if($.error||!$.code)throw new Error("OAuth2 redirect error or missing code: "+$.error);const E=Object.assign({},t);delete E.provider,delete E.scopes,delete E.createData,delete E.urlCallback,(O=c==null?void 0:c.signal)!=null&&O.onabort&&(c.signal.onabort=null);const L=await this.authWithOAuth2Code(u.name,$.code,u.codeVerifier,f,t.createData,E);m(L)}catch(E){h(new Fn(E))}s()});const _={state:l.clientId};(g=t.scopes)!=null&&g.length&&(_.scope=t.scopes.join(" "));const k=this._replaceQueryParams(u.authURL+f,_);await(t.urlCallback||function($){i?i.location.href=$:i=lc($)})(k)}catch(_){s(),h(new Fn(_))}})}).catch(a=>{throw s(),a})}async authRefresh(e,t){let i={method:"POST"};return i=Ki("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",i,e,t),this.client.send(this.baseCollectionPath+"/auth-refresh",i).then(l=>this.authResponse(l))}async requestPasswordReset(e,t,i){let l={method:"POST",body:{email:e}};return l=Ki("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-password-reset",l).then(()=>!0)}async confirmPasswordReset(e,t,i,l,s){let o={method:"POST",body:{token:e,password:t,passwordConfirm:i}};return o=Ki("This form of confirmPasswordReset(token, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(token, password, passwordConfirm, options?).",o,l,s),this.client.send(this.baseCollectionPath+"/confirm-password-reset",o).then(()=>!0)}async requestVerification(e,t,i){let l={method:"POST",body:{email:e}};return l=Ki("This form of requestVerification(email, body?, query?) is deprecated. Consider replacing it with requestVerification(email, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-verification",l).then(()=>!0)}async confirmVerification(e,t,i){let l={method:"POST",body:{token:e}};return l=Ki("This form of confirmVerification(token, body?, query?) is deprecated. Consider replacing it with confirmVerification(token, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/confirm-verification",l).then(()=>{const s=xl(e),o=this.client.authStore.record;return o&&!o.verified&&o.id===s.id&&o.collectionId===s.collectionId&&(o.verified=!0,this.client.authStore.save(this.client.authStore.token,o)),!0})}async requestEmailChange(e,t,i){let l={method:"POST",body:{newEmail:e}};return l=Ki("This form of requestEmailChange(newEmail, body?, query?) is deprecated. Consider replacing it with requestEmailChange(newEmail, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-email-change",l).then(()=>!0)}async confirmEmailChange(e,t,i,l){let s={method:"POST",body:{token:e,password:t}};return s=Ki("This form of confirmEmailChange(token, password, body?, query?) is deprecated. Consider replacing it with confirmEmailChange(token, password, options?).",s,i,l),this.client.send(this.baseCollectionPath+"/confirm-email-change",s).then(()=>{const o=xl(e),r=this.client.authStore.record;return r&&r.id===o.id&&r.collectionId===o.collectionId&&this.client.authStore.clear(),!0})}async listExternalAuths(e,t){return this.client.collection("_externalAuths").getFullList(Object.assign({},t,{filter:this.client.filter("recordRef = {:id}",{id:e})}))}async unlinkExternalAuth(e,t,i){const l=await this.client.collection("_externalAuths").getFirstListItem(this.client.filter("recordRef = {:recordId} && provider = {:provider}",{recordId:e,provider:t}));return this.client.collection("_externalAuths").delete(l.id,i).then(()=>!0)}async requestOTP(e,t){return t=Object.assign({method:"POST",body:{email:e}},t),this.client.send(this.baseCollectionPath+"/request-otp",t)}async authWithOTP(e,t,i){return i=Object.assign({method:"POST",body:{otpId:e,password:t}},i),this.client.send(this.baseCollectionPath+"/auth-with-otp",i).then(l=>this.authResponse(l))}async impersonate(e,t,i){(i=Object.assign({method:"POST",body:{duration:t}},i)).headers=i.headers||{},i.headers.Authorization||(i.headers.Authorization=this.client.authStore.token);const l=new co(this.client.baseURL,new Mu,this.client.lang),s=await l.send(this.baseCollectionPath+"/impersonate/"+encodeURIComponent(e),i);return l.authStore.save(s==null?void 0:s.token,this.decode((s==null?void 0:s.record)||{})),l}_replaceQueryParams(e,t={}){let i=e,l="";e.indexOf("?")>=0&&(i=e.substring(0,e.indexOf("?")),l=e.substring(e.indexOf("?")+1));const s={},o=l.split("&");for(const r of o){if(r=="")continue;const a=r.split("=");s[decodeURIComponent(a[0].replace(/\+/g," "))]=decodeURIComponent((a[1]||"").replace(/\+/g," "))}for(let r in t)t.hasOwnProperty(r)&&(t[r]==null?delete s[r]:s[r]=t[r]);l="";for(let r in s)s.hasOwnProperty(r)&&(l!=""&&(l+="&"),l+=encodeURIComponent(r.replace(/%20/g,"+"))+"="+encodeURIComponent(s[r].replace(/%20/g,"+")));return l!=""?i+"?"+l:i}}function lc(n){if(typeof window>"u"||!(window!=null&&window.open))throw new Fn(new Error("Not in a browser context - please pass a custom urlCallback function."));let e=1024,t=768,i=window.innerWidth,l=window.innerHeight;e=e>i?i:e,t=t>l?l:t;let s=i/2-e/2,o=l/2-t/2;return window.open(n,"popup_window","width="+e+",height="+t+",top="+o+",left="+s+",resizable,menubar=no")}class Fw extends fk{get baseCrudPath(){return"/api/collections"}async import(e,t=!1,i){return i=Object.assign({method:"PUT",body:{collections:e,deleteMissing:t}},i),this.client.send(this.baseCrudPath+"/import",i).then(()=>!0)}async getScaffolds(e){return e=Object.assign({method:"GET"},e),this.client.send(this.baseCrudPath+"/meta/scaffolds",e)}async truncate(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e)+"/truncate",t).then(()=>!0)}}class qw extends al{async getList(e=1,t=30,i){return(i=Object.assign({method:"GET"},i)).query=Object.assign({page:e,perPage:t},i.query),this.client.send("/api/logs",i)}async getOne(e,t){if(!e)throw new Fn({url:this.client.buildURL("/api/logs/"),status:404,response:{code:404,message:"Missing required log id.",data:{}}});return t=Object.assign({method:"GET"},t),this.client.send("/api/logs/"+encodeURIComponent(e),t)}async getStats(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/logs/stats",e)}}class Hw extends al{async check(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/health",e)}}class jw extends al{getUrl(e,t,i={}){return console.warn("Please replace pb.files.getUrl() with pb.files.getURL()"),this.getURL(e,t,i)}getURL(e,t,i={}){if(!t||!(e!=null&&e.id)||!(e!=null&&e.collectionId)&&!(e!=null&&e.collectionName))return"";const l=[];l.push("api"),l.push("files"),l.push(encodeURIComponent(e.collectionId||e.collectionName)),l.push(encodeURIComponent(e.id)),l.push(encodeURIComponent(t));let s=this.client.buildURL(l.join("/"));if(Object.keys(i).length){i.download===!1&&delete i.download;const o=new URLSearchParams(i);s+=(s.includes("?")?"&":"?")+o}return s}async getToken(e){return e=Object.assign({method:"POST"},e),this.client.send("/api/files/token",e).then(t=>(t==null?void 0:t.token)||"")}}class zw extends al{async getFullList(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/backups",e)}async create(e,t){return t=Object.assign({method:"POST",body:{name:e}},t),this.client.send("/api/backups",t).then(()=>!0)}async upload(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send("/api/backups/upload",t).then(()=>!0)}async delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}`,t).then(()=>!0)}async restore(e,t){return t=Object.assign({method:"POST"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}/restore`,t).then(()=>!0)}getDownloadUrl(e,t){return console.warn("Please replace pb.backups.getDownloadUrl() with pb.backups.getDownloadURL()"),this.getDownloadURL(e,t)}getDownloadURL(e,t){return this.client.buildURL(`/api/backups/${encodeURIComponent(t)}?token=${encodeURIComponent(e)}`)}}function Ya(n){return typeof Blob<"u"&&n instanceof Blob||typeof File<"u"&&n instanceof File||n!==null&&typeof n=="object"&&n.uri&&(typeof navigator<"u"&&navigator.product==="ReactNative"||typeof global<"u"&&global.HermesInternal)}function sc(n){return n&&(n.constructor.name==="FormData"||typeof FormData<"u"&&n instanceof FormData)}function oc(n){for(const e in n){const t=Array.isArray(n[e])?n[e]:[n[e]];for(const i of t)if(Ya(i))return!0}return!1}class Uw extends al{constructor(){super(...arguments),this.requests=[],this.subs={}}collection(e){return this.subs[e]||(this.subs[e]=new Vw(this.requests,e)),this.subs[e]}async send(e){const t=new FormData,i=[];for(let l=0;l0&&s.length==l.length){e.files[i]=e.files[i]||[];for(let r of s)e.files[i].push(r)}else if(e.json[i]=o,s.length>0){let r=i;i.startsWith("+")||i.endsWith("+")||(r+="+"),e.files[r]=e.files[r]||[];for(let a of s)e.files[r].push(a)}}else e.json[i]=l}}}class co{get baseUrl(){return this.baseURL}set baseUrl(e){this.baseURL=e}constructor(e="/",t,i="en-US"){this.cancelControllers={},this.recordServices={},this.enableAutoCancellation=!0,this.baseURL=e,this.lang=i,t?this.authStore=t:typeof window<"u"&&window.Deno?this.authStore=new Mu:this.authStore=new rk,this.collections=new Fw(this),this.files=new jw(this),this.logs=new qw(this),this.settings=new Pw(this),this.realtime=new uk(this),this.health=new Hw(this),this.backups=new zw(this)}get admins(){return this.collection("_superusers")}createBatch(){return new Uw(this)}collection(e){return this.recordServices[e]||(this.recordServices[e]=new Rw(this,e)),this.recordServices[e]}autoCancellation(e){return this.enableAutoCancellation=!!e,this}cancelRequest(e){return this.cancelControllers[e]&&(this.cancelControllers[e].abort(),delete this.cancelControllers[e]),this}cancelAllRequests(){for(let e in this.cancelControllers)this.cancelControllers[e].abort();return this.cancelControllers={},this}filter(e,t){if(!t)return e;for(let i in t){let l=t[i];switch(typeof l){case"boolean":case"number":l=""+l;break;case"string":l="'"+l.replace(/'/g,"\\'")+"'";break;default:l=l===null?"null":l instanceof Date?"'"+l.toISOString().replace("T"," ")+"'":"'"+JSON.stringify(l).replace(/'/g,"\\'")+"'"}e=e.replaceAll("{:"+i+"}",l)}return e}getFileUrl(e,t,i={}){return console.warn("Please replace pb.getFileUrl() with pb.files.getURL()"),this.files.getURL(e,t,i)}buildUrl(e){return console.warn("Please replace pb.buildUrl() with pb.buildURL()"),this.buildURL(e)}buildURL(e){var i;let t=this.baseURL;return typeof window>"u"||!window.location||t.startsWith("https://")||t.startsWith("http://")||(t=(i=window.location.origin)!=null&&i.endsWith("/")?window.location.origin.substring(0,window.location.origin.length-1):window.location.origin||"",this.baseURL.startsWith("/")||(t+=window.location.pathname||"/",t+=t.endsWith("/")?"":"/"),t+=this.baseURL),e&&(t+=t.endsWith("/")?"":"/",t+=e.startsWith("/")?e.substring(1):e),t}async send(e,t){t=this.initSendOptions(e,t);let i=this.buildURL(e);if(this.beforeSend){const l=Object.assign({},await this.beforeSend(i,t));l.url!==void 0||l.options!==void 0?(i=l.url||i,t=l.options||t):Object.keys(l).length&&(t=l,console!=null&&console.warn&&console.warn("Deprecated format of beforeSend return: please use `return { url, options }`, instead of `return options`."))}if(t.query!==void 0){const l=ak(t.query);l&&(i+=(i.includes("?")?"&":"?")+l),delete t.query}return this.getHeader(t.headers,"Content-Type")=="application/json"&&t.body&&typeof t.body!="string"&&(t.body=JSON.stringify(t.body)),(t.fetch||fetch)(i,t).then(async l=>{let s={};try{s=await l.json()}catch{}if(this.afterSend&&(s=await this.afterSend(l,s,t)),l.status>=400)throw new Fn({url:l.url,status:l.status,data:s});return s}).catch(l=>{throw new Fn(l)})}initSendOptions(e,t){if((t=Object.assign({method:"GET"},t)).body=function(l){if(typeof FormData>"u"||l===void 0||typeof l!="object"||l===null||sc(l)||!oc(l))return l;const s=new FormData;for(const o in l){const r=l[o];if(typeof r!="object"||oc({data:r})){const a=Array.isArray(r)?r:[r];for(let u of a)s.append(o,u)}else{let a={};a[o]=r,s.append("@jsonPayload",JSON.stringify(a))}}return s}(t.body),Eu(t),t.query=Object.assign({},t.params,t.query),t.requestKey===void 0&&(t.$autoCancel===!1||t.query.$autoCancel===!1?t.requestKey=null:(t.$cancelKey||t.query.$cancelKey)&&(t.requestKey=t.$cancelKey||t.query.$cancelKey)),delete t.$autoCancel,delete t.query.$autoCancel,delete t.$cancelKey,delete t.query.$cancelKey,this.getHeader(t.headers,"Content-Type")!==null||sc(t.body)||(t.headers=Object.assign({},t.headers,{"Content-Type":"application/json"})),this.getHeader(t.headers,"Accept-Language")===null&&(t.headers=Object.assign({},t.headers,{"Accept-Language":this.lang})),this.authStore.token&&this.getHeader(t.headers,"Authorization")===null&&(t.headers=Object.assign({},t.headers,{Authorization:this.authStore.token})),this.enableAutoCancellation&&t.requestKey!==null){const i=t.requestKey||(t.method||"GET")+e;delete t.requestKey,this.cancelRequest(i);const l=new AbortController;this.cancelControllers[i]=l,t.signal=l.signal}return t}getHeader(e,t){e=e||{},t=t.toLowerCase();for(let i in e)if(i.toLowerCase()==t)return e[i];return null}}const Mn=Hn([]),ti=Hn({}),Js=Hn(!1),ck=Hn({}),Du=Hn({});let As;typeof BroadcastChannel<"u"&&(As=new BroadcastChannel("collections"),As.onmessage=()=>{var n;Iu((n=Vb(ti))==null?void 0:n.id)});function dk(){As==null||As.postMessage("reload")}function Bw(n){Mn.update(e=>{const t=e.find(i=>i.id==n||i.name==n);return t?ti.set(t):e.length&&ti.set(e.find(i=>!i.system)||e[0]),e})}function Ww(n){ti.update(e=>V.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),Mn.update(e=>(V.pushOrReplaceByKey(e,n,"id"),Lu(),dk(),V.sortCollections(e)))}function Yw(n){Mn.update(e=>(V.removeByKey(e,"id",n.id),ti.update(t=>t.id===n.id?e.find(i=>!i.system)||e[0]:t),Lu(),dk(),e))}async function Iu(n=null){Js.set(!0);try{let e=await _e.collections.getFullList(200,{sort:"+name"});e=V.sortCollections(e),Mn.set(e);const t=n&&e.find(i=>i.id==n||i.name==n);t?ti.set(t):e.length&&ti.set(e.find(i=>!i.system)||e[0]),Lu(),Du.set(await _e.collections.getScaffolds())}catch(e){_e.error(e)}Js.set(!1)}function Lu(){ck.update(n=>(Mn.update(e=>{var t;for(let i of e)n[i.id]=!!((t=i.fields)!=null&&t.find(l=>l.type=="file"&&l.protected));return e}),n))}function pk(n,e){if(n instanceof RegExp)return{keys:!1,pattern:n};var t,i,l,s,o=[],r="",a=n.split("/");for(a[0]||a.shift();l=a.shift();)t=l[0],t==="*"?(o.push("wild"),r+="/(.*)"):t===":"?(i=l.indexOf("?",1),s=l.indexOf(".",1),o.push(l.substring(1,~i?i:~s?s:l.length)),r+=~i&&!~s?"(?:/([^/]+?))?":"/([^/]+?)",~s&&(r+=(~i?"?":"")+"\\"+l.substring(s))):r+="/"+l;return{keys:o,pattern:new RegExp("^"+r+"/?$","i")}}function Kw(n){let e,t,i;const l=[n[2]];var s=n[0];function o(r,a){let u={};for(let f=0;f{H(u,1)}),ae()}s?(e=zt(s,o(r,a)),e.$on("routeEvent",r[7]),j(e.$$.fragment),M(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(s){const u=a&4?wt(l,[Rt(r[2])]):{};e.$set(u)}},i(r){i||(e&&M(e.$$.fragment,r),i=!0)},o(r){e&&D(e.$$.fragment,r),i=!1},d(r){r&&y(t),e&&H(e,r)}}}function Jw(n){let e,t,i;const l=[{params:n[1]},n[2]];var s=n[0];function o(r,a){let u={};for(let f=0;f{H(u,1)}),ae()}s?(e=zt(s,o(r,a)),e.$on("routeEvent",r[6]),j(e.$$.fragment),M(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(s){const u=a&6?wt(l,[a&2&&{params:r[1]},a&4&&Rt(r[2])]):{};e.$set(u)}},i(r){i||(e&&M(e.$$.fragment,r),i=!0)},o(r){e&&D(e.$$.fragment,r),i=!1},d(r){r&&y(t),e&&H(e,r)}}}function Zw(n){let e,t,i,l;const s=[Jw,Kw],o=[];function r(a,u){return a[1]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),v(a,i,u),l=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),D(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&y(i),o[e].d(a)}}}function rc(){const n=window.location.href.indexOf("#/");let e=n>-1?window.location.href.substr(n+1):"/";const t=e.indexOf("?");let i="";return t>-1&&(i=e.substr(t+1),e=e.substr(0,t)),{location:e,querystring:i}}const qr=nk(null,function(e){e(rc());const t=()=>{e(rc())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});ik(qr,n=>n.location);const Au=ik(qr,n=>n.querystring),ac=Hn(void 0);async function is(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await dn();const e=(n.charAt(0)=="#"?"":"#")+n;try{const t={...history.state};delete t.__svelte_spa_router_scrollX,delete t.__svelte_spa_router_scrollY,window.history.replaceState(t,void 0,e)}catch{console.warn("Caught exception while replacing the current page. If you're running this in the Svelte REPL, please note that the `replace` method might not work in this environment.")}window.dispatchEvent(new Event("hashchange"))}function Bn(n,e){if(e=fc(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with tags');return uc(n,e),{update(t){t=fc(t),uc(n,t)}}}function Gw(n){n?window.scrollTo(n.__svelte_spa_router_scrollX,n.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function uc(n,e){let t=e.href||n.getAttribute("href");if(t&&t.charAt(0)=="/")t="#"+t;else if(!t||t.length<2||t.slice(0,2)!="#/")throw Error('Invalid value for "href" attribute: '+t);n.setAttribute("href",t),n.addEventListener("click",i=>{i.preventDefault(),e.disabled||Xw(i.currentTarget.getAttribute("href"))})}function fc(n){return n&&typeof n=="string"?{href:n}:n||{}}function Xw(n){history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=n}function Qw(n,e,t){let{routes:i={}}=e,{prefix:l=""}=e,{restoreScrollState:s=!1}=e;class o{constructor(O,E){if(!E||typeof E!="function"&&(typeof E!="object"||E._sveltesparouter!==!0))throw Error("Invalid component object");if(!O||typeof O=="string"&&(O.length<1||O.charAt(0)!="/"&&O.charAt(0)!="*")||typeof O=="object"&&!(O instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:L,keys:I}=pk(O);this.path=O,typeof E=="object"&&E._sveltesparouter===!0?(this.component=E.component,this.conditions=E.conditions||[],this.userData=E.userData,this.props=E.props||{}):(this.component=()=>Promise.resolve(E),this.conditions=[],this.props={}),this._pattern=L,this._keys=I}match(O){if(l){if(typeof l=="string")if(O.startsWith(l))O=O.substr(l.length)||"/";else return null;else if(l instanceof RegExp){const A=O.match(l);if(A&&A[0])O=O.substr(A[0].length)||"/";else return null}}const E=this._pattern.exec(O);if(E===null)return null;if(this._keys===!1)return E;const L={};let I=0;for(;I{r.push(new o(O,T))}):Object.keys(i).forEach(T=>{r.push(new o(T,i[T]))});let a=null,u=null,f={};const c=kt();async function d(T,O){await dn(),c(T,O)}let m=null,h=null;s&&(h=T=>{T.state&&(T.state.__svelte_spa_router_scrollY||T.state.__svelte_spa_router_scrollX)?m=T.state:m=null},window.addEventListener("popstate",h),Wy(()=>{Gw(m)}));let g=null,_=null;const k=qr.subscribe(async T=>{g=T;let O=0;for(;O{ac.set(u)});return}t(0,a=null),_=null,ac.set(void 0)});oo(()=>{k(),h&&window.removeEventListener("popstate",h)});function S(T){Pe.call(this,n,T)}function $(T){Pe.call(this,n,T)}return n.$$set=T=>{"routes"in T&&t(3,i=T.routes),"prefix"in T&&t(4,l=T.prefix),"restoreScrollState"in T&&t(5,s=T.restoreScrollState)},n.$$.update=()=>{n.$$.dirty&32&&(history.scrollRestoration=s?"manual":"auto")},[a,u,f,i,l,s,S,$]}class xw extends Se{constructor(e){super(),we(this,e,Qw,Zw,ke,{routes:3,prefix:4,restoreScrollState:5})}}const ra="pb_superuser_file_token";co.prototype.logout=function(n=!0){this.authStore.clear(),n&&is("/login")};co.prototype.error=function(n,e=!0,t=""){if(!n||!(n instanceof Error)||n.isAbort)return;const i=(n==null?void 0:n.status)<<0||400,l=(n==null?void 0:n.data)||{},s=l.message||n.message||t;if(e&&s&&Ci(s),V.isEmpty(l.data)||Ut(l.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),is("/")};co.prototype.getSuperuserFileToken=async function(n=""){let e=!0;if(n){const i=Vb(ck);e=typeof i[n]<"u"?i[n]:!0}if(!e)return"";let t=localStorage.getItem(ra)||"";return(!t||Fr(t,10))&&(t&&localStorage.removeItem(ra),this._superuserFileTokenRequest||(this._superuserFileTokenRequest=this.files.getToken()),t=await this._superuserFileTokenRequest,localStorage.setItem(ra,t),this._superuserFileTokenRequest=null),t};class e3 extends rk{constructor(e="__pb_superuser_auth__"){super(e),this.save(this.token,this.record)}save(e,t){super.save(e,t),(t==null?void 0:t.collectionName)=="_superusers"&&tc(t)}clear(){super.clear(),tc(null)}}const _e=new co("../",new e3);_e.authStore.isValid&&_e.collection(_e.authStore.record.collectionName).authRefresh().catch(n=>{console.warn("Failed to refresh the existing auth token:",n);const e=(n==null?void 0:n.status)<<0;(e==401||e==403)&&_e.authStore.clear()});const nr=[];let mk;function hk(n){const e=n.pattern.test(mk);cc(n,n.className,e),cc(n,n.inactiveClassName,!e)}function cc(n,e,t){(e||"").split(" ").forEach(i=>{i&&(n.node.classList.remove(i),t&&n.node.classList.add(i))})}qr.subscribe(n=>{mk=n.location+(n.querystring?"?"+n.querystring:""),nr.map(hk)});function qi(n,e){if(e&&(typeof e=="string"||typeof e=="object"&&e instanceof RegExp)?e={path:e}:e=e||{},!e.path&&n.hasAttribute("href")&&(e.path=n.getAttribute("href"),e.path&&e.path.length>1&&e.path.charAt(0)=="#"&&(e.path=e.path.substring(1))),e.className||(e.className="active"),!e.path||typeof e.path=="string"&&(e.path.length<1||e.path.charAt(0)!="/"&&e.path.charAt(0)!="*"))throw Error('Invalid value for "path" argument');const{pattern:t}=typeof e.path=="string"?pk(e.path):{pattern:e.path},i={node:n,className:e.className,inactiveClassName:e.inactiveClassName,pattern:t};return nr.push(i),hk(i),{destroy(){nr.splice(nr.indexOf(i),1)}}}const t3="modulepreload",n3=function(n,e){return new URL(n,e).href},dc={},Tt=function(e,t,i){let l=Promise.resolve();if(t&&t.length>0){const o=document.getElementsByTagName("link"),r=document.querySelector("meta[property=csp-nonce]"),a=(r==null?void 0:r.nonce)||(r==null?void 0:r.getAttribute("nonce"));l=Promise.allSettled(t.map(u=>{if(u=n3(u,i),u in dc)return;dc[u]=!0;const f=u.endsWith(".css"),c=f?'[rel="stylesheet"]':"";if(!!i)for(let h=o.length-1;h>=0;h--){const g=o[h];if(g.href===u&&(!f||g.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${u}"]${c}`))return;const m=document.createElement("link");if(m.rel=f?"stylesheet":t3,f||(m.as="script"),m.crossOrigin="",m.href=u,a&&m.setAttribute("nonce",a),document.head.appendChild(m),f)return new Promise((h,g)=>{m.addEventListener("load",h),m.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(o){const r=new Event("vite:preloadError",{cancelable:!0});if(r.payload=o,window.dispatchEvent(r),!r.defaultPrevented)throw o}return l.then(o=>{for(const r of o||[])r.status==="rejected"&&s(r.reason);return e().catch(s)})};function i3(n){e();function e(){_e.authStore.isValid?is("/collections"):_e.logout()}return[]}class l3 extends Se{constructor(e){super(),we(this,e,i3,null,ke,{})}}function pc(n,e,t){const i=n.slice();return i[12]=e[t],i}const s3=n=>({}),mc=n=>({uniqueId:n[4]});function o3(n){let e,t,i=de(n[3]),l=[];for(let o=0;oD(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;o{s&&(l||(l=He(t,$t,{duration:150,start:.7},!0)),l.run(1))}),s=!0)},o(a){a&&(l||(l=He(t,$t,{duration:150,start:.7},!1)),l.run(0)),s=!1},d(a){a&&y(e),a&&l&&l.end(),o=!1,r()}}}function hc(n){let e,t,i=gr(n[12])+"",l,s,o,r;return{c(){e=b("div"),t=b("pre"),l=B(i),s=C(),p(e,"class","help-block help-block-error")},m(a,u){v(a,e,u),w(e,t),w(t,l),w(e,s),r=!0},p(a,u){(!r||u&8)&&i!==(i=gr(a[12])+"")&&oe(l,i)},i(a){r||(a&&tt(()=>{r&&(o||(o=He(e,mt,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=He(e,mt,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&y(e),a&&o&&o.end()}}}function a3(n){let e,t,i,l,s,o,r;const a=n[9].default,u=Lt(a,n,n[8],mc),f=[r3,o3],c=[];function d(m,h){return m[0]&&m[3].length?0:1}return i=d(n),l=c[i]=f[i](n),{c(){e=b("div"),u&&u.c(),t=C(),l.c(),p(e,"class",n[1]),ee(e,"error",n[3].length)},m(m,h){v(m,e,h),u&&u.m(e,null),w(e,t),c[i].m(e,null),n[11](e),s=!0,o||(r=W(e,"click",n[10]),o=!0)},p(m,[h]){u&&u.p&&(!s||h&256)&&Pt(u,a,m,m[8],s?At(a,m[8],h,s3):Nt(m[8]),mc);let g=i;i=d(m),i===g?c[i].p(m,h):(re(),D(c[g],1,1,()=>{c[g]=null}),ae(),l=c[i],l?l.p(m,h):(l=c[i]=f[i](m),l.c()),M(l,1),l.m(e,null)),(!s||h&2)&&p(e,"class",m[1]),(!s||h&10)&&ee(e,"error",m[3].length)},i(m){s||(M(u,m),M(l),s=!0)},o(m){D(u,m),D(l),s=!1},d(m){m&&y(e),u&&u.d(m),c[i].d(),n[11](null),o=!1,r()}}}const _c="Invalid value";function gr(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||_c:n||_c}function u3(n,e,t){let i;Qe(n,yn,g=>t(7,i=g));let{$$slots:l={},$$scope:s}=e;const o="field_"+V.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:u=void 0}=e,f,c=[];function d(){Yn(r)}Xt(()=>(f.addEventListener("input",d),f.addEventListener("change",d),()=>{f.removeEventListener("input",d),f.removeEventListener("change",d)}));function m(g){Pe.call(this,n,g)}function h(g){ie[g?"unshift":"push"](()=>{f=g,t(2,f)})}return n.$$set=g=>{"name"in g&&t(5,r=g.name),"inlineError"in g&&t(0,a=g.inlineError),"class"in g&&t(1,u=g.class),"$$scope"in g&&t(8,s=g.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,c=V.toArray(V.getNestedVal(i,r)))},[a,u,f,c,o,r,d,i,s,l,m,h]}class fe extends Se{constructor(e){super(),we(this,e,u3,a3,ke,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}const f3=n=>({}),gc=n=>({});function bc(n){let e,t,i,l,s,o;return{c(){e=b("a"),e.innerHTML=' Docs',t=C(),i=b("span"),i.textContent="|",l=C(),s=b("a"),o=b("span"),o.textContent="PocketBase v0.23.7",p(e,"href","https://pocketbase.io/docs/"),p(e,"target","_blank"),p(e,"rel","noopener noreferrer"),p(i,"class","delimiter"),p(o,"class","txt"),p(s,"href","https://github.com/pocketbase/pocketbase/releases"),p(s,"target","_blank"),p(s,"rel","noopener noreferrer"),p(s,"title","Releases")},m(r,a){v(r,e,a),v(r,t,a),v(r,i,a),v(r,l,a),v(r,s,a),w(s,o)},d(r){r&&(y(e),y(t),y(i),y(l),y(s))}}}function c3(n){var m;let e,t,i,l,s,o,r;const a=n[4].default,u=Lt(a,n,n[3],null),f=n[4].footer,c=Lt(f,n,n[3],gc);let d=((m=n[2])==null?void 0:m.id)&&bc();return{c(){e=b("div"),t=b("main"),u&&u.c(),i=C(),l=b("footer"),c&&c.c(),s=C(),d&&d.c(),p(t,"class","page-content"),p(l,"class","page-footer"),p(e,"class",o="page-wrapper "+n[1]),ee(e,"center-content",n[0])},m(h,g){v(h,e,g),w(e,t),u&&u.m(t,null),w(e,i),w(e,l),c&&c.m(l,null),w(l,s),d&&d.m(l,null),r=!0},p(h,[g]){var _;u&&u.p&&(!r||g&8)&&Pt(u,a,h,h[3],r?At(a,h[3],g,null):Nt(h[3]),null),c&&c.p&&(!r||g&8)&&Pt(c,f,h,h[3],r?At(f,h[3],g,f3):Nt(h[3]),gc),(_=h[2])!=null&&_.id?d||(d=bc(),d.c(),d.m(l,null)):d&&(d.d(1),d=null),(!r||g&2&&o!==(o="page-wrapper "+h[1]))&&p(e,"class",o),(!r||g&3)&&ee(e,"center-content",h[0])},i(h){r||(M(u,h),M(c,h),r=!0)},o(h){D(u,h),D(c,h),r=!1},d(h){h&&y(e),u&&u.d(h),c&&c.d(h),d&&d.d()}}}function d3(n,e,t){let i;Qe(n,Rr,a=>t(2,i=a));let{$$slots:l={},$$scope:s}=e,{center:o=!1}=e,{class:r=""}=e;return n.$$set=a=>{"center"in a&&t(0,o=a.center),"class"in a&&t(1,r=a.class),"$$scope"in a&&t(3,s=a.$$scope)},[o,r,i,s,l]}class pi extends Se{constructor(e){super(),we(this,e,d3,c3,ke,{center:0,class:1})}}function p3(n){let e,t,i,l;return{c(){e=b("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(s,o){v(s,e,o),n[13](e),he(e,n[7]),i||(l=W(e,"input",n[14]),i=!0)},p(s,o){o&3&&t!==(t=s[0]||s[1])&&p(e,"placeholder",t),o&128&&e.value!==s[7]&&he(e,s[7])},i:te,o:te,d(s){s&&y(e),n[13](null),i=!1,l()}}}function m3(n){let e,t,i,l;function s(a){n[12](a)}var o=n[4];function r(a,u){let f={id:a[8],singleLine:!0,disableRequestKeys:!0,disableCollectionJoinKeys:!0,extraAutocompleteKeys:a[3],baseCollection:a[2],placeholder:a[0]||a[1]};return a[7]!==void 0&&(f.value=a[7]),{props:f}}return o&&(e=zt(o,r(n)),ie.push(()=>be(e,"value",s)),e.$on("submit",n[10])),{c(){e&&j(e.$$.fragment),i=ye()},m(a,u){e&&q(e,a,u),v(a,i,u),l=!0},p(a,u){if(u&16&&o!==(o=a[4])){if(e){re();const f=e;D(f.$$.fragment,1,0,()=>{H(f,1)}),ae()}o?(e=zt(o,r(a)),ie.push(()=>be(e,"value",s)),e.$on("submit",a[10]),j(e.$$.fragment),M(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else if(o){const f={};u&8&&(f.extraAutocompleteKeys=a[3]),u&4&&(f.baseCollection=a[2]),u&3&&(f.placeholder=a[0]||a[1]),!t&&u&128&&(t=!0,f.value=a[7],$e(()=>t=!1)),e.$set(f)}},i(a){l||(e&&M(e.$$.fragment,a),l=!0)},o(a){e&&D(e.$$.fragment,a),l=!1},d(a){a&&y(i),e&&H(e,a)}}}function kc(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Search',p(e,"type","submit"),p(e,"class","btn btn-expanded-sm btn-sm btn-warning")},m(l,s){v(l,e,s),i=!0},i(l){i||(l&&tt(()=>{i&&(t||(t=He(e,qn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=He(e,qn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(l){l&&y(e),l&&t&&t.end()}}}function yc(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(o,r){v(o,e,r),i=!0,l||(s=W(e,"click",n[15]),l=!0)},p:te,i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,qn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,qn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function h3(n){let e,t,i,l,s,o,r,a,u,f,c;const d=[m3,p3],m=[];function h(k,S){return k[4]&&!k[5]?0:1}s=h(n),o=m[s]=d[s](n);let g=(n[0].length||n[7].length)&&n[7]!=n[0]&&kc(),_=(n[0].length||n[7].length)&&yc(n);return{c(){e=b("form"),t=b("label"),i=b("i"),l=C(),o.c(),r=C(),g&&g.c(),a=C(),_&&_.c(),p(i,"class","ri-search-line"),p(t,"for",n[8]),p(t,"class","m-l-10 txt-xl"),p(e,"class","searchbar")},m(k,S){v(k,e,S),w(e,t),w(t,i),w(e,l),m[s].m(e,null),w(e,r),g&&g.m(e,null),w(e,a),_&&_.m(e,null),u=!0,f||(c=[W(e,"click",On(n[11])),W(e,"submit",nt(n[10]))],f=!0)},p(k,[S]){let $=s;s=h(k),s===$?m[s].p(k,S):(re(),D(m[$],1,1,()=>{m[$]=null}),ae(),o=m[s],o?o.p(k,S):(o=m[s]=d[s](k),o.c()),M(o,1),o.m(e,r)),(k[0].length||k[7].length)&&k[7]!=k[0]?g?S&129&&M(g,1):(g=kc(),g.c(),M(g,1),g.m(e,a)):g&&(re(),D(g,1,1,()=>{g=null}),ae()),k[0].length||k[7].length?_?(_.p(k,S),S&129&&M(_,1)):(_=yc(k),_.c(),M(_,1),_.m(e,null)):_&&(re(),D(_,1,1,()=>{_=null}),ae())},i(k){u||(M(o),M(g),M(_),u=!0)},o(k){D(o),D(g),D(_),u=!1},d(k){k&&y(e),m[s].d(),g&&g.d(),_&&_.d(),f=!1,Ie(c)}}}function _3(n,e,t){const i=kt(),l="search_"+V.randomString(7);let{value:s=""}=e,{placeholder:o='Search term or filter like created > "2022-01-01"...'}=e,{autocompleteCollection:r=null}=e,{extraAutocompleteKeys:a=[]}=e,u,f=!1,c,d="";function m(O=!0){t(7,d=""),O&&(c==null||c.focus()),i("clear")}function h(){t(0,s=d),i("submit",s)}async function g(){u||f||(t(5,f=!0),t(4,u=(await Tt(async()=>{const{default:O}=await import("./FilterAutocompleteInput-Ek7e14PX.js");return{default:O}},__vite__mapDeps([0,1]),import.meta.url)).default),t(5,f=!1))}Xt(()=>{g()});function _(O){Pe.call(this,n,O)}function k(O){d=O,t(7,d),t(0,s)}function S(O){ie[O?"unshift":"push"](()=>{c=O,t(6,c)})}function $(){d=this.value,t(7,d),t(0,s)}const T=()=>{m(!1),h()};return n.$$set=O=>{"value"in O&&t(0,s=O.value),"placeholder"in O&&t(1,o=O.placeholder),"autocompleteCollection"in O&&t(2,r=O.autocompleteCollection),"extraAutocompleteKeys"in O&&t(3,a=O.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof s=="string"&&t(7,d=s)},[s,o,r,a,u,f,c,d,l,m,h,_,k,S,$,T]}class Hr extends Se{constructor(e){super(),we(this,e,_3,h3,ke,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}function g3(n){let e,t,i,l,s,o;return{c(){e=b("button"),t=b("i"),p(t,"class","ri-refresh-line svelte-1bvelc2"),p(e,"type","button"),p(e,"aria-label","Refresh"),p(e,"class",i="btn btn-transparent btn-circle "+n[1]+" svelte-1bvelc2"),ee(e,"refreshing",n[2])},m(r,a){v(r,e,a),w(e,t),s||(o=[Oe(l=qe.call(null,e,n[0])),W(e,"click",n[3])],s=!0)},p(r,[a]){a&2&&i!==(i="btn btn-transparent btn-circle "+r[1]+" svelte-1bvelc2")&&p(e,"class",i),l&&It(l.update)&&a&1&&l.update.call(null,r[0]),a&6&&ee(e,"refreshing",r[2])},i:te,o:te,d(r){r&&y(e),s=!1,Ie(o)}}}function b3(n,e,t){const i=kt();let{tooltip:l={text:"Refresh",position:"right"}}=e,{class:s=""}=e,o=null;function r(){i("refresh");const a=l;t(0,l=null),clearTimeout(o),t(2,o=setTimeout(()=>{t(2,o=null),t(0,l=a)},150))}return Xt(()=>()=>clearTimeout(o)),n.$$set=a=>{"tooltip"in a&&t(0,l=a.tooltip),"class"in a&&t(1,s=a.class)},[l,s,o,r]}class Pu extends Se{constructor(e){super(),we(this,e,b3,g3,ke,{tooltip:0,class:1})}}const k3=n=>({}),vc=n=>({}),y3=n=>({}),wc=n=>({});function v3(n){let e,t,i,l,s,o,r,a;const u=n[11].before,f=Lt(u,n,n[10],wc),c=n[11].default,d=Lt(c,n,n[10],null),m=n[11].after,h=Lt(m,n,n[10],vc);return{c(){e=b("div"),f&&f.c(),t=C(),i=b("div"),d&&d.c(),s=C(),h&&h.c(),p(i,"class",l="scroller "+n[0]+" "+n[3]+" svelte-3a0gfs"),p(e,"class","scroller-wrapper svelte-3a0gfs")},m(g,_){v(g,e,_),f&&f.m(e,null),w(e,t),w(e,i),d&&d.m(i,null),n[12](i),w(e,s),h&&h.m(e,null),o=!0,r||(a=[W(window,"resize",n[1]),W(i,"scroll",n[1])],r=!0)},p(g,[_]){f&&f.p&&(!o||_&1024)&&Pt(f,u,g,g[10],o?At(u,g[10],_,y3):Nt(g[10]),wc),d&&d.p&&(!o||_&1024)&&Pt(d,c,g,g[10],o?At(c,g[10],_,null):Nt(g[10]),null),(!o||_&9&&l!==(l="scroller "+g[0]+" "+g[3]+" svelte-3a0gfs"))&&p(i,"class",l),h&&h.p&&(!o||_&1024)&&Pt(h,m,g,g[10],o?At(m,g[10],_,k3):Nt(g[10]),vc)},i(g){o||(M(f,g),M(d,g),M(h,g),o=!0)},o(g){D(f,g),D(d,g),D(h,g),o=!1},d(g){g&&y(e),f&&f.d(g),d&&d.d(g),n[12](null),h&&h.d(g),r=!1,Ie(a)}}}function w3(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=kt();let{class:o=""}=e,{vThreshold:r=0}=e,{hThreshold:a=0}=e,{dispatchOnNoScroll:u=!0}=e,f=null,c="",d=null,m,h,g,_,k;function S(){f&&t(2,f.scrollTop=0,f)}function $(){f&&t(2,f.scrollLeft=0,f)}function T(){f&&(t(3,c=""),g=f.clientWidth+2,_=f.clientHeight+2,m=f.scrollWidth-g,h=f.scrollHeight-_,h>0?(t(3,c+=" v-scroll"),r>=_&&t(4,r=0),f.scrollTop-r<=0&&(t(3,c+=" v-scroll-start"),s("vScrollStart")),f.scrollTop+r>=h&&(t(3,c+=" v-scroll-end"),s("vScrollEnd"))):u&&s("vScrollEnd"),m>0?(t(3,c+=" h-scroll"),a>=g&&t(5,a=0),f.scrollLeft-a<=0&&(t(3,c+=" h-scroll-start"),s("hScrollStart")),f.scrollLeft+a>=m&&(t(3,c+=" h-scroll-end"),s("hScrollEnd"))):u&&s("hScrollEnd"))}function O(){d||(d=setTimeout(()=>{T(),d=null},150))}Xt(()=>(O(),k=new MutationObserver(O),k.observe(f,{attributeFilter:["width","height"],childList:!0,subtree:!0}),()=>{k==null||k.disconnect(),clearTimeout(d)}));function E(L){ie[L?"unshift":"push"](()=>{f=L,t(2,f)})}return n.$$set=L=>{"class"in L&&t(0,o=L.class),"vThreshold"in L&&t(4,r=L.vThreshold),"hThreshold"in L&&t(5,a=L.hThreshold),"dispatchOnNoScroll"in L&&t(6,u=L.dispatchOnNoScroll),"$$scope"in L&&t(10,l=L.$$scope)},[o,O,f,c,r,a,u,S,$,T,l,i,E]}class Nu extends Se{constructor(e){super(),we(this,e,w3,v3,ke,{class:0,vThreshold:4,hThreshold:5,dispatchOnNoScroll:6,resetVerticalScroll:7,resetHorizontalScroll:8,refresh:9,throttleRefresh:1})}get resetVerticalScroll(){return this.$$.ctx[7]}get resetHorizontalScroll(){return this.$$.ctx[8]}get refresh(){return this.$$.ctx[9]}get throttleRefresh(){return this.$$.ctx[1]}}function S3(n){let e,t,i,l,s;const o=n[6].default,r=Lt(o,n,n[5],null);return{c(){e=b("th"),r&&r.c(),p(e,"tabindex","0"),p(e,"title",n[2]),p(e,"class",t="col-sort "+n[1]),ee(e,"col-sort-disabled",n[3]),ee(e,"sort-active",n[0]==="-"+n[2]||n[0]==="+"+n[2]),ee(e,"sort-desc",n[0]==="-"+n[2]),ee(e,"sort-asc",n[0]==="+"+n[2])},m(a,u){v(a,e,u),r&&r.m(e,null),i=!0,l||(s=[W(e,"click",n[7]),W(e,"keydown",n[8])],l=!0)},p(a,[u]){r&&r.p&&(!i||u&32)&&Pt(r,o,a,a[5],i?At(o,a[5],u,null):Nt(a[5]),null),(!i||u&4)&&p(e,"title",a[2]),(!i||u&2&&t!==(t="col-sort "+a[1]))&&p(e,"class",t),(!i||u&10)&&ee(e,"col-sort-disabled",a[3]),(!i||u&7)&&ee(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),(!i||u&7)&&ee(e,"sort-desc",a[0]==="-"+a[2]),(!i||u&7)&&ee(e,"sort-asc",a[0]==="+"+a[2])},i(a){i||(M(r,a),i=!0)},o(a){D(r,a),i=!1},d(a){a&&y(e),r&&r.d(a),l=!1,Ie(s)}}}function T3(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,{name:o}=e,{sort:r=""}=e,{disable:a=!1}=e;function u(){a||("-"+o===r?t(0,r="+"+o):t(0,r="-"+o))}const f=()=>u(),c=d=>{(d.code==="Enter"||d.code==="Space")&&(d.preventDefault(),u())};return n.$$set=d=>{"class"in d&&t(1,s=d.class),"name"in d&&t(2,o=d.name),"sort"in d&&t(0,r=d.sort),"disable"in d&&t(3,a=d.disable),"$$scope"in d&&t(5,l=d.$$scope)},[r,s,o,a,u,l,i,f,c]}class ir extends Se{constructor(e){super(),we(this,e,T3,S3,ke,{class:1,name:2,sort:0,disable:3})}}function $3(n){let e,t=n[0].replace("Z"," UTC")+"",i,l,s;return{c(){e=b("span"),i=B(t),p(e,"class","txt-nowrap")},m(o,r){v(o,e,r),w(e,i),l||(s=Oe(qe.call(null,e,n[1])),l=!0)},p(o,[r]){r&1&&t!==(t=o[0].replace("Z"," UTC")+"")&&oe(i,t)},i:te,o:te,d(o){o&&y(e),l=!1,s()}}}function C3(n,e,t){let{date:i}=e;const l={get text(){return V.formatToLocalDate(i,"yyyy-MM-dd HH:mm:ss.SSS")+" Local"}};return n.$$set=s=>{"date"in s&&t(0,i=s.date)},[i,l]}class _k extends Se{constructor(e){super(),we(this,e,C3,$3,ke,{date:0})}}function O3(n){let e,t,i=(n[1]||"UNKN")+"",l,s,o,r,a;return{c(){e=b("div"),t=b("span"),l=B(i),s=B(" ("),o=B(n[0]),r=B(")"),p(t,"class","txt"),p(e,"class",a="label log-level-label level-"+n[0]+" svelte-ha6hme")},m(u,f){v(u,e,f),w(e,t),w(t,l),w(t,s),w(t,o),w(t,r)},p(u,[f]){f&2&&i!==(i=(u[1]||"UNKN")+"")&&oe(l,i),f&1&&oe(o,u[0]),f&1&&a!==(a="label log-level-label level-"+u[0]+" svelte-ha6hme")&&p(e,"class",a)},i:te,o:te,d(u){u&&y(e)}}}function M3(n,e,t){let i,{level:l}=e;return n.$$set=s=>{"level"in s&&t(0,l=s.level)},n.$$.update=()=>{var s;n.$$.dirty&1&&t(1,i=(s=x0.find(o=>o.level==l))==null?void 0:s.label)},[l,i]}class gk extends Se{constructor(e){super(),we(this,e,M3,O3,ke,{level:0})}}function Sc(n,e,t){var o;const i=n.slice();i[32]=e[t];const l=((o=i[32].data)==null?void 0:o.type)=="request";i[33]=l;const s=j3(i[32]);return i[34]=s,i}function Tc(n,e,t){const i=n.slice();return i[37]=e[t],i}function E3(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),t=b("input"),l=C(),s=b("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[3].length,t.checked=n[8],p(s,"for","checkbox_0"),p(e,"class","form-field")},m(a,u){v(a,e,u),w(e,t),w(e,l),w(e,s),o||(r=W(t,"change",n[19]),o=!0)},p(a,u){u[0]&8&&i!==(i=!a[3].length)&&(t.disabled=i),u[0]&256&&(t.checked=a[8])},d(a){a&&y(e),o=!1,r()}}}function D3(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function I3(n){let e;return{c(){e=b("div"),e.innerHTML=' level',p(e,"class","col-header-content")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function L3(n){let e;return{c(){e=b("div"),e.innerHTML=' message',p(e,"class","col-header-content")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function A3(n){let e;return{c(){e=b("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function $c(n){let e;function t(s,o){return s[7]?N3:P3}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),v(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&y(e),l.d(s)}}}function P3(n){var r;let e,t,i,l,s,o=((r=n[0])==null?void 0:r.length)&&Cc(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No logs found.",l=C(),o&&o.c(),s=C(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){v(a,e,u),w(e,t),w(t,i),w(t,l),o&&o.m(t,null),w(e,s)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=Cc(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&y(e),o&&o.d()}}}function N3(n){let e;return{c(){e=b("tr"),e.innerHTML=' '},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function Cc(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(l,s){v(l,e,s),t||(i=W(e,"click",n[26]),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function Oc(n){let e,t=de(n[34]),i=[];for(let l=0;l',P=C(),p(s,"type","checkbox"),p(s,"id",o="checkbox_"+e[32].id),s.checked=r=e[4][e[32].id],p(u,"for",f="checkbox_"+e[32].id),p(l,"class","form-field"),p(i,"class","bulk-select-col min-width"),p(d,"class","col-type-text col-field-level min-width svelte-91v05h"),p(k,"class","txt-ellipsis"),p(_,"class","flex flex-gap-10"),p(g,"class","col-type-text col-field-message svelte-91v05h"),p(E,"class","col-type-date col-field-created"),p(A,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(Z,G){v(Z,t,G),w(t,i),w(i,l),w(l,s),w(l,a),w(l,u),w(t,c),w(t,d),q(m,d,null),w(t,h),w(t,g),w(g,_),w(_,k),w(k,$),w(g,T),U&&U.m(g,null),w(t,O),w(t,E),q(L,E,null),w(t,I),w(t,A),w(t,P),N=!0,R||(z=[W(s,"change",F),W(l,"click",On(e[18])),W(t,"click",J),W(t,"keydown",Y)],R=!0)},p(Z,G){e=Z,(!N||G[0]&8&&o!==(o="checkbox_"+e[32].id))&&p(s,"id",o),(!N||G[0]&24&&r!==(r=e[4][e[32].id]))&&(s.checked=r),(!N||G[0]&8&&f!==(f="checkbox_"+e[32].id))&&p(u,"for",f);const pe={};G[0]&8&&(pe.level=e[32].level),m.$set(pe),(!N||G[0]&8)&&S!==(S=e[32].message+"")&&oe($,S),e[34].length?U?U.p(e,G):(U=Oc(e),U.c(),U.m(g,null)):U&&(U.d(1),U=null);const ce={};G[0]&8&&(ce.date=e[32].created),L.$set(ce)},i(Z){N||(M(m.$$.fragment,Z),M(L.$$.fragment,Z),N=!0)},o(Z){D(m.$$.fragment,Z),D(L.$$.fragment,Z),N=!1},d(Z){Z&&y(t),H(m),U&&U.d(),H(L),R=!1,Ie(z)}}}function q3(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S=[],$=new Map,T;function O(Y,Z){return Y[7]?D3:E3}let E=O(n),L=E(n);function I(Y){n[20](Y)}let A={disable:!0,class:"col-field-level min-width",name:"level",$$slots:{default:[I3]},$$scope:{ctx:n}};n[1]!==void 0&&(A.sort=n[1]),o=new ir({props:A}),ie.push(()=>be(o,"sort",I));function P(Y){n[21](Y)}let N={disable:!0,class:"col-type-text col-field-message",name:"data",$$slots:{default:[L3]},$$scope:{ctx:n}};n[1]!==void 0&&(N.sort=n[1]),u=new ir({props:N}),ie.push(()=>be(u,"sort",P));function R(Y){n[22](Y)}let z={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[A3]},$$scope:{ctx:n}};n[1]!==void 0&&(z.sort=n[1]),d=new ir({props:z}),ie.push(()=>be(d,"sort",R));let F=de(n[3]);const U=Y=>Y[32].id;for(let Y=0;Yr=!1)),o.$set(G);const pe={};Z[1]&512&&(pe.$$scope={dirty:Z,ctx:Y}),!f&&Z[0]&2&&(f=!0,pe.sort=Y[1],$e(()=>f=!1)),u.$set(pe);const ce={};Z[1]&512&&(ce.$$scope={dirty:Z,ctx:Y}),!m&&Z[0]&2&&(m=!0,ce.sort=Y[1],$e(()=>m=!1)),d.$set(ce),Z[0]&9369&&(F=de(Y[3]),re(),S=vt(S,Z,U,1,Y,F,$,k,Bt,Ec,null,Sc),ae(),!F.length&&J?J.p(Y,Z):F.length?J&&(J.d(1),J=null):(J=$c(Y),J.c(),J.m(k,null))),(!T||Z[0]&128)&&ee(e,"table-loading",Y[7])},i(Y){if(!T){M(o.$$.fragment,Y),M(u.$$.fragment,Y),M(d.$$.fragment,Y);for(let Z=0;ZLoad more',p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),ee(t,"btn-loading",n[7]),ee(t,"btn-disabled",n[7]),p(e,"class","block txt-center m-t-sm")},m(s,o){v(s,e,o),w(e,t),i||(l=W(t,"click",n[27]),i=!0)},p(s,o){o[0]&128&&ee(t,"btn-loading",s[7]),o[0]&128&&ee(t,"btn-disabled",s[7])},d(s){s&&y(e),i=!1,l()}}}function Ic(n){let e,t,i,l,s,o,r=n[5]===1?"log":"logs",a,u,f,c,d,m,h,g,_,k,S;return{c(){e=b("div"),t=b("div"),i=B("Selected "),l=b("strong"),s=B(n[5]),o=C(),a=B(r),u=C(),f=b("button"),f.innerHTML='Reset',c=C(),d=b("div"),m=C(),h=b("button"),h.innerHTML='Download as JSON',p(t,"class","txt"),p(f,"type","button"),p(f,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),p(d,"class","flex-fill"),p(h,"type","button"),p(h,"class","btn btn-sm"),p(e,"class","bulkbar svelte-91v05h")},m($,T){v($,e,T),w(e,t),w(t,i),w(t,l),w(l,s),w(t,o),w(t,a),w(e,u),w(e,f),w(e,c),w(e,d),w(e,m),w(e,h),_=!0,k||(S=[W(f,"click",n[28]),W(h,"click",n[14])],k=!0)},p($,T){(!_||T[0]&32)&&oe(s,$[5]),(!_||T[0]&32)&&r!==(r=$[5]===1?"log":"logs")&&oe(a,r)},i($){_||($&&tt(()=>{_&&(g||(g=He(e,qn,{duration:150,y:5},!0)),g.run(1))}),_=!0)},o($){$&&(g||(g=He(e,qn,{duration:150,y:5},!1)),g.run(0)),_=!1},d($){$&&y(e),$&&g&&g.end(),k=!1,Ie(S)}}}function H3(n){let e,t,i,l,s;e=new Nu({props:{class:"table-wrapper",$$slots:{default:[q3]},$$scope:{ctx:n}}});let o=n[3].length&&n[9]&&Dc(n),r=n[5]&&Ic(n);return{c(){j(e.$$.fragment),t=C(),o&&o.c(),i=C(),r&&r.c(),l=ye()},m(a,u){q(e,a,u),v(a,t,u),o&&o.m(a,u),v(a,i,u),r&&r.m(a,u),v(a,l,u),s=!0},p(a,u){const f={};u[0]&411|u[1]&512&&(f.$$scope={dirty:u,ctx:a}),e.$set(f),a[3].length&&a[9]?o?o.p(a,u):(o=Dc(a),o.c(),o.m(i.parentNode,i)):o&&(o.d(1),o=null),a[5]?r?(r.p(a,u),u[0]&32&&M(r,1)):(r=Ic(a),r.c(),M(r,1),r.m(l.parentNode,l)):r&&(re(),D(r,1,1,()=>{r=null}),ae())},i(a){s||(M(e.$$.fragment,a),M(r),s=!0)},o(a){D(e.$$.fragment,a),D(r),s=!1},d(a){a&&(y(t),y(i),y(l)),H(e,a),o&&o.d(a),r&&r.d(a)}}}const Lc=50,aa=/[-:\. ]/gi;function j3(n){let e=[];if(!n.data)return e;if(n.data.type=="request"){const t=["status","execTime","auth","authId","userIP"];for(let i of t)typeof n.data[i]<"u"&&e.push({key:i});n.data.referer&&!n.data.referer.includes(window.location.host)&&e.push({key:"referer"})}else{const t=Object.keys(n.data);for(const i of t)i!="error"&&i!="details"&&e.length<6&&e.push({key:i})}return n.data.error&&e.push({key:"error",label:"label-danger"}),n.data.details&&e.push({key:"details",label:"label-warning"}),e}function z3(n,e,t){let i,l,s;const o=kt();let{filter:r=""}=e,{presets:a=""}=e,{zoom:u={}}=e,{sort:f="-@rowid"}=e,c=[],d=1,m=0,h=!1,g=0,_={};async function k(G=1,pe=!0){t(7,h=!0);const ce=[a,V.normalizeLogsFilter(r)];return u.min&&u.max&&ce.push(`created >= "${u.min}" && created <= "${u.max}"`),_e.logs.getList(G,Lc,{sort:f,skipTotal:1,filter:ce.filter(Boolean).map(ue=>"("+ue+")").join("&&")}).then(async ue=>{var Ke;G<=1&&S();const Te=V.toArray(ue.items);if(t(7,h=!1),t(6,d=ue.page),t(17,m=((Ke=ue.items)==null?void 0:Ke.length)||0),o("load",c.concat(Te)),pe){const Je=++g;for(;Te.length&&g==Je;){const ft=Te.splice(0,10);for(let et of ft)V.pushOrReplaceByKey(c,et);t(3,c),await V.yieldToMain()}}else{for(let Je of Te)V.pushOrReplaceByKey(c,Je);t(3,c)}}).catch(ue=>{ue!=null&&ue.isAbort||(t(7,h=!1),console.warn(ue),S(),_e.error(ue,!ce||(ue==null?void 0:ue.status)!=400))})}function S(){t(3,c=[]),t(4,_={}),t(6,d=1),t(17,m=0)}function $(){s?T():O()}function T(){t(4,_={})}function O(){for(const G of c)t(4,_[G.id]=G,_);t(4,_)}function E(G){_[G.id]?delete _[G.id]:t(4,_[G.id]=G,_),t(4,_)}function L(){const G=Object.values(_).sort((ue,Te)=>ue.createdTe.created?-1:0);if(!G.length)return;if(G.length==1)return V.downloadJson(G[0],"log_"+G[0].created.replaceAll(aa,"")+".json");const pe=G[0].created.replaceAll(aa,""),ce=G[G.length-1].created.replaceAll(aa,"");return V.downloadJson(G,`${G.length}_logs_${ce}_to_${pe}.json`)}function I(G){Pe.call(this,n,G)}const A=()=>$();function P(G){f=G,t(1,f)}function N(G){f=G,t(1,f)}function R(G){f=G,t(1,f)}const z=G=>E(G),F=G=>o("select",G),U=(G,pe)=>{pe.code==="Enter"&&(pe.preventDefault(),o("select",G))},J=()=>t(0,r=""),Y=()=>k(d+1),Z=()=>T();return n.$$set=G=>{"filter"in G&&t(0,r=G.filter),"presets"in G&&t(15,a=G.presets),"zoom"in G&&t(16,u=G.zoom),"sort"in G&&t(1,f=G.sort)},n.$$.update=()=>{n.$$.dirty[0]&98307&&(typeof f<"u"||typeof r<"u"||typeof a<"u"||typeof u<"u")&&(S(),k(1)),n.$$.dirty[0]&131072&&t(9,i=m>=Lc),n.$$.dirty[0]&16&&t(5,l=Object.keys(_).length),n.$$.dirty[0]&40&&t(8,s=c.length&&l===c.length)},[r,f,k,c,_,l,d,h,s,i,o,$,T,E,L,a,u,m,I,A,P,N,R,z,F,U,J,Y,Z]}class U3 extends Se{constructor(e){super(),we(this,e,z3,H3,ke,{filter:0,presets:15,zoom:16,sort:1,load:2},null,[-1,-1])}get load(){return this.$$.ctx[2]}}/*! +`)})},i(a){s||(a&&tt(()=>{s&&(l||(l=He(t,$t,{duration:150,start:.7},!0)),l.run(1))}),s=!0)},o(a){a&&(l||(l=He(t,$t,{duration:150,start:.7},!1)),l.run(0)),s=!1},d(a){a&&y(e),a&&l&&l.end(),o=!1,r()}}}function hc(n){let e,t,i=gr(n[12])+"",l,s,o,r;return{c(){e=b("div"),t=b("pre"),l=B(i),s=C(),p(e,"class","help-block help-block-error")},m(a,u){v(a,e,u),w(e,t),w(t,l),w(e,s),r=!0},p(a,u){(!r||u&8)&&i!==(i=gr(a[12])+"")&&oe(l,i)},i(a){r||(a&&tt(()=>{r&&(o||(o=He(e,mt,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=He(e,mt,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&y(e),a&&o&&o.end()}}}function a3(n){let e,t,i,l,s,o,r;const a=n[9].default,u=Lt(a,n,n[8],mc),f=[r3,o3],c=[];function d(m,h){return m[0]&&m[3].length?0:1}return i=d(n),l=c[i]=f[i](n),{c(){e=b("div"),u&&u.c(),t=C(),l.c(),p(e,"class",n[1]),ee(e,"error",n[3].length)},m(m,h){v(m,e,h),u&&u.m(e,null),w(e,t),c[i].m(e,null),n[11](e),s=!0,o||(r=W(e,"click",n[10]),o=!0)},p(m,[h]){u&&u.p&&(!s||h&256)&&Pt(u,a,m,m[8],s?At(a,m[8],h,s3):Nt(m[8]),mc);let g=i;i=d(m),i===g?c[i].p(m,h):(re(),D(c[g],1,1,()=>{c[g]=null}),ae(),l=c[i],l?l.p(m,h):(l=c[i]=f[i](m),l.c()),M(l,1),l.m(e,null)),(!s||h&2)&&p(e,"class",m[1]),(!s||h&10)&&ee(e,"error",m[3].length)},i(m){s||(M(u,m),M(l),s=!0)},o(m){D(u,m),D(l),s=!1},d(m){m&&y(e),u&&u.d(m),c[i].d(),n[11](null),o=!1,r()}}}const _c="Invalid value";function gr(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||_c:n||_c}function u3(n,e,t){let i;Qe(n,yn,g=>t(7,i=g));let{$$slots:l={},$$scope:s}=e;const o="field_"+V.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:u=void 0}=e,f,c=[];function d(){Yn(r)}Xt(()=>(f.addEventListener("input",d),f.addEventListener("change",d),()=>{f.removeEventListener("input",d),f.removeEventListener("change",d)}));function m(g){Pe.call(this,n,g)}function h(g){ie[g?"unshift":"push"](()=>{f=g,t(2,f)})}return n.$$set=g=>{"name"in g&&t(5,r=g.name),"inlineError"in g&&t(0,a=g.inlineError),"class"in g&&t(1,u=g.class),"$$scope"in g&&t(8,s=g.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,c=V.toArray(V.getNestedVal(i,r)))},[a,u,f,c,o,r,d,i,s,l,m,h]}class fe extends Se{constructor(e){super(),we(this,e,u3,a3,ke,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}const f3=n=>({}),gc=n=>({});function bc(n){let e,t,i,l,s,o;return{c(){e=b("a"),e.innerHTML=' Docs',t=C(),i=b("span"),i.textContent="|",l=C(),s=b("a"),o=b("span"),o.textContent="PocketBase v0.23.8",p(e,"href","https://pocketbase.io/docs/"),p(e,"target","_blank"),p(e,"rel","noopener noreferrer"),p(i,"class","delimiter"),p(o,"class","txt"),p(s,"href","https://github.com/pocketbase/pocketbase/releases"),p(s,"target","_blank"),p(s,"rel","noopener noreferrer"),p(s,"title","Releases")},m(r,a){v(r,e,a),v(r,t,a),v(r,i,a),v(r,l,a),v(r,s,a),w(s,o)},d(r){r&&(y(e),y(t),y(i),y(l),y(s))}}}function c3(n){var m;let e,t,i,l,s,o,r;const a=n[4].default,u=Lt(a,n,n[3],null),f=n[4].footer,c=Lt(f,n,n[3],gc);let d=((m=n[2])==null?void 0:m.id)&&bc();return{c(){e=b("div"),t=b("main"),u&&u.c(),i=C(),l=b("footer"),c&&c.c(),s=C(),d&&d.c(),p(t,"class","page-content"),p(l,"class","page-footer"),p(e,"class",o="page-wrapper "+n[1]),ee(e,"center-content",n[0])},m(h,g){v(h,e,g),w(e,t),u&&u.m(t,null),w(e,i),w(e,l),c&&c.m(l,null),w(l,s),d&&d.m(l,null),r=!0},p(h,[g]){var _;u&&u.p&&(!r||g&8)&&Pt(u,a,h,h[3],r?At(a,h[3],g,null):Nt(h[3]),null),c&&c.p&&(!r||g&8)&&Pt(c,f,h,h[3],r?At(f,h[3],g,f3):Nt(h[3]),gc),(_=h[2])!=null&&_.id?d||(d=bc(),d.c(),d.m(l,null)):d&&(d.d(1),d=null),(!r||g&2&&o!==(o="page-wrapper "+h[1]))&&p(e,"class",o),(!r||g&3)&&ee(e,"center-content",h[0])},i(h){r||(M(u,h),M(c,h),r=!0)},o(h){D(u,h),D(c,h),r=!1},d(h){h&&y(e),u&&u.d(h),c&&c.d(h),d&&d.d()}}}function d3(n,e,t){let i;Qe(n,Rr,a=>t(2,i=a));let{$$slots:l={},$$scope:s}=e,{center:o=!1}=e,{class:r=""}=e;return n.$$set=a=>{"center"in a&&t(0,o=a.center),"class"in a&&t(1,r=a.class),"$$scope"in a&&t(3,s=a.$$scope)},[o,r,i,s,l]}class pi extends Se{constructor(e){super(),we(this,e,d3,c3,ke,{center:0,class:1})}}function p3(n){let e,t,i,l;return{c(){e=b("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(s,o){v(s,e,o),n[13](e),he(e,n[7]),i||(l=W(e,"input",n[14]),i=!0)},p(s,o){o&3&&t!==(t=s[0]||s[1])&&p(e,"placeholder",t),o&128&&e.value!==s[7]&&he(e,s[7])},i:te,o:te,d(s){s&&y(e),n[13](null),i=!1,l()}}}function m3(n){let e,t,i,l;function s(a){n[12](a)}var o=n[4];function r(a,u){let f={id:a[8],singleLine:!0,disableRequestKeys:!0,disableCollectionJoinKeys:!0,extraAutocompleteKeys:a[3],baseCollection:a[2],placeholder:a[0]||a[1]};return a[7]!==void 0&&(f.value=a[7]),{props:f}}return o&&(e=zt(o,r(n)),ie.push(()=>be(e,"value",s)),e.$on("submit",n[10])),{c(){e&&j(e.$$.fragment),i=ye()},m(a,u){e&&q(e,a,u),v(a,i,u),l=!0},p(a,u){if(u&16&&o!==(o=a[4])){if(e){re();const f=e;D(f.$$.fragment,1,0,()=>{H(f,1)}),ae()}o?(e=zt(o,r(a)),ie.push(()=>be(e,"value",s)),e.$on("submit",a[10]),j(e.$$.fragment),M(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else if(o){const f={};u&8&&(f.extraAutocompleteKeys=a[3]),u&4&&(f.baseCollection=a[2]),u&3&&(f.placeholder=a[0]||a[1]),!t&&u&128&&(t=!0,f.value=a[7],$e(()=>t=!1)),e.$set(f)}},i(a){l||(e&&M(e.$$.fragment,a),l=!0)},o(a){e&&D(e.$$.fragment,a),l=!1},d(a){a&&y(i),e&&H(e,a)}}}function kc(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Search',p(e,"type","submit"),p(e,"class","btn btn-expanded-sm btn-sm btn-warning")},m(l,s){v(l,e,s),i=!0},i(l){i||(l&&tt(()=>{i&&(t||(t=He(e,qn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=He(e,qn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(l){l&&y(e),l&&t&&t.end()}}}function yc(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(o,r){v(o,e,r),i=!0,l||(s=W(e,"click",n[15]),l=!0)},p:te,i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,qn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,qn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function h3(n){let e,t,i,l,s,o,r,a,u,f,c;const d=[m3,p3],m=[];function h(k,S){return k[4]&&!k[5]?0:1}s=h(n),o=m[s]=d[s](n);let g=(n[0].length||n[7].length)&&n[7]!=n[0]&&kc(),_=(n[0].length||n[7].length)&&yc(n);return{c(){e=b("form"),t=b("label"),i=b("i"),l=C(),o.c(),r=C(),g&&g.c(),a=C(),_&&_.c(),p(i,"class","ri-search-line"),p(t,"for",n[8]),p(t,"class","m-l-10 txt-xl"),p(e,"class","searchbar")},m(k,S){v(k,e,S),w(e,t),w(t,i),w(e,l),m[s].m(e,null),w(e,r),g&&g.m(e,null),w(e,a),_&&_.m(e,null),u=!0,f||(c=[W(e,"click",On(n[11])),W(e,"submit",nt(n[10]))],f=!0)},p(k,[S]){let $=s;s=h(k),s===$?m[s].p(k,S):(re(),D(m[$],1,1,()=>{m[$]=null}),ae(),o=m[s],o?o.p(k,S):(o=m[s]=d[s](k),o.c()),M(o,1),o.m(e,r)),(k[0].length||k[7].length)&&k[7]!=k[0]?g?S&129&&M(g,1):(g=kc(),g.c(),M(g,1),g.m(e,a)):g&&(re(),D(g,1,1,()=>{g=null}),ae()),k[0].length||k[7].length?_?(_.p(k,S),S&129&&M(_,1)):(_=yc(k),_.c(),M(_,1),_.m(e,null)):_&&(re(),D(_,1,1,()=>{_=null}),ae())},i(k){u||(M(o),M(g),M(_),u=!0)},o(k){D(o),D(g),D(_),u=!1},d(k){k&&y(e),m[s].d(),g&&g.d(),_&&_.d(),f=!1,Ie(c)}}}function _3(n,e,t){const i=kt(),l="search_"+V.randomString(7);let{value:s=""}=e,{placeholder:o='Search term or filter like created > "2022-01-01"...'}=e,{autocompleteCollection:r=null}=e,{extraAutocompleteKeys:a=[]}=e,u,f=!1,c,d="";function m(O=!0){t(7,d=""),O&&(c==null||c.focus()),i("clear")}function h(){t(0,s=d),i("submit",s)}async function g(){u||f||(t(5,f=!0),t(4,u=(await Tt(async()=>{const{default:O}=await import("./FilterAutocompleteInput-DNssmiMR.js");return{default:O}},__vite__mapDeps([0,1]),import.meta.url)).default),t(5,f=!1))}Xt(()=>{g()});function _(O){Pe.call(this,n,O)}function k(O){d=O,t(7,d),t(0,s)}function S(O){ie[O?"unshift":"push"](()=>{c=O,t(6,c)})}function $(){d=this.value,t(7,d),t(0,s)}const T=()=>{m(!1),h()};return n.$$set=O=>{"value"in O&&t(0,s=O.value),"placeholder"in O&&t(1,o=O.placeholder),"autocompleteCollection"in O&&t(2,r=O.autocompleteCollection),"extraAutocompleteKeys"in O&&t(3,a=O.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof s=="string"&&t(7,d=s)},[s,o,r,a,u,f,c,d,l,m,h,_,k,S,$,T]}class Hr extends Se{constructor(e){super(),we(this,e,_3,h3,ke,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}function g3(n){let e,t,i,l,s,o;return{c(){e=b("button"),t=b("i"),p(t,"class","ri-refresh-line svelte-1bvelc2"),p(e,"type","button"),p(e,"aria-label","Refresh"),p(e,"class",i="btn btn-transparent btn-circle "+n[1]+" svelte-1bvelc2"),ee(e,"refreshing",n[2])},m(r,a){v(r,e,a),w(e,t),s||(o=[Oe(l=qe.call(null,e,n[0])),W(e,"click",n[3])],s=!0)},p(r,[a]){a&2&&i!==(i="btn btn-transparent btn-circle "+r[1]+" svelte-1bvelc2")&&p(e,"class",i),l&&It(l.update)&&a&1&&l.update.call(null,r[0]),a&6&&ee(e,"refreshing",r[2])},i:te,o:te,d(r){r&&y(e),s=!1,Ie(o)}}}function b3(n,e,t){const i=kt();let{tooltip:l={text:"Refresh",position:"right"}}=e,{class:s=""}=e,o=null;function r(){i("refresh");const a=l;t(0,l=null),clearTimeout(o),t(2,o=setTimeout(()=>{t(2,o=null),t(0,l=a)},150))}return Xt(()=>()=>clearTimeout(o)),n.$$set=a=>{"tooltip"in a&&t(0,l=a.tooltip),"class"in a&&t(1,s=a.class)},[l,s,o,r]}class Pu extends Se{constructor(e){super(),we(this,e,b3,g3,ke,{tooltip:0,class:1})}}const k3=n=>({}),vc=n=>({}),y3=n=>({}),wc=n=>({});function v3(n){let e,t,i,l,s,o,r,a;const u=n[11].before,f=Lt(u,n,n[10],wc),c=n[11].default,d=Lt(c,n,n[10],null),m=n[11].after,h=Lt(m,n,n[10],vc);return{c(){e=b("div"),f&&f.c(),t=C(),i=b("div"),d&&d.c(),s=C(),h&&h.c(),p(i,"class",l="scroller "+n[0]+" "+n[3]+" svelte-3a0gfs"),p(e,"class","scroller-wrapper svelte-3a0gfs")},m(g,_){v(g,e,_),f&&f.m(e,null),w(e,t),w(e,i),d&&d.m(i,null),n[12](i),w(e,s),h&&h.m(e,null),o=!0,r||(a=[W(window,"resize",n[1]),W(i,"scroll",n[1])],r=!0)},p(g,[_]){f&&f.p&&(!o||_&1024)&&Pt(f,u,g,g[10],o?At(u,g[10],_,y3):Nt(g[10]),wc),d&&d.p&&(!o||_&1024)&&Pt(d,c,g,g[10],o?At(c,g[10],_,null):Nt(g[10]),null),(!o||_&9&&l!==(l="scroller "+g[0]+" "+g[3]+" svelte-3a0gfs"))&&p(i,"class",l),h&&h.p&&(!o||_&1024)&&Pt(h,m,g,g[10],o?At(m,g[10],_,k3):Nt(g[10]),vc)},i(g){o||(M(f,g),M(d,g),M(h,g),o=!0)},o(g){D(f,g),D(d,g),D(h,g),o=!1},d(g){g&&y(e),f&&f.d(g),d&&d.d(g),n[12](null),h&&h.d(g),r=!1,Ie(a)}}}function w3(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=kt();let{class:o=""}=e,{vThreshold:r=0}=e,{hThreshold:a=0}=e,{dispatchOnNoScroll:u=!0}=e,f=null,c="",d=null,m,h,g,_,k;function S(){f&&t(2,f.scrollTop=0,f)}function $(){f&&t(2,f.scrollLeft=0,f)}function T(){f&&(t(3,c=""),g=f.clientWidth+2,_=f.clientHeight+2,m=f.scrollWidth-g,h=f.scrollHeight-_,h>0?(t(3,c+=" v-scroll"),r>=_&&t(4,r=0),f.scrollTop-r<=0&&(t(3,c+=" v-scroll-start"),s("vScrollStart")),f.scrollTop+r>=h&&(t(3,c+=" v-scroll-end"),s("vScrollEnd"))):u&&s("vScrollEnd"),m>0?(t(3,c+=" h-scroll"),a>=g&&t(5,a=0),f.scrollLeft-a<=0&&(t(3,c+=" h-scroll-start"),s("hScrollStart")),f.scrollLeft+a>=m&&(t(3,c+=" h-scroll-end"),s("hScrollEnd"))):u&&s("hScrollEnd"))}function O(){d||(d=setTimeout(()=>{T(),d=null},150))}Xt(()=>(O(),k=new MutationObserver(O),k.observe(f,{attributeFilter:["width","height"],childList:!0,subtree:!0}),()=>{k==null||k.disconnect(),clearTimeout(d)}));function E(L){ie[L?"unshift":"push"](()=>{f=L,t(2,f)})}return n.$$set=L=>{"class"in L&&t(0,o=L.class),"vThreshold"in L&&t(4,r=L.vThreshold),"hThreshold"in L&&t(5,a=L.hThreshold),"dispatchOnNoScroll"in L&&t(6,u=L.dispatchOnNoScroll),"$$scope"in L&&t(10,l=L.$$scope)},[o,O,f,c,r,a,u,S,$,T,l,i,E]}class Nu extends Se{constructor(e){super(),we(this,e,w3,v3,ke,{class:0,vThreshold:4,hThreshold:5,dispatchOnNoScroll:6,resetVerticalScroll:7,resetHorizontalScroll:8,refresh:9,throttleRefresh:1})}get resetVerticalScroll(){return this.$$.ctx[7]}get resetHorizontalScroll(){return this.$$.ctx[8]}get refresh(){return this.$$.ctx[9]}get throttleRefresh(){return this.$$.ctx[1]}}function S3(n){let e,t,i,l,s;const o=n[6].default,r=Lt(o,n,n[5],null);return{c(){e=b("th"),r&&r.c(),p(e,"tabindex","0"),p(e,"title",n[2]),p(e,"class",t="col-sort "+n[1]),ee(e,"col-sort-disabled",n[3]),ee(e,"sort-active",n[0]==="-"+n[2]||n[0]==="+"+n[2]),ee(e,"sort-desc",n[0]==="-"+n[2]),ee(e,"sort-asc",n[0]==="+"+n[2])},m(a,u){v(a,e,u),r&&r.m(e,null),i=!0,l||(s=[W(e,"click",n[7]),W(e,"keydown",n[8])],l=!0)},p(a,[u]){r&&r.p&&(!i||u&32)&&Pt(r,o,a,a[5],i?At(o,a[5],u,null):Nt(a[5]),null),(!i||u&4)&&p(e,"title",a[2]),(!i||u&2&&t!==(t="col-sort "+a[1]))&&p(e,"class",t),(!i||u&10)&&ee(e,"col-sort-disabled",a[3]),(!i||u&7)&&ee(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),(!i||u&7)&&ee(e,"sort-desc",a[0]==="-"+a[2]),(!i||u&7)&&ee(e,"sort-asc",a[0]==="+"+a[2])},i(a){i||(M(r,a),i=!0)},o(a){D(r,a),i=!1},d(a){a&&y(e),r&&r.d(a),l=!1,Ie(s)}}}function T3(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,{name:o}=e,{sort:r=""}=e,{disable:a=!1}=e;function u(){a||("-"+o===r?t(0,r="+"+o):t(0,r="-"+o))}const f=()=>u(),c=d=>{(d.code==="Enter"||d.code==="Space")&&(d.preventDefault(),u())};return n.$$set=d=>{"class"in d&&t(1,s=d.class),"name"in d&&t(2,o=d.name),"sort"in d&&t(0,r=d.sort),"disable"in d&&t(3,a=d.disable),"$$scope"in d&&t(5,l=d.$$scope)},[r,s,o,a,u,l,i,f,c]}class ir extends Se{constructor(e){super(),we(this,e,T3,S3,ke,{class:1,name:2,sort:0,disable:3})}}function $3(n){let e,t=n[0].replace("Z"," UTC")+"",i,l,s;return{c(){e=b("span"),i=B(t),p(e,"class","txt-nowrap")},m(o,r){v(o,e,r),w(e,i),l||(s=Oe(qe.call(null,e,n[1])),l=!0)},p(o,[r]){r&1&&t!==(t=o[0].replace("Z"," UTC")+"")&&oe(i,t)},i:te,o:te,d(o){o&&y(e),l=!1,s()}}}function C3(n,e,t){let{date:i}=e;const l={get text(){return V.formatToLocalDate(i,"yyyy-MM-dd HH:mm:ss.SSS")+" Local"}};return n.$$set=s=>{"date"in s&&t(0,i=s.date)},[i,l]}class _k extends Se{constructor(e){super(),we(this,e,C3,$3,ke,{date:0})}}function O3(n){let e,t,i=(n[1]||"UNKN")+"",l,s,o,r,a;return{c(){e=b("div"),t=b("span"),l=B(i),s=B(" ("),o=B(n[0]),r=B(")"),p(t,"class","txt"),p(e,"class",a="label log-level-label level-"+n[0]+" svelte-ha6hme")},m(u,f){v(u,e,f),w(e,t),w(t,l),w(t,s),w(t,o),w(t,r)},p(u,[f]){f&2&&i!==(i=(u[1]||"UNKN")+"")&&oe(l,i),f&1&&oe(o,u[0]),f&1&&a!==(a="label log-level-label level-"+u[0]+" svelte-ha6hme")&&p(e,"class",a)},i:te,o:te,d(u){u&&y(e)}}}function M3(n,e,t){let i,{level:l}=e;return n.$$set=s=>{"level"in s&&t(0,l=s.level)},n.$$.update=()=>{var s;n.$$.dirty&1&&t(1,i=(s=x0.find(o=>o.level==l))==null?void 0:s.label)},[l,i]}class gk extends Se{constructor(e){super(),we(this,e,M3,O3,ke,{level:0})}}function Sc(n,e,t){var o;const i=n.slice();i[32]=e[t];const l=((o=i[32].data)==null?void 0:o.type)=="request";i[33]=l;const s=j3(i[32]);return i[34]=s,i}function Tc(n,e,t){const i=n.slice();return i[37]=e[t],i}function E3(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),t=b("input"),l=C(),s=b("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[3].length,t.checked=n[8],p(s,"for","checkbox_0"),p(e,"class","form-field")},m(a,u){v(a,e,u),w(e,t),w(e,l),w(e,s),o||(r=W(t,"change",n[19]),o=!0)},p(a,u){u[0]&8&&i!==(i=!a[3].length)&&(t.disabled=i),u[0]&256&&(t.checked=a[8])},d(a){a&&y(e),o=!1,r()}}}function D3(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function I3(n){let e;return{c(){e=b("div"),e.innerHTML=' level',p(e,"class","col-header-content")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function L3(n){let e;return{c(){e=b("div"),e.innerHTML=' message',p(e,"class","col-header-content")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function A3(n){let e;return{c(){e=b("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function $c(n){let e;function t(s,o){return s[7]?N3:P3}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),v(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&y(e),l.d(s)}}}function P3(n){var r;let e,t,i,l,s,o=((r=n[0])==null?void 0:r.length)&&Cc(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No logs found.",l=C(),o&&o.c(),s=C(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){v(a,e,u),w(e,t),w(t,i),w(t,l),o&&o.m(t,null),w(e,s)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=Cc(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&y(e),o&&o.d()}}}function N3(n){let e;return{c(){e=b("tr"),e.innerHTML=' '},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function Cc(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(l,s){v(l,e,s),t||(i=W(e,"click",n[26]),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function Oc(n){let e,t=de(n[34]),i=[];for(let l=0;l',P=C(),p(s,"type","checkbox"),p(s,"id",o="checkbox_"+e[32].id),s.checked=r=e[4][e[32].id],p(u,"for",f="checkbox_"+e[32].id),p(l,"class","form-field"),p(i,"class","bulk-select-col min-width"),p(d,"class","col-type-text col-field-level min-width svelte-91v05h"),p(k,"class","txt-ellipsis"),p(_,"class","flex flex-gap-10"),p(g,"class","col-type-text col-field-message svelte-91v05h"),p(E,"class","col-type-date col-field-created"),p(A,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(Z,G){v(Z,t,G),w(t,i),w(i,l),w(l,s),w(l,a),w(l,u),w(t,c),w(t,d),q(m,d,null),w(t,h),w(t,g),w(g,_),w(_,k),w(k,$),w(g,T),U&&U.m(g,null),w(t,O),w(t,E),q(L,E,null),w(t,I),w(t,A),w(t,P),N=!0,R||(z=[W(s,"change",F),W(l,"click",On(e[18])),W(t,"click",J),W(t,"keydown",Y)],R=!0)},p(Z,G){e=Z,(!N||G[0]&8&&o!==(o="checkbox_"+e[32].id))&&p(s,"id",o),(!N||G[0]&24&&r!==(r=e[4][e[32].id]))&&(s.checked=r),(!N||G[0]&8&&f!==(f="checkbox_"+e[32].id))&&p(u,"for",f);const pe={};G[0]&8&&(pe.level=e[32].level),m.$set(pe),(!N||G[0]&8)&&S!==(S=e[32].message+"")&&oe($,S),e[34].length?U?U.p(e,G):(U=Oc(e),U.c(),U.m(g,null)):U&&(U.d(1),U=null);const ce={};G[0]&8&&(ce.date=e[32].created),L.$set(ce)},i(Z){N||(M(m.$$.fragment,Z),M(L.$$.fragment,Z),N=!0)},o(Z){D(m.$$.fragment,Z),D(L.$$.fragment,Z),N=!1},d(Z){Z&&y(t),H(m),U&&U.d(),H(L),R=!1,Ie(z)}}}function q3(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S=[],$=new Map,T;function O(Y,Z){return Y[7]?D3:E3}let E=O(n),L=E(n);function I(Y){n[20](Y)}let A={disable:!0,class:"col-field-level min-width",name:"level",$$slots:{default:[I3]},$$scope:{ctx:n}};n[1]!==void 0&&(A.sort=n[1]),o=new ir({props:A}),ie.push(()=>be(o,"sort",I));function P(Y){n[21](Y)}let N={disable:!0,class:"col-type-text col-field-message",name:"data",$$slots:{default:[L3]},$$scope:{ctx:n}};n[1]!==void 0&&(N.sort=n[1]),u=new ir({props:N}),ie.push(()=>be(u,"sort",P));function R(Y){n[22](Y)}let z={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[A3]},$$scope:{ctx:n}};n[1]!==void 0&&(z.sort=n[1]),d=new ir({props:z}),ie.push(()=>be(d,"sort",R));let F=de(n[3]);const U=Y=>Y[32].id;for(let Y=0;Yr=!1)),o.$set(G);const pe={};Z[1]&512&&(pe.$$scope={dirty:Z,ctx:Y}),!f&&Z[0]&2&&(f=!0,pe.sort=Y[1],$e(()=>f=!1)),u.$set(pe);const ce={};Z[1]&512&&(ce.$$scope={dirty:Z,ctx:Y}),!m&&Z[0]&2&&(m=!0,ce.sort=Y[1],$e(()=>m=!1)),d.$set(ce),Z[0]&9369&&(F=de(Y[3]),re(),S=vt(S,Z,U,1,Y,F,$,k,Bt,Ec,null,Sc),ae(),!F.length&&J?J.p(Y,Z):F.length?J&&(J.d(1),J=null):(J=$c(Y),J.c(),J.m(k,null))),(!T||Z[0]&128)&&ee(e,"table-loading",Y[7])},i(Y){if(!T){M(o.$$.fragment,Y),M(u.$$.fragment,Y),M(d.$$.fragment,Y);for(let Z=0;ZLoad more',p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),ee(t,"btn-loading",n[7]),ee(t,"btn-disabled",n[7]),p(e,"class","block txt-center m-t-sm")},m(s,o){v(s,e,o),w(e,t),i||(l=W(t,"click",n[27]),i=!0)},p(s,o){o[0]&128&&ee(t,"btn-loading",s[7]),o[0]&128&&ee(t,"btn-disabled",s[7])},d(s){s&&y(e),i=!1,l()}}}function Ic(n){let e,t,i,l,s,o,r=n[5]===1?"log":"logs",a,u,f,c,d,m,h,g,_,k,S;return{c(){e=b("div"),t=b("div"),i=B("Selected "),l=b("strong"),s=B(n[5]),o=C(),a=B(r),u=C(),f=b("button"),f.innerHTML='Reset',c=C(),d=b("div"),m=C(),h=b("button"),h.innerHTML='Download as JSON',p(t,"class","txt"),p(f,"type","button"),p(f,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),p(d,"class","flex-fill"),p(h,"type","button"),p(h,"class","btn btn-sm"),p(e,"class","bulkbar svelte-91v05h")},m($,T){v($,e,T),w(e,t),w(t,i),w(t,l),w(l,s),w(t,o),w(t,a),w(e,u),w(e,f),w(e,c),w(e,d),w(e,m),w(e,h),_=!0,k||(S=[W(f,"click",n[28]),W(h,"click",n[14])],k=!0)},p($,T){(!_||T[0]&32)&&oe(s,$[5]),(!_||T[0]&32)&&r!==(r=$[5]===1?"log":"logs")&&oe(a,r)},i($){_||($&&tt(()=>{_&&(g||(g=He(e,qn,{duration:150,y:5},!0)),g.run(1))}),_=!0)},o($){$&&(g||(g=He(e,qn,{duration:150,y:5},!1)),g.run(0)),_=!1},d($){$&&y(e),$&&g&&g.end(),k=!1,Ie(S)}}}function H3(n){let e,t,i,l,s;e=new Nu({props:{class:"table-wrapper",$$slots:{default:[q3]},$$scope:{ctx:n}}});let o=n[3].length&&n[9]&&Dc(n),r=n[5]&&Ic(n);return{c(){j(e.$$.fragment),t=C(),o&&o.c(),i=C(),r&&r.c(),l=ye()},m(a,u){q(e,a,u),v(a,t,u),o&&o.m(a,u),v(a,i,u),r&&r.m(a,u),v(a,l,u),s=!0},p(a,u){const f={};u[0]&411|u[1]&512&&(f.$$scope={dirty:u,ctx:a}),e.$set(f),a[3].length&&a[9]?o?o.p(a,u):(o=Dc(a),o.c(),o.m(i.parentNode,i)):o&&(o.d(1),o=null),a[5]?r?(r.p(a,u),u[0]&32&&M(r,1)):(r=Ic(a),r.c(),M(r,1),r.m(l.parentNode,l)):r&&(re(),D(r,1,1,()=>{r=null}),ae())},i(a){s||(M(e.$$.fragment,a),M(r),s=!0)},o(a){D(e.$$.fragment,a),D(r),s=!1},d(a){a&&(y(t),y(i),y(l)),H(e,a),o&&o.d(a),r&&r.d(a)}}}const Lc=50,aa=/[-:\. ]/gi;function j3(n){let e=[];if(!n.data)return e;if(n.data.type=="request"){const t=["status","execTime","auth","authId","userIP"];for(let i of t)typeof n.data[i]<"u"&&e.push({key:i});n.data.referer&&!n.data.referer.includes(window.location.host)&&e.push({key:"referer"})}else{const t=Object.keys(n.data);for(const i of t)i!="error"&&i!="details"&&e.length<6&&e.push({key:i})}return n.data.error&&e.push({key:"error",label:"label-danger"}),n.data.details&&e.push({key:"details",label:"label-warning"}),e}function z3(n,e,t){let i,l,s;const o=kt();let{filter:r=""}=e,{presets:a=""}=e,{zoom:u={}}=e,{sort:f="-@rowid"}=e,c=[],d=1,m=0,h=!1,g=0,_={};async function k(G=1,pe=!0){t(7,h=!0);const ce=[a,V.normalizeLogsFilter(r)];return u.min&&u.max&&ce.push(`created >= "${u.min}" && created <= "${u.max}"`),_e.logs.getList(G,Lc,{sort:f,skipTotal:1,filter:ce.filter(Boolean).map(ue=>"("+ue+")").join("&&")}).then(async ue=>{var Ke;G<=1&&S();const Te=V.toArray(ue.items);if(t(7,h=!1),t(6,d=ue.page),t(17,m=((Ke=ue.items)==null?void 0:Ke.length)||0),o("load",c.concat(Te)),pe){const Je=++g;for(;Te.length&&g==Je;){const ft=Te.splice(0,10);for(let et of ft)V.pushOrReplaceByKey(c,et);t(3,c),await V.yieldToMain()}}else{for(let Je of Te)V.pushOrReplaceByKey(c,Je);t(3,c)}}).catch(ue=>{ue!=null&&ue.isAbort||(t(7,h=!1),console.warn(ue),S(),_e.error(ue,!ce||(ue==null?void 0:ue.status)!=400))})}function S(){t(3,c=[]),t(4,_={}),t(6,d=1),t(17,m=0)}function $(){s?T():O()}function T(){t(4,_={})}function O(){for(const G of c)t(4,_[G.id]=G,_);t(4,_)}function E(G){_[G.id]?delete _[G.id]:t(4,_[G.id]=G,_),t(4,_)}function L(){const G=Object.values(_).sort((ue,Te)=>ue.createdTe.created?-1:0);if(!G.length)return;if(G.length==1)return V.downloadJson(G[0],"log_"+G[0].created.replaceAll(aa,"")+".json");const pe=G[0].created.replaceAll(aa,""),ce=G[G.length-1].created.replaceAll(aa,"");return V.downloadJson(G,`${G.length}_logs_${ce}_to_${pe}.json`)}function I(G){Pe.call(this,n,G)}const A=()=>$();function P(G){f=G,t(1,f)}function N(G){f=G,t(1,f)}function R(G){f=G,t(1,f)}const z=G=>E(G),F=G=>o("select",G),U=(G,pe)=>{pe.code==="Enter"&&(pe.preventDefault(),o("select",G))},J=()=>t(0,r=""),Y=()=>k(d+1),Z=()=>T();return n.$$set=G=>{"filter"in G&&t(0,r=G.filter),"presets"in G&&t(15,a=G.presets),"zoom"in G&&t(16,u=G.zoom),"sort"in G&&t(1,f=G.sort)},n.$$.update=()=>{n.$$.dirty[0]&98307&&(typeof f<"u"||typeof r<"u"||typeof a<"u"||typeof u<"u")&&(S(),k(1)),n.$$.dirty[0]&131072&&t(9,i=m>=Lc),n.$$.dirty[0]&16&&t(5,l=Object.keys(_).length),n.$$.dirty[0]&40&&t(8,s=c.length&&l===c.length)},[r,f,k,c,_,l,d,h,s,i,o,$,T,E,L,a,u,m,I,A,P,N,R,z,F,U,J,Y,Z]}class U3 extends Se{constructor(e){super(),we(this,e,z3,H3,ke,{filter:0,presets:15,zoom:16,sort:1,load:2},null,[-1,-1])}get load(){return this.$$.ctx[2]}}/*! * @kurkle/color v0.3.4 * https://github.com/kurkle/color#readme * (c) 2024 Jukka Kurkela @@ -46,15 +46,15 @@ var Dy=Object.defineProperty;var Iy=(n,e,t)=>e in n?Dy(n,e,{enumerable:!0,config * (c) 2016-2024 chartjs-plugin-zoom Contributors * Released under the MIT License */const eo=n=>n&&n.enabled&&n.modifierKey,iy=(n,e)=>n&&e[n+"Key"],Xu=(n,e)=>n&&!e[n+"Key"];function rl(n,e,t){return n===void 0?!0:typeof n=="string"?n.indexOf(e)!==-1:typeof n=="function"?n({chart:t}).indexOf(e)!==-1:!1}function ya(n,e){return typeof n=="function"&&(n=n({chart:e})),typeof n=="string"?{x:n.indexOf("x")!==-1,y:n.indexOf("y")!==-1}:{x:!1,y:!1}}function X$(n,e){let t;return function(){return clearTimeout(t),t=setTimeout(n,e),e}}function Q$({x:n,y:e},t){const i=t.scales,l=Object.keys(i);for(let s=0;s=o.top&&e<=o.bottom&&n>=o.left&&n<=o.right)return o}return null}function ly(n,e,t){const{mode:i="xy",scaleMode:l,overScaleMode:s}=n||{},o=Q$(e,t),r=ya(i,t),a=ya(l,t);if(s){const f=ya(s,t);for(const c of["x","y"])f[c]&&(a[c]=r[c],r[c]=!1)}if(o&&a[o.axis])return[o];const u=[];return _t(t.scales,function(f){r[f.axis]&&u.push(f)}),u}const lu=new WeakMap;function Vt(n){let e=lu.get(n);return e||(e={originalScaleLimits:{},updatedScaleLimits:{},handlers:{},panDelta:{},dragging:!1,panning:!1},lu.set(n,e)),e}function x$(n){lu.delete(n)}function sy(n,e,t,i){const l=Math.max(0,Math.min(1,(n-e)/t||0)),s=1-l;return{min:i*l,max:i*s}}function oy(n,e){const t=n.isHorizontal()?e.x:e.y;return n.getValueForPixel(t)}function ry(n,e,t){const i=n.max-n.min,l=i*(e-1),s=oy(n,t);return sy(s,n.min,i,l)}function eC(n,e,t){const i=oy(n,t);if(i===void 0)return{min:n.min,max:n.max};const l=Math.log10(n.min),s=Math.log10(n.max),o=Math.log10(i),r=s-l,a=r*(e-1),u=sy(o,l,r,a);return{min:Math.pow(10,l+u.min),max:Math.pow(10,s-u.max)}}function tC(n,e){return e&&(e[n.id]||e[n.axis])||{}}function Jd(n,e,t,i,l){let s=t[i];if(s==="original"){const o=n.originalScaleLimits[e.id][i];s=Mt(o.options,o.scale)}return Mt(s,l)}function nC(n,e,t){const i=n.getValueForPixel(e),l=n.getValueForPixel(t);return{min:Math.min(i,l),max:Math.max(i,l)}}function iC(n,{min:e,max:t,minLimit:i,maxLimit:l},s){const o=(n-t+e)/2;e-=o,t+=o;const r=s.min.options??s.min.scale,a=s.max.options??s.max.scale,u=n/1e6;return Ol(e,r,u)&&(e=r),Ol(t,a,u)&&(t=a),el&&(t=l,e=Math.max(l-n,i)),{min:e,max:t}}function Nl(n,{min:e,max:t},i,l=!1){const s=Vt(n.chart),{options:o}=n,r=tC(n,i),{minRange:a=0}=r,u=Jd(s,n,r,"min",-1/0),f=Jd(s,n,r,"max",1/0);if(l==="pan"&&(ef))return!0;const c=n.max-n.min,d=l?Math.max(t-e,a):c;if(l&&d===a&&c<=a)return!0;const m=iC(d,{min:e,max:t,minLimit:u,maxLimit:f},s.originalScaleLimits[n.id]);return o.min=m.min,o.max=m.max,s.updatedScaleLimits[n.id]=m,n.parse(m.min)!==n.min||n.parse(m.max)!==n.max}function lC(n,e,t,i){const l=ry(n,e,t),s={min:n.min+l.min,max:n.max-l.max};return Nl(n,s,i,!0)}function sC(n,e,t,i){const l=eC(n,e,t);return Nl(n,l,i,!0)}function oC(n,e,t,i){Nl(n,nC(n,e,t),i,!0)}const Zd=n=>n===0||isNaN(n)?0:n<0?Math.min(Math.round(n),-1):Math.max(Math.round(n),1);function rC(n){const t=n.getLabels().length-1;n.min>0&&(n.min-=1),n.maxa&&(s=Math.max(0,s-u),o=r===1?s:s+r,f=s===0),Nl(n,{min:s,max:o},t)||f}const cC={second:500,minute:30*1e3,hour:30*60*1e3,day:12*60*60*1e3,week:3.5*24*60*60*1e3,month:15*24*60*60*1e3,quarter:60*24*60*60*1e3,year:182*24*60*60*1e3};function ay(n,e,t,i=!1){const{min:l,max:s,options:o}=n,r=o.time&&o.time.round,a=cC[r]||0,u=n.getValueForPixel(n.getPixelForValue(l+a)-e),f=n.getValueForPixel(n.getPixelForValue(s+a)-e);return isNaN(u)||isNaN(f)?!0:Nl(n,{min:u,max:f},t,i?"pan":!1)}function Gd(n,e,t){return ay(n,e,t,!0)}const su={category:aC,default:lC,logarithmic:sC},ou={default:oC},ru={category:fC,default:ay,logarithmic:Gd,timeseries:Gd};function dC(n,e,t){const{id:i,options:{min:l,max:s}}=n;if(!e[i]||!t[i])return!0;const o=t[i];return o.min!==l||o.max!==s}function Xd(n,e){_t(n,(t,i)=>{e[i]||delete n[i]})}function ds(n,e){const{scales:t}=n,{originalScaleLimits:i,updatedScaleLimits:l}=e;return _t(t,function(s){dC(s,i,l)&&(i[s.id]={min:{scale:s.min,options:s.options.min},max:{scale:s.max,options:s.options.max}})}),Xd(i,t),Xd(l,t),i}function Qd(n,e,t,i){const l=su[n.type]||su.default;ut(l,[n,e,t,i])}function xd(n,e,t,i){const l=ou[n.type]||ou.default;ut(l,[n,e,t,i])}function pC(n){const e=n.chartArea;return{x:(e.left+e.right)/2,y:(e.top+e.bottom)/2}}function Qu(n,e,t="none",i="api"){const{x:l=1,y:s=1,focalPoint:o=pC(n)}=typeof e=="number"?{x:e,y:e}:e,r=Vt(n),{options:{limits:a,zoom:u}}=r;ds(n,r);const f=l!==1,c=s!==1,d=ly(u,o,n);_t(d||n.scales,function(m){m.isHorizontal()&&f?Qd(m,l,o,a):!m.isHorizontal()&&c&&Qd(m,s,o,a)}),n.update(t),ut(u.onZoom,[{chart:n,trigger:i}])}function uy(n,e,t,i="none",l="api"){const s=Vt(n),{options:{limits:o,zoom:r}}=s,{mode:a="xy"}=r;ds(n,s);const u=rl(a,"x",n),f=rl(a,"y",n);_t(n.scales,function(c){c.isHorizontal()&&u?xd(c,e.x,t.x,o):!c.isHorizontal()&&f&&xd(c,e.y,t.y,o)}),n.update(i),ut(r.onZoom,[{chart:n,trigger:l}])}function mC(n,e,t,i="none",l="api"){var r;const s=Vt(n);ds(n,s);const o=n.scales[e];Nl(o,t,void 0,!0),n.update(i),ut((r=s.options.zoom)==null?void 0:r.onZoom,[{chart:n,trigger:l}])}function hC(n,e="default"){const t=Vt(n),i=ds(n,t);_t(n.scales,function(l){const s=l.options;i[l.id]?(s.min=i[l.id].min.options,s.max=i[l.id].max.options):(delete s.min,delete s.max),delete t.updatedScaleLimits[l.id]}),n.update(e),ut(t.options.zoom.onZoomComplete,[{chart:n}])}function _C(n,e){const t=n.originalScaleLimits[e];if(!t)return;const{min:i,max:l}=t;return Mt(l.options,l.scale)-Mt(i.options,i.scale)}function gC(n){const e=Vt(n);let t=1,i=1;return _t(n.scales,function(l){const s=_C(e,l.id);if(s){const o=Math.round(s/(l.max-l.min)*100)/100;t=Math.min(t,o),i=Math.max(i,o)}}),t<1?t:i}function ep(n,e,t,i){const{panDelta:l}=i,s=l[n.id]||0;sl(s)===sl(e)&&(e+=s);const o=ru[n.type]||ru.default;ut(o,[n,e,t])?l[n.id]=0:l[n.id]=e}function fy(n,e,t,i="none"){const{x:l=0,y:s=0}=typeof e=="number"?{x:e,y:e}:e,o=Vt(n),{options:{pan:r,limits:a}}=o,{onPan:u}=r||{};ds(n,o);const f=l!==0,c=s!==0;_t(t||n.scales,function(d){d.isHorizontal()&&f?ep(d,l,a,o):!d.isHorizontal()&&c&&ep(d,s,a,o)}),n.update(i),ut(u,[{chart:n}])}function cy(n){const e=Vt(n);ds(n,e);const t={};for(const i of Object.keys(n.scales)){const{min:l,max:s}=e.originalScaleLimits[i]||{min:{},max:{}};t[i]={min:l.scale,max:s.scale}}return t}function bC(n){const e=Vt(n),t={};for(const i of Object.keys(n.scales))t[i]=e.updatedScaleLimits[i];return t}function kC(n){const e=cy(n);for(const t of Object.keys(n.scales)){const{min:i,max:l}=e[t];if(i!==void 0&&n.scales[t].min!==i||l!==void 0&&n.scales[t].max!==l)return!0}return!1}function tp(n){const e=Vt(n);return e.panning||e.dragging}const np=(n,e,t)=>Math.min(t,Math.max(e,n));function An(n,e){const{handlers:t}=Vt(n),i=t[e];i&&i.target&&(i.target.removeEventListener(e,i),delete t[e])}function Hs(n,e,t,i){const{handlers:l,options:s}=Vt(n),o=l[t];if(o&&o.target===e)return;An(n,t),l[t]=a=>i(n,a,s),l[t].target=e;const r=t==="wheel"?!1:void 0;e.addEventListener(t,l[t],{passive:r})}function yC(n,e){const t=Vt(n);t.dragStart&&(t.dragging=!0,t.dragEnd=e,n.update("none"))}function vC(n,e){const t=Vt(n);!t.dragStart||e.key!=="Escape"||(An(n,"keydown"),t.dragging=!1,t.dragStart=t.dragEnd=null,n.update("none"))}function au(n,e){if(n.target!==e.canvas){const t=e.canvas.getBoundingClientRect();return{x:n.clientX-t.left,y:n.clientY-t.top}}return yi(n,e)}function dy(n,e,t){const{onZoomStart:i,onZoomRejected:l}=t;if(i){const s=au(e,n);if(ut(i,[{chart:n,event:e,point:s}])===!1)return ut(l,[{chart:n,event:e}]),!1}}function wC(n,e){if(n.legend){const s=yi(e,n);if(ls(s,n.legend))return}const t=Vt(n),{pan:i,zoom:l={}}=t.options;if(e.button!==0||iy(eo(i),e)||Xu(eo(l.drag),e))return ut(l.onZoomRejected,[{chart:n,event:e}]);dy(n,e,l)!==!1&&(t.dragStart=e,Hs(n,n.canvas.ownerDocument,"mousemove",yC),Hs(n,window.document,"keydown",vC))}function SC({begin:n,end:e},t){let i=e.x-n.x,l=e.y-n.y;const s=Math.abs(i/l);s>t?i=Math.sign(i)*Math.abs(l*t):s=0?2-1/(1-s):1+s,r={x:o,y:o,focalPoint:{x:e.clientX-l.left,y:e.clientY-l.top}};Qu(n,r,"zoom","wheel"),ut(t,[{chart:n}])}function MC(n,e,t,i){t&&(Vt(n).handlers[e]=X$(()=>ut(t,[{chart:n}]),i))}function EC(n,e){const t=n.canvas,{wheel:i,drag:l,onZoomComplete:s}=e.zoom;i.enabled?(Hs(n,t,"wheel",OC),MC(n,"onZoomComplete",s,250)):An(n,"wheel"),l.enabled?(Hs(n,t,"mousedown",wC),Hs(n,t.ownerDocument,"mouseup",$C)):(An(n,"mousedown"),An(n,"mousemove"),An(n,"mouseup"),An(n,"keydown"))}function DC(n){An(n,"mousedown"),An(n,"mousemove"),An(n,"mouseup"),An(n,"wheel"),An(n,"click"),An(n,"keydown")}function IC(n,e){return function(t,i){const{pan:l,zoom:s={}}=e.options;if(!l||!l.enabled)return!1;const o=i&&i.srcEvent;return o&&!e.panning&&i.pointerType==="mouse"&&(Xu(eo(l),o)||iy(eo(s.drag),o))?(ut(l.onPanRejected,[{chart:n,event:i}]),!1):!0}}function LC(n,e){const t=Math.abs(n.clientX-e.clientX),i=Math.abs(n.clientY-e.clientY),l=t/i;let s,o;return l>.3&&l<1.7?s=o=!0:t>i?s=!0:o=!0,{x:s,y:o}}function my(n,e,t){if(e.scale){const{center:i,pointers:l}=t,s=1/e.scale*t.scale,o=t.target.getBoundingClientRect(),r=LC(l[0],l[1]),a=e.options.zoom.mode,u={x:r.x&&rl(a,"x",n)?s:1,y:r.y&&rl(a,"y",n)?s:1,focalPoint:{x:i.x-o.left,y:i.y-o.top}};Qu(n,u,"zoom","pinch"),e.scale=t.scale}}function AC(n,e,t){if(e.options.zoom.pinch.enabled){const i=yi(t,n);ut(e.options.zoom.onZoomStart,[{chart:n,event:t,point:i}])===!1?(e.scale=null,ut(e.options.zoom.onZoomRejected,[{chart:n,event:t}])):e.scale=1}}function PC(n,e,t){e.scale&&(my(n,e,t),e.scale=null,ut(e.options.zoom.onZoomComplete,[{chart:n}]))}function hy(n,e,t){const i=e.delta;i&&(e.panning=!0,fy(n,{x:t.deltaX-i.x,y:t.deltaY-i.y},e.panScales),e.delta={x:t.deltaX,y:t.deltaY})}function NC(n,e,t){const{enabled:i,onPanStart:l,onPanRejected:s}=e.options.pan;if(!i)return;const o=t.target.getBoundingClientRect(),r={x:t.center.x-o.left,y:t.center.y-o.top};if(ut(l,[{chart:n,event:t,point:r}])===!1)return ut(s,[{chart:n,event:t}]);e.panScales=ly(e.options.pan,r,n),e.delta={x:0,y:0},hy(n,e,t)}function RC(n,e){e.delta=null,e.panning&&(e.panning=!1,e.filterNextClick=!0,ut(e.options.pan.onPanComplete,[{chart:n}]))}const uu=new WeakMap;function lp(n,e){const t=Vt(n),i=n.canvas,{pan:l,zoom:s}=e,o=new qs.Manager(i);s&&s.pinch.enabled&&(o.add(new qs.Pinch),o.on("pinchstart",r=>AC(n,t,r)),o.on("pinch",r=>my(n,t,r)),o.on("pinchend",r=>PC(n,t,r))),l&&l.enabled&&(o.add(new qs.Pan({threshold:l.threshold,enable:IC(n,t)})),o.on("panstart",r=>NC(n,t,r)),o.on("panmove",r=>hy(n,t,r)),o.on("panend",()=>RC(n,t))),uu.set(n,o)}function sp(n){const e=uu.get(n);e&&(e.remove("pinchstart"),e.remove("pinch"),e.remove("pinchend"),e.remove("panstart"),e.remove("pan"),e.remove("panend"),e.destroy(),uu.delete(n))}function FC(n,e){var o,r,a,u;const{pan:t,zoom:i}=n,{pan:l,zoom:s}=e;return((r=(o=i==null?void 0:i.zoom)==null?void 0:o.pinch)==null?void 0:r.enabled)!==((u=(a=s==null?void 0:s.zoom)==null?void 0:a.pinch)==null?void 0:u.enabled)||(t==null?void 0:t.enabled)!==(l==null?void 0:l.enabled)||(t==null?void 0:t.threshold)!==(l==null?void 0:l.threshold)}var qC="2.2.0";function Yo(n,e,t){const i=t.zoom.drag,{dragStart:l,dragEnd:s}=Vt(n);if(i.drawTime!==e||!s)return;const{left:o,top:r,width:a,height:u}=py(n,t.zoom.mode,{dragStart:l,dragEnd:s},i.maintainAspectRatio),f=n.ctx;f.save(),f.beginPath(),f.fillStyle=i.backgroundColor||"rgba(225,225,225,0.3)",f.fillRect(o,r,a,u),i.borderWidth>0&&(f.lineWidth=i.borderWidth,f.strokeStyle=i.borderColor||"rgba(225,225,225)",f.strokeRect(o,r,a,u)),f.restore()}var HC={id:"zoom",version:qC,defaults:{pan:{enabled:!1,mode:"xy",threshold:10,modifierKey:null},zoom:{wheel:{enabled:!1,speed:.1,modifierKey:null},drag:{enabled:!1,drawTime:"beforeDatasetsDraw",modifierKey:null},pinch:{enabled:!1},mode:"xy"}},start:function(n,e,t){const i=Vt(n);i.options=t,Object.prototype.hasOwnProperty.call(t.zoom,"enabled")&&console.warn("The option `zoom.enabled` is no longer supported. Please use `zoom.wheel.enabled`, `zoom.drag.enabled`, or `zoom.pinch.enabled`."),(Object.prototype.hasOwnProperty.call(t.zoom,"overScaleMode")||Object.prototype.hasOwnProperty.call(t.pan,"overScaleMode"))&&console.warn("The option `overScaleMode` is deprecated. Please use `scaleMode` instead (and update `mode` as desired)."),qs&&lp(n,t),n.pan=(l,s,o)=>fy(n,l,s,o),n.zoom=(l,s)=>Qu(n,l,s),n.zoomRect=(l,s,o)=>uy(n,l,s,o),n.zoomScale=(l,s,o)=>mC(n,l,s,o),n.resetZoom=l=>hC(n,l),n.getZoomLevel=()=>gC(n),n.getInitialScaleBounds=()=>cy(n),n.getZoomedScaleBounds=()=>bC(n),n.isZoomedOrPanned=()=>kC(n),n.isZoomingOrPanning=()=>tp(n)},beforeEvent(n,{event:e}){if(tp(n))return!1;if(e.type==="click"||e.type==="mouseup"){const t=Vt(n);if(t.filterNextClick)return t.filterNextClick=!1,!1}},beforeUpdate:function(n,e,t){const i=Vt(n),l=i.options;i.options=t,FC(l,t)&&(sp(n),lp(n,t)),EC(n,t)},beforeDatasetsDraw(n,e,t){Yo(n,"beforeDatasetsDraw",t)},afterDatasetsDraw(n,e,t){Yo(n,"afterDatasetsDraw",t)},beforeDraw(n,e,t){Yo(n,"beforeDraw",t)},afterDraw(n,e,t){Yo(n,"afterDraw",t)},stop:function(n){DC(n),qs&&sp(n),x$(n)},panFunctions:ru,zoomFunctions:su,zoomRectFunctions:ou};function op(n){let e,t,i;return{c(){e=b("div"),p(e,"class","chart-loader loader svelte-kfnurg")},m(l,s){v(l,e,s),i=!0},i(l){i||(l&&tt(()=>{i&&(t||(t=He(e,$t,{duration:150},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=He(e,$t,{duration:150},!1)),t.run(0)),i=!1},d(l){l&&y(e),l&&t&&t.end()}}}function rp(n){let e,t,i;return{c(){e=b("button"),e.textContent="Reset zoom",p(e,"type","button"),p(e,"class","btn btn-secondary btn-sm btn-chart-zoom svelte-kfnurg")},m(l,s){v(l,e,s),t||(i=W(e,"click",n[4]),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function jC(n){let e,t,i,l,s,o=n[1]==1?"log":"logs",r,a,u,f,c,d,m,h=n[2]&&op(),g=n[3]&&rp(n);return{c(){e=b("div"),t=b("div"),i=B("Found "),l=B(n[1]),s=C(),r=B(o),a=C(),h&&h.c(),u=C(),f=b("canvas"),c=C(),g&&g.c(),p(t,"class","total-logs entrance-right svelte-kfnurg"),ee(t,"hidden",n[2]),p(f,"class","chart-canvas svelte-kfnurg"),p(e,"class","chart-wrapper svelte-kfnurg"),ee(e,"loading",n[2])},m(_,k){v(_,e,k),w(e,t),w(t,i),w(t,l),w(t,s),w(t,r),w(e,a),h&&h.m(e,null),w(e,u),w(e,f),n[11](f),w(e,c),g&&g.m(e,null),d||(m=W(f,"dblclick",n[4]),d=!0)},p(_,[k]){k&2&&oe(l,_[1]),k&2&&o!==(o=_[1]==1?"log":"logs")&&oe(r,o),k&4&&ee(t,"hidden",_[2]),_[2]?h?k&4&&M(h,1):(h=op(),h.c(),M(h,1),h.m(e,u)):h&&(re(),D(h,1,1,()=>{h=null}),ae()),_[3]?g?g.p(_,k):(g=rp(_),g.c(),g.m(e,null)):g&&(g.d(1),g=null),k&4&&ee(e,"loading",_[2])},i(_){M(h)},o(_){D(h)},d(_){_&&y(e),h&&h.d(),n[11](null),g&&g.d(),d=!1,m()}}}function zC(n,e,t){let{filter:i=""}=e,{zoom:l={}}=e,{presets:s=""}=e,o,r,a=[],u=0,f=!1,c=!1;async function d(){t(2,f=!0);const _=[s,V.normalizeLogsFilter(i)].filter(Boolean).map(k=>"("+k+")").join("&&");return _e.logs.getStats({filter:_}).then(k=>{m(),k=V.toArray(k);for(let S of k)a.push({x:new Date(S.date),y:S.total}),t(1,u+=S.total)}).catch(k=>{k!=null&&k.isAbort||(m(),console.warn(k),_e.error(k,!_||(k==null?void 0:k.status)!=400))}).finally(()=>{t(2,f=!1)})}function m(){t(10,a=[]),t(1,u=0)}function h(){r==null||r.resetZoom()}Xt(()=>(vi.register(Qi,ar,sr,iu,xs,P$,U$),vi.register(HC),t(9,r=new vi(o,{type:"line",data:{datasets:[{label:"Total requests",data:a,borderColor:"#e34562",pointBackgroundColor:"#e34562",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointRadius:1,pointBorderWidth:0,fill:!0}]},options:{resizeDelay:250,maintainAspectRatio:!1,animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3"},border:{color:"#e4e9ec"},ticks:{precision:0,maxTicksLimit:4,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{color:_=>{var k;return(k=_.tick)!=null&&k.major?"#edf0f3":""}},color:"#e4e9ec",ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:_=>{var k;return(k=_.tick)!=null&&k.major?"#16161a":"#666f75"}}}},plugins:{legend:{display:!1},zoom:{enabled:!0,zoom:{mode:"x",pinch:{enabled:!0},drag:{enabled:!0,backgroundColor:"rgba(255, 99, 132, 0.2)",borderWidth:0,threshold:10},limits:{x:{minRange:1e8},y:{minRange:1e8}},onZoomComplete:({chart:_})=>{t(3,c=_.isZoomedOrPanned()),c?(t(5,l.min=V.formatToUTCDate(_.scales.x.min,"yyyy-MM-dd HH")+":00:00.000Z",l),t(5,l.max=V.formatToUTCDate(_.scales.x.max,"yyyy-MM-dd HH")+":59:59.999Z",l)):(l.min||l.max)&&t(5,l={})}}}}}})),()=>r==null?void 0:r.destroy()));function g(_){ie[_?"unshift":"push"](()=>{o=_,t(0,o)})}return n.$$set=_=>{"filter"in _&&t(6,i=_.filter),"zoom"in _&&t(5,l=_.zoom),"presets"in _&&t(7,s=_.presets)},n.$$.update=()=>{n.$$.dirty&192&&(typeof i<"u"||typeof s<"u")&&d(),n.$$.dirty&1536&&typeof a<"u"&&r&&(t(9,r.data.datasets[0].data=a,r),r.update())},[o,u,f,c,h,l,i,s,d,r,a,g]}class UC extends Se{constructor(e){super(),we(this,e,zC,jC,ke,{filter:6,zoom:5,presets:7,load:8})}get load(){return this.$$.ctx[8]}}function VC(n){let e,t,i;return{c(){e=b("div"),t=b("code"),p(t,"class","svelte-s3jkbp"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-s3jkbp")},m(l,s){v(l,e,s),w(e,t),t.innerHTML=n[1]},p(l,[s]){s&2&&(t.innerHTML=l[1]),s&1&&i!==(i="code-wrapper prism-light "+l[0]+" svelte-s3jkbp")&&p(e,"class",i)},i:te,o:te,d(l){l&&y(e)}}}function BC(n,e,t){let{content:i=""}=e,{language:l="javascript"}=e,{class:s=""}=e,o="";function r(a){return a=typeof a=="string"?a:"",a=Prism.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.highlight(a,Prism.languages[l]||Prism.languages.javascript,l)}return n.$$set=a=>{"content"in a&&t(2,i=a.content),"language"in a&&t(3,l=a.language),"class"in a&&t(0,s=a.class)},n.$$.update=()=>{n.$$.dirty&4&&typeof Prism<"u"&&i&&t(1,o=r(i))},[s,o,i,l]}class xu extends Se{constructor(e){super(),we(this,e,BC,VC,ke,{content:2,language:3,class:0})}}function WC(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"tabindex","-1"),p(e,"role","button"),p(e,"class",t=n[3]?n[2]:n[1]),p(e,"aria-label","Copy to clipboard")},m(o,r){v(o,e,r),l||(s=[Oe(i=qe.call(null,e,n[3]?void 0:n[0])),W(e,"click",On(n[4]))],l=!0)},p(o,[r]){r&14&&t!==(t=o[3]?o[2]:o[1])&&p(e,"class",t),i&&It(i.update)&&r&9&&i.update.call(null,o[3]?void 0:o[0])},i:te,o:te,d(o){o&&y(e),l=!1,Ie(s)}}}function YC(n,e,t){let{value:i=""}=e,{tooltip:l="Copy"}=e,{idleClasses:s="ri-file-copy-line txt-sm link-hint"}=e,{successClasses:o="ri-check-line txt-sm txt-success"}=e,{successDuration:r=500}=e,a;function u(){V.isEmpty(i)||(V.copyToClipboard(i),clearTimeout(a),t(3,a=setTimeout(()=>{clearTimeout(a),t(3,a=null)},r)))}return Xt(()=>()=>{a&&clearTimeout(a)}),n.$$set=f=>{"value"in f&&t(5,i=f.value),"tooltip"in f&&t(0,l=f.tooltip),"idleClasses"in f&&t(1,s=f.idleClasses),"successClasses"in f&&t(2,o=f.successClasses),"successDuration"in f&&t(6,r=f.successDuration)},[l,s,o,a,u,i,r]}class $i extends Se{constructor(e){super(),we(this,e,YC,WC,ke,{value:5,tooltip:0,idleClasses:1,successClasses:2,successDuration:6})}}function ap(n,e,t){const i=n.slice();i[16]=e[t];const l=i[1].data[i[16]];i[17]=l;const s=V.isEmpty(i[17]);i[18]=s;const o=!i[18]&&i[17]!==null&&typeof i[17]=="object";return i[19]=o,i}function KC(n){let e,t,i,l,s,o,r,a=n[1].id+"",u,f,c,d,m,h,g,_,k,S,$,T,O,E,L,I,A,P,N,R,z,F,U,J,Y;d=new $i({props:{value:n[1].id}}),S=new gk({props:{level:n[1].level}}),O=new $i({props:{value:n[1].level}}),N=new _k({props:{date:n[1].created}}),F=new $i({props:{value:n[1].created}});let Z=!n[4]&&up(n),G=de(n[5](n[1].data)),pe=[];for(let ue=0;ueD(pe[ue],1,1,()=>{pe[ue]=null});return{c(){e=b("table"),t=b("tbody"),i=b("tr"),l=b("td"),l.textContent="id",s=C(),o=b("td"),r=b("span"),u=B(a),f=C(),c=b("div"),j(d.$$.fragment),m=C(),h=b("tr"),g=b("td"),g.textContent="level",_=C(),k=b("td"),j(S.$$.fragment),$=C(),T=b("div"),j(O.$$.fragment),E=C(),L=b("tr"),I=b("td"),I.textContent="created",A=C(),P=b("td"),j(N.$$.fragment),R=C(),z=b("div"),j(F.$$.fragment),U=C(),Z&&Z.c(),J=C();for(let ue=0;ue{Z=null}),ae()):Z?(Z.p(ue,Te),Te&16&&M(Z,1)):(Z=up(ue),Z.c(),M(Z,1),Z.m(t,J)),Te&50){G=de(ue[5](ue[1].data));let We;for(We=0;We',p(e,"class","block txt-center")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function up(n){let e,t,i,l,s,o,r;const a=[GC,ZC],u=[];function f(c,d){return c[1].message?0:1}return s=f(n),o=u[s]=a[s](n),{c(){e=b("tr"),t=b("td"),t.textContent="message",i=C(),l=b("td"),o.c(),p(t,"class","min-width txt-hint txt-bold svelte-1c23bpt"),p(l,"class","svelte-1c23bpt"),p(e,"class","svelte-1c23bpt")},m(c,d){v(c,e,d),w(e,t),w(e,i),w(e,l),u[s].m(l,null),r=!0},p(c,d){let m=s;s=f(c),s===m?u[s].p(c,d):(re(),D(u[m],1,1,()=>{u[m]=null}),ae(),o=u[s],o?o.p(c,d):(o=u[s]=a[s](c),o.c()),M(o,1),o.m(l,null))},i(c){r||(M(o),r=!0)},o(c){D(o),r=!1},d(c){c&&y(e),u[s].d()}}}function ZC(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function GC(n){let e,t=n[1].message+"",i,l,s,o,r;return o=new $i({props:{value:n[1].message}}),{c(){e=b("span"),i=B(t),l=C(),s=b("div"),j(o.$$.fragment),p(e,"class","txt"),p(s,"class","copy-icon-wrapper svelte-1c23bpt")},m(a,u){v(a,e,u),w(e,i),v(a,l,u),v(a,s,u),q(o,s,null),r=!0},p(a,u){(!r||u&2)&&t!==(t=a[1].message+"")&&oe(i,t);const f={};u&2&&(f.value=a[1].message),o.$set(f)},i(a){r||(M(o.$$.fragment,a),r=!0)},o(a){D(o.$$.fragment,a),r=!1},d(a){a&&(y(e),y(l),y(s)),H(o)}}}function XC(n){let e,t=n[17]+"",i,l=n[4]&&n[16]=="execTime"?"ms":"",s;return{c(){e=b("span"),i=B(t),s=B(l),p(e,"class","txt")},m(o,r){v(o,e,r),w(e,i),w(e,s)},p(o,r){r&2&&t!==(t=o[17]+"")&&oe(i,t),r&18&&l!==(l=o[4]&&o[16]=="execTime"?"ms":"")&&oe(s,l)},i:te,o:te,d(o){o&&y(e)}}}function QC(n){let e,t;return e=new xu({props:{content:n[17],language:"html"}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.content=i[17]),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function xC(n){let e,t=n[17]+"",i;return{c(){e=b("span"),i=B(t),p(e,"class","label label-danger log-error-label svelte-1c23bpt")},m(l,s){v(l,e,s),w(e,i)},p(l,s){s&2&&t!==(t=l[17]+"")&&oe(i,t)},i:te,o:te,d(l){l&&y(e)}}}function e6(n){let e,t;return e=new xu({props:{content:JSON.stringify(n[17],null,2)}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.content=JSON.stringify(i[17],null,2)),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function t6(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function fp(n){let e,t,i;return t=new $i({props:{value:n[17]}}),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","copy-icon-wrapper svelte-1c23bpt")},m(l,s){v(l,e,s),q(t,e,null),i=!0},p(l,s){const o={};s&2&&(o.value=l[17]),t.$set(o)},i(l){i||(M(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&y(e),H(t)}}}function cp(n){let e,t,i,l=n[16]+"",s,o,r,a,u,f,c,d;const m=[t6,e6,xC,QC,XC],h=[];function g(k,S){return k[18]?0:k[19]?1:k[16]=="error"?2:k[16]=="details"?3:4}a=g(n),u=h[a]=m[a](n);let _=!n[18]&&fp(n);return{c(){e=b("tr"),t=b("td"),i=B("data."),s=B(l),o=C(),r=b("td"),u.c(),f=C(),_&&_.c(),c=C(),p(t,"class","min-width txt-hint txt-bold svelte-1c23bpt"),ee(t,"v-align-top",n[19]),p(r,"class","svelte-1c23bpt"),p(e,"class","svelte-1c23bpt")},m(k,S){v(k,e,S),w(e,t),w(t,i),w(t,s),w(e,o),w(e,r),h[a].m(r,null),w(r,f),_&&_.m(r,null),w(e,c),d=!0},p(k,S){(!d||S&2)&&l!==(l=k[16]+"")&&oe(s,l),(!d||S&34)&&ee(t,"v-align-top",k[19]);let $=a;a=g(k),a===$?h[a].p(k,S):(re(),D(h[$],1,1,()=>{h[$]=null}),ae(),u=h[a],u?u.p(k,S):(u=h[a]=m[a](k),u.c()),M(u,1),u.m(r,f)),k[18]?_&&(re(),D(_,1,1,()=>{_=null}),ae()):_?(_.p(k,S),S&2&&M(_,1)):(_=fp(k),_.c(),M(_,1),_.m(r,null))},i(k){d||(M(u),M(_),d=!0)},o(k){D(u),D(_),d=!1},d(k){k&&y(e),h[a].d(),_&&_.d()}}}function n6(n){let e,t,i,l;const s=[JC,KC],o=[];function r(a,u){var f;return a[3]?0:(f=a[1])!=null&&f.id?1:-1}return~(e=r(n))&&(t=o[e]=s[e](n)),{c(){t&&t.c(),i=ye()},m(a,u){~e&&o[e].m(a,u),v(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?~e&&o[e].p(a,u):(t&&(re(),D(o[f],1,1,()=>{o[f]=null}),ae()),~e?(t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),M(t,1),t.m(i.parentNode,i)):t=null)},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&y(i),~e&&o[e].d(a)}}}function i6(n){let e;return{c(){e=b("h4"),e.textContent="Request log"},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function l6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),e.innerHTML='Close',t=C(),i=b("button"),l=b("i"),s=C(),o=b("span"),o.textContent="Download as JSON",p(e,"type","button"),p(e,"class","btn btn-transparent"),p(l,"class","ri-download-line"),p(o,"class","txt"),p(i,"type","button"),p(i,"class","btn btn-primary"),i.disabled=n[3]},m(u,f){v(u,e,f),v(u,t,f),v(u,i,f),w(i,l),w(i,s),w(i,o),r||(a=[W(e,"click",n[9]),W(i,"click",n[10])],r=!0)},p(u,f){f&8&&(i.disabled=u[3])},d(u){u&&(y(e),y(t),y(i)),r=!1,Ie(a)}}}function s6(n){let e,t,i={class:"overlay-panel-lg log-panel",$$slots:{footer:[l6],header:[i6],default:[n6]},$$scope:{ctx:n}};return e=new Qt({props:i}),n[11](e),e.$on("hide",n[7]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&4194330&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[11](null),H(e,l)}}}const dp="log_view";function o6(n,e,t){let i;const l=kt();let s,o={},r=!1;function a($){return f($).then(T=>{t(1,o=T),h()}),s==null?void 0:s.show()}function u(){return _e.cancelRequest(dp),s==null?void 0:s.hide()}async function f($){if($&&typeof $!="string")return t(3,r=!1),$;t(3,r=!0);let T={};try{T=await _e.logs.getOne($,{requestKey:dp})}catch(O){O.isAbort||(u(),console.warn("resolveModel:",O),Ci(`Unable to load log with id "${$}"`))}return t(3,r=!1),T}const c=["execTime","type","auth","authId","status","method","url","referer","remoteIP","userIP","userAgent","error","details"];function d($){if(!$)return[];let T=[];for(let E of c)typeof $[E]<"u"&&T.push(E);const O=Object.keys($);for(let E of O)T.includes(E)||T.push(E);return T}function m(){V.downloadJson(o,"log_"+o.created.replaceAll(/[-:\. ]/gi,"")+".json")}function h(){l("show",o)}function g(){l("hide",o),t(1,o={})}const _=()=>u(),k=()=>m();function S($){ie[$?"unshift":"push"](()=>{s=$,t(2,s)})}return n.$$.update=()=>{var $;n.$$.dirty&2&&t(4,i=(($=o.data)==null?void 0:$.type)=="request")},[u,o,s,r,i,d,m,g,a,_,k,S]}class r6 extends Se{constructor(e){super(),we(this,e,o6,s6,ke,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function a6(n,e,t){const i=n.slice();return i[1]=e[t],i}function u6(n){let e;return{c(){e=b("code"),e.textContent=`${n[1].level}:${n[1].label}`,p(e,"class","txt-xs")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function f6(n){let e,t,i,l=de(x0),s=[];for(let o=0;o{"class"in l&&t(0,i=l.class)},[i]}class _y extends Se{constructor(e){super(),we(this,e,c6,f6,ke,{class:0})}}function d6(n){let e,t,i,l,s,o,r,a,u,f,c;return t=new fe({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[m6,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),l=new fe({props:{class:"form-field",name:"logs.minLevel",$$slots:{default:[h6,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field form-field-toggle",name:"logs.logIP",$$slots:{default:[_6,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),a=new fe({props:{class:"form-field form-field-toggle",name:"logs.logAuthId",$$slots:{default:[g6,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),j(t.$$.fragment),i=C(),j(l.$$.fragment),s=C(),j(o.$$.fragment),r=C(),j(a.$$.fragment),p(e,"id",n[6]),p(e,"class","grid"),p(e,"autocomplete","off")},m(d,m){v(d,e,m),q(t,e,null),w(e,i),q(l,e,null),w(e,s),q(o,e,null),w(e,r),q(a,e,null),u=!0,f||(c=W(e,"submit",nt(n[7])),f=!0)},p(d,m){const h={};m&25165826&&(h.$$scope={dirty:m,ctx:d}),t.$set(h);const g={};m&25165826&&(g.$$scope={dirty:m,ctx:d}),l.$set(g);const _={};m&25165826&&(_.$$scope={dirty:m,ctx:d}),o.$set(_);const k={};m&25165826&&(k.$$scope={dirty:m,ctx:d}),a.$set(k)},i(d){u||(M(t.$$.fragment,d),M(l.$$.fragment,d),M(o.$$.fragment,d),M(a.$$.fragment,d),u=!0)},o(d){D(t.$$.fragment,d),D(l.$$.fragment,d),D(o.$$.fragment,d),D(a.$$.fragment,d),u=!1},d(d){d&&y(e),H(t),H(l),H(o),H(a),f=!1,c()}}}function p6(n){let e;return{c(){e=b("div"),e.innerHTML='
',p(e,"class","block txt-center")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function m6(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=B("Max days retention"),l=C(),s=b("input"),r=C(),a=b("div"),a.innerHTML="Set to 0 to disable logs persistence.",p(e,"for",i=n[23]),p(s,"type","number"),p(s,"id",o=n[23]),s.required=!0,p(a,"class","help-block")},m(c,d){v(c,e,d),w(e,t),v(c,l,d),v(c,s,d),he(s,n[1].logs.maxDays),v(c,r,d),v(c,a,d),u||(f=W(s,"input",n[11]),u=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&p(e,"for",i),d&8388608&&o!==(o=c[23])&&p(s,"id",o),d&2&>(s.value)!==c[1].logs.maxDays&&he(s,c[1].logs.maxDays)},d(c){c&&(y(e),y(l),y(s),y(r),y(a)),u=!1,f()}}}function h6(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return f=new _y({}),{c(){e=b("label"),t=B("Min log level"),l=C(),s=b("input"),o=C(),r=b("div"),a=b("p"),a.textContent="Logs with level below the minimum will be ignored.",u=C(),j(f.$$.fragment),p(e,"for",i=n[23]),p(s,"type","number"),s.required=!0,p(s,"min","-100"),p(s,"max","100"),p(r,"class","help-block")},m(h,g){v(h,e,g),w(e,t),v(h,l,g),v(h,s,g),he(s,n[1].logs.minLevel),v(h,o,g),v(h,r,g),w(r,a),w(r,u),q(f,r,null),c=!0,d||(m=W(s,"input",n[12]),d=!0)},p(h,g){(!c||g&8388608&&i!==(i=h[23]))&&p(e,"for",i),g&2&>(s.value)!==h[1].logs.minLevel&&he(s,h[1].logs.minLevel)},i(h){c||(M(f.$$.fragment,h),c=!0)},o(h){D(f.$$.fragment,h),c=!1},d(h){h&&(y(e),y(l),y(s),y(o),y(r)),H(f),d=!1,m()}}}function _6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=B("Enable IP logging"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(l,"for",o=n[23])},m(u,f){v(u,e,f),e.checked=n[1].logs.logIP,v(u,i,f),v(u,l,f),w(l,s),r||(a=W(e,"change",n[13]),r=!0)},p(u,f){f&8388608&&t!==(t=u[23])&&p(e,"id",t),f&2&&(e.checked=u[1].logs.logIP),f&8388608&&o!==(o=u[23])&&p(l,"for",o)},d(u){u&&(y(e),y(i),y(l)),r=!1,a()}}}function g6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=B("Enable Auth Id logging"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(l,"for",o=n[23])},m(u,f){v(u,e,f),e.checked=n[1].logs.logAuthId,v(u,i,f),v(u,l,f),w(l,s),r||(a=W(e,"change",n[14]),r=!0)},p(u,f){f&8388608&&t!==(t=u[23])&&p(e,"id",t),f&2&&(e.checked=u[1].logs.logAuthId),f&8388608&&o!==(o=u[23])&&p(l,"for",o)},d(u){u&&(y(e),y(i),y(l)),r=!1,a()}}}function b6(n){let e,t,i,l;const s=[p6,d6],o=[];function r(a,u){return a[4]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),v(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),D(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&y(i),o[e].d(a)}}}function k6(n){let e;return{c(){e=b("h4"),e.textContent="Logs settings"},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function y6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=C(),l=b("button"),s=b("span"),s.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[3],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[3],ee(l,"btn-loading",n[3])},m(u,f){v(u,e,f),w(e,t),v(u,i,f),v(u,l,f),w(l,s),r||(a=W(e,"click",n[0]),r=!0)},p(u,f){f&8&&(e.disabled=u[3]),f&40&&o!==(o=!u[5]||u[3])&&(l.disabled=o),f&8&&ee(l,"btn-loading",u[3])},d(u){u&&(y(e),y(i),y(l)),r=!1,a()}}}function v6(n){let e,t,i={popup:!0,class:"superuser-panel",beforeHide:n[15],$$slots:{footer:[y6],header:[k6],default:[b6]},$$scope:{ctx:n}};return e=new Qt({props:i}),n[16](e),e.$on("hide",n[17]),e.$on("show",n[18]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&8&&(o.beforeHide=l[15]),s&16777274&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[16](null),H(e,l)}}}function w6(n,e,t){let i,l;const s=kt(),o="logs_settings_"+V.randomString(3);let r,a=!1,u=!1,f={},c={};function d(){return h(),g(),r==null?void 0:r.show()}function m(){return r==null?void 0:r.hide()}function h(){Ut(),t(9,f={}),t(1,c=JSON.parse(JSON.stringify(f||{})))}async function g(){t(4,u=!0);try{const P=await _e.settings.getAll()||{};k(P)}catch(P){_e.error(P)}t(4,u=!1)}async function _(){if(l){t(3,a=!0);try{const P=await _e.settings.update(V.filterRedactedProps(c));k(P),t(3,a=!1),m(),nn("Successfully saved logs settings."),s("save",P)}catch(P){t(3,a=!1),_e.error(P)}}}function k(P={}){t(1,c={logs:(P==null?void 0:P.logs)||{}}),t(9,f=JSON.parse(JSON.stringify(c)))}function S(){c.logs.maxDays=gt(this.value),t(1,c)}function $(){c.logs.minLevel=gt(this.value),t(1,c)}function T(){c.logs.logIP=this.checked,t(1,c)}function O(){c.logs.logAuthId=this.checked,t(1,c)}const E=()=>!a;function L(P){ie[P?"unshift":"push"](()=>{r=P,t(2,r)})}function I(P){Pe.call(this,n,P)}function A(P){Pe.call(this,n,P)}return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(f)),n.$$.dirty&1026&&t(5,l=i!=JSON.stringify(c))},[m,c,r,a,u,l,o,_,d,f,i,S,$,T,O,E,L,I,A]}class S6 extends Se{constructor(e){super(),we(this,e,w6,v6,ke,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function T6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=B("Include requests by superusers"),p(e,"type","checkbox"),p(e,"id",t=n[25]),p(l,"for",o=n[25])},m(u,f){v(u,e,f),e.checked=n[2],v(u,i,f),v(u,l,f),w(l,s),r||(a=W(e,"change",n[12]),r=!0)},p(u,f){f&33554432&&t!==(t=u[25])&&p(e,"id",t),f&4&&(e.checked=u[2]),f&33554432&&o!==(o=u[25])&&p(l,"for",o)},d(u){u&&(y(e),y(i),y(l)),r=!1,a()}}}function pp(n){let e,t,i;function l(o){n[14](o)}let s={filter:n[1],presets:n[6]};return n[5]!==void 0&&(s.zoom=n[5]),e=new UC({props:s}),ie.push(()=>be(e,"zoom",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&2&&(a.filter=o[1]),r&64&&(a.presets=o[6]),!t&&r&32&&(t=!0,a.zoom=o[5],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function mp(n){let e,t,i,l;function s(a){n[15](a)}function o(a){n[16](a)}let r={presets:n[6]};return n[1]!==void 0&&(r.filter=n[1]),n[5]!==void 0&&(r.zoom=n[5]),e=new U3({props:r}),ie.push(()=>be(e,"filter",s)),ie.push(()=>be(e,"zoom",o)),e.$on("select",n[17]),{c(){j(e.$$.fragment)},m(a,u){q(e,a,u),l=!0},p(a,u){const f={};u&64&&(f.presets=a[6]),!t&&u&2&&(t=!0,f.filter=a[1],$e(()=>t=!1)),!i&&u&32&&(i=!0,f.zoom=a[5],$e(()=>i=!1)),e.$set(f)},i(a){l||(M(e.$$.fragment,a),l=!0)},o(a){D(e.$$.fragment,a),l=!1},d(a){H(e,a)}}}function $6(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T=n[4],O,E=n[4],L,I,A,P;u=new Pu({}),u.$on("refresh",n[11]),h=new fe({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[T6,({uniqueId:z})=>({25:z}),({uniqueId:z})=>z?33554432:0]},$$scope:{ctx:n}}}),_=new Hr({props:{value:n[1],placeholder:"Search term or filter like `level > 0 && data.auth = 'guest'`",extraAutocompleteKeys:["level","message","data."]}}),_.$on("submit",n[13]),S=new _y({props:{class:"block txt-sm txt-hint m-t-xs m-b-base"}});let N=pp(n),R=mp(n);return{c(){e=b("div"),t=b("header"),i=b("nav"),l=b("div"),s=B(n[7]),o=C(),r=b("button"),r.innerHTML='',a=C(),j(u.$$.fragment),f=C(),c=b("div"),d=C(),m=b("div"),j(h.$$.fragment),g=C(),j(_.$$.fragment),k=C(),j(S.$$.fragment),$=C(),N.c(),O=C(),R.c(),L=ye(),p(l,"class","breadcrumb-item"),p(i,"class","breadcrumbs"),p(r,"type","button"),p(r,"aria-label","Logs settings"),p(r,"class","btn btn-transparent btn-circle"),p(c,"class","flex-fill"),p(m,"class","inline-flex"),p(t,"class","page-header"),p(e,"class","page-header-wrapper m-b-0")},m(z,F){v(z,e,F),w(e,t),w(t,i),w(i,l),w(l,s),w(t,o),w(t,r),w(t,a),q(u,t,null),w(t,f),w(t,c),w(t,d),w(t,m),q(h,m,null),w(e,g),q(_,e,null),w(e,k),q(S,e,null),w(e,$),N.m(e,null),v(z,O,F),R.m(z,F),v(z,L,F),I=!0,A||(P=[Oe(qe.call(null,r,{text:"Logs settings",position:"right"})),W(r,"click",n[10])],A=!0)},p(z,F){(!I||F&128)&&oe(s,z[7]);const U={};F&100663300&&(U.$$scope={dirty:F,ctx:z}),h.$set(U);const J={};F&2&&(J.value=z[1]),_.$set(J),F&16&&ke(T,T=z[4])?(re(),D(N,1,1,te),ae(),N=pp(z),N.c(),M(N,1),N.m(e,null)):N.p(z,F),F&16&&ke(E,E=z[4])?(re(),D(R,1,1,te),ae(),R=mp(z),R.c(),M(R,1),R.m(L.parentNode,L)):R.p(z,F)},i(z){I||(M(u.$$.fragment,z),M(h.$$.fragment,z),M(_.$$.fragment,z),M(S.$$.fragment,z),M(N),M(R),I=!0)},o(z){D(u.$$.fragment,z),D(h.$$.fragment,z),D(_.$$.fragment,z),D(S.$$.fragment,z),D(N),D(R),I=!1},d(z){z&&(y(e),y(O),y(L)),H(u),H(h),H(_),H(S),N.d(z),R.d(z),A=!1,Ie(P)}}}function C6(n){let e,t,i,l,s,o;e=new pi({props:{$$slots:{default:[$6]},$$scope:{ctx:n}}});let r={};i=new r6({props:r}),n[18](i),i.$on("show",n[19]),i.$on("hide",n[20]);let a={};return s=new S6({props:a}),n[21](s),s.$on("save",n[8]),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment),l=C(),j(s.$$.fragment)},m(u,f){q(e,u,f),v(u,t,f),q(i,u,f),v(u,l,f),q(s,u,f),o=!0},p(u,[f]){const c={};f&67109119&&(c.$$scope={dirty:f,ctx:u}),e.$set(c);const d={};i.$set(d);const m={};s.$set(m)},i(u){o||(M(e.$$.fragment,u),M(i.$$.fragment,u),M(s.$$.fragment,u),o=!0)},o(u){D(e.$$.fragment,u),D(i.$$.fragment,u),D(s.$$.fragment,u),o=!1},d(u){u&&(y(t),y(l)),H(e,u),n[18](null),H(i,u),n[21](null),H(s,u)}}}const Ko="logId",hp="superuserRequests",_p="superuserLogRequests";function O6(n,e,t){var R;let i,l,s;Qe(n,Au,z=>t(22,l=z)),Qe(n,un,z=>t(7,s=z)),Rn(un,s="Logs",s);const o=new URLSearchParams(l);let r,a,u=1,f=o.get("filter")||"",c={},d=(o.get(hp)||((R=window.localStorage)==null?void 0:R.getItem(_p)))<<0,m=d;function h(){t(4,u++,u)}function g(z={}){let F={};F.filter=f||null,F[hp]=d<<0||null,V.replaceHashQueryParams(Object.assign(F,z))}const _=()=>a==null?void 0:a.show(),k=()=>h();function S(){d=this.checked,t(2,d)}const $=z=>t(1,f=z.detail);function T(z){c=z,t(5,c)}function O(z){f=z,t(1,f)}function E(z){c=z,t(5,c)}const L=z=>r==null?void 0:r.show(z==null?void 0:z.detail);function I(z){ie[z?"unshift":"push"](()=>{r=z,t(0,r)})}const A=z=>{var U;let F={};F[Ko]=((U=z.detail)==null?void 0:U.id)||null,V.replaceHashQueryParams(F)},P=()=>{let z={};z[Ko]=null,V.replaceHashQueryParams(z)};function N(z){ie[z?"unshift":"push"](()=>{a=z,t(3,a)})}return n.$$.update=()=>{var z;n.$$.dirty&1&&o.get(Ko)&&r&&r.show(o.get(Ko)),n.$$.dirty&4&&t(6,i=d?"":'data.auth!="_superusers"'),n.$$.dirty&516&&m!=d&&(t(9,m=d),(z=window.localStorage)==null||z.setItem(_p,d<<0),g()),n.$$.dirty&2&&typeof f<"u"&&g()},[r,f,d,a,u,c,i,s,h,m,_,k,S,$,T,O,E,L,I,A,P,N]}class M6 extends Se{constructor(e){super(),we(this,e,O6,C6,ke,{})}}function gp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function bp(n){n[18]=n[19].default}function kp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function yp(n){let e;return{c(){e=b("hr"),p(e,"class","m-t-sm m-b-sm")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function E6(n){let e,t=n[15].label+"",i,l,s,o;function r(){return n[9](n[14])}return{c(){e=b("button"),i=B(t),l=C(),p(e,"type","button"),p(e,"class","sidebar-item"),ee(e,"active",n[5]===n[14])},m(a,u){v(a,e,u),w(e,i),w(e,l),s||(o=W(e,"click",r),s=!0)},p(a,u){n=a,u&8&&t!==(t=n[15].label+"")&&oe(i,t),u&40&&ee(e,"active",n[5]===n[14])},d(a){a&&y(e),s=!1,o()}}}function D6(n){let e,t=n[15].label+"",i,l,s,o;return{c(){e=b("div"),i=B(t),l=C(),p(e,"class","sidebar-item disabled")},m(r,a){v(r,e,a),w(e,i),w(e,l),s||(o=Oe(qe.call(null,e,{position:"left",text:"Not enabled for the collection"})),s=!0)},p(r,a){a&8&&t!==(t=r[15].label+"")&&oe(i,t)},d(r){r&&y(e),s=!1,o()}}}function vp(n,e){let t,i=e[21]===Object.keys(e[6]).length,l,s,o=i&&yp();function r(f,c){return f[15].disabled?D6:E6}let a=r(e),u=a(e);return{key:n,first:null,c(){t=ye(),o&&o.c(),l=C(),u.c(),s=ye(),this.first=t},m(f,c){v(f,t,c),o&&o.m(f,c),v(f,l,c),u.m(f,c),v(f,s,c)},p(f,c){e=f,c&8&&(i=e[21]===Object.keys(e[6]).length),i?o||(o=yp(),o.c(),o.m(l.parentNode,l)):o&&(o.d(1),o=null),a===(a=r(e))&&u?u.p(e,c):(u.d(1),u=a(e),u&&(u.c(),u.m(s.parentNode,s)))},d(f){f&&(y(t),y(l),y(s)),o&&o.d(f),u.d(f)}}}function wp(n){let e,t,i,l={ctx:n,current:null,token:null,hasCatch:!1,pending:A6,then:L6,catch:I6,value:19,blocks:[,,,]};return mf(t=n[15].component,l),{c(){e=ye(),l.block.c()},m(s,o){v(s,e,o),l.block.m(s,l.anchor=o),l.mount=()=>e.parentNode,l.anchor=e,i=!0},p(s,o){n=s,l.ctx=n,o&8&&t!==(t=n[15].component)&&mf(t,l)||Jy(l,n,o)},i(s){i||(M(l.block),i=!0)},o(s){for(let o=0;o<3;o+=1){const r=l.blocks[o];D(r)}i=!1},d(s){s&&y(e),l.block.d(s),l.token=null,l=null}}}function I6(n){return{c:te,m:te,p:te,i:te,o:te,d:te}}function L6(n){bp(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){j(e.$$.fragment),t=C()},m(l,s){q(e,l,s),v(l,t,s),i=!0},p(l,s){bp(l);const o={};s&4&&(o.collection=l[2]),e.$set(o)},i(l){i||(M(e.$$.fragment,l),i=!0)},o(l){D(e.$$.fragment,l),i=!1},d(l){l&&y(t),H(e,l)}}}function A6(n){return{c:te,m:te,p:te,i:te,o:te,d:te}}function Sp(n,e){let t,i,l,s=e[5]===e[14]&&wp(e);return{key:n,first:null,c(){t=ye(),s&&s.c(),i=ye(),this.first=t},m(o,r){v(o,t,r),s&&s.m(o,r),v(o,i,r),l=!0},p(o,r){e=o,e[5]===e[14]?s?(s.p(e,r),r&40&&M(s,1)):(s=wp(e),s.c(),M(s,1),s.m(i.parentNode,i)):s&&(re(),D(s,1,1,()=>{s=null}),ae())},i(o){l||(M(s),l=!0)},o(o){D(s),l=!1},d(o){o&&(y(t),y(i)),s&&s.d(o)}}}function P6(n){let e,t,i,l=[],s=new Map,o,r,a=[],u=new Map,f,c=de(Object.entries(n[3]));const d=g=>g[14];for(let g=0;gg[14];for(let g=0;gClose',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(l,s){v(l,e,s),t||(i=W(e,"click",n[8]),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function R6(n){let e,t,i={class:"docs-panel",$$slots:{footer:[N6],default:[P6]},$$scope:{ctx:n}};return e=new Qt({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&4194348&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[10](null),H(e,l)}}}function F6(n,e,t){const i={list:{label:"List/Search",component:Tt(()=>import("./ListApiDocs-D54ZVVWM.js"),__vite__mapDeps([2,3,4]),import.meta.url)},view:{label:"View",component:Tt(()=>import("./ViewApiDocs-DZ9ip2ya.js"),__vite__mapDeps([5,3]),import.meta.url)},create:{label:"Create",component:Tt(()=>import("./CreateApiDocs-BzGj6G0X.js"),__vite__mapDeps([6,3]),import.meta.url)},update:{label:"Update",component:Tt(()=>import("./UpdateApiDocs-DiOtUnmN.js"),__vite__mapDeps([7,3]),import.meta.url)},delete:{label:"Delete",component:Tt(()=>import("./DeleteApiDocs-DjxcrIL2.js"),[],import.meta.url)},realtime:{label:"Realtime",component:Tt(()=>import("./RealtimeApiDocs-BoGCX4-9.js"),[],import.meta.url)},batch:{label:"Batch",component:Tt(()=>import("./BatchApiDocs-DLDzErZQ.js"),[],import.meta.url)}},l={"list-auth-methods":{label:"List auth methods",component:Tt(()=>import("./AuthMethodsDocs-DA2FbqWG.js"),__vite__mapDeps([8,3]),import.meta.url)},"auth-with-password":{label:"Auth with password",component:Tt(()=>import("./AuthWithPasswordDocs-B5NyrXaF.js"),__vite__mapDeps([9,3]),import.meta.url)},"auth-with-oauth2":{label:"Auth with OAuth2",component:Tt(()=>import("./AuthWithOAuth2Docs-B4NAwTzv.js"),__vite__mapDeps([10,3]),import.meta.url)},"auth-with-otp":{label:"Auth with OTP",component:Tt(()=>import("./AuthWithOtpDocs-DxxNDAWv.js"),[],import.meta.url)},refresh:{label:"Auth refresh",component:Tt(()=>import("./AuthRefreshDocs-C-YzpWeh.js"),__vite__mapDeps([11,3]),import.meta.url)},verification:{label:"Verification",component:Tt(()=>import("./VerificationDocs-CP0Ct84F.js"),[],import.meta.url)},"password-reset":{label:"Password reset",component:Tt(()=>import("./PasswordResetDocs-CIs4u0g3.js"),[],import.meta.url)},"email-change":{label:"Email change",component:Tt(()=>import("./EmailChangeDocs-BgOnZTqB.js"),[],import.meta.url)}};let s,o={},r,a=[];a.length&&(r=Object.keys(a)[0]);function u(k){return t(2,o=k),c(Object.keys(a)[0]),s==null?void 0:s.show()}function f(){return s==null?void 0:s.hide()}function c(k){t(5,r=k)}const d=()=>f(),m=k=>c(k);function h(k){ie[k?"unshift":"push"](()=>{s=k,t(4,s)})}function g(k){Pe.call(this,n,k)}function _(k){Pe.call(this,n,k)}return n.$$.update=()=>{n.$$.dirty&12&&(o.type==="auth"?(t(3,a=Object.assign({},i,l)),t(3,a["auth-with-password"].disabled=!o.passwordAuth.enabled,a),t(3,a["auth-with-oauth2"].disabled=!o.oauth2.enabled,a),t(3,a["auth-with-otp"].disabled=!o.otp.enabled,a)):o.type==="view"?(t(3,a=Object.assign({},i)),delete a.create,delete a.update,delete a.delete,delete a.realtime,delete a.batch):t(3,a=Object.assign({},i)))},[f,c,o,a,s,r,i,u,d,m,h,g,_]}class q6 extends Se{constructor(e){super(),we(this,e,F6,R6,ke,{show:7,hide:0,changeTab:1})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}get changeTab(){return this.$$.ctx[1]}}const H6=n=>({active:n&1}),Tp=n=>({active:n[0]});function $p(n){let e,t,i;const l=n[15].default,s=Lt(l,n,n[14],null);return{c(){e=b("div"),s&&s.c(),p(e,"class","accordion-content")},m(o,r){v(o,e,r),s&&s.m(e,null),i=!0},p(o,r){s&&s.p&&(!i||r&16384)&&Pt(s,l,o,o[14],i?At(l,o[14],r,null):Nt(o[14]),null)},i(o){i||(M(s,o),o&&tt(()=>{i&&(t||(t=He(e,mt,{delay:10,duration:150},!0)),t.run(1))}),i=!0)},o(o){D(s,o),o&&(t||(t=He(e,mt,{delay:10,duration:150},!1)),t.run(0)),i=!1},d(o){o&&y(e),s&&s.d(o),o&&t&&t.end()}}}function j6(n){let e,t,i,l,s,o,r;const a=n[15].header,u=Lt(a,n,n[14],Tp);let f=n[0]&&$p(n);return{c(){e=b("div"),t=b("button"),u&&u.c(),i=C(),f&&f.c(),p(t,"type","button"),p(t,"class","accordion-header"),p(t,"draggable",n[2]),p(t,"aria-expanded",n[0]),ee(t,"interactive",n[3]),p(e,"class",l="accordion "+(n[7]?"drag-over":"")+" "+n[1]),ee(e,"active",n[0])},m(c,d){v(c,e,d),w(e,t),u&&u.m(t,null),w(e,i),f&&f.m(e,null),n[22](e),s=!0,o||(r=[W(t,"click",nt(n[17])),W(t,"drop",nt(n[18])),W(t,"dragstart",n[19]),W(t,"dragenter",n[20]),W(t,"dragleave",n[21]),W(t,"dragover",nt(n[16]))],o=!0)},p(c,[d]){u&&u.p&&(!s||d&16385)&&Pt(u,a,c,c[14],s?At(a,c[14],d,H6):Nt(c[14]),Tp),(!s||d&4)&&p(t,"draggable",c[2]),(!s||d&1)&&p(t,"aria-expanded",c[0]),(!s||d&8)&&ee(t,"interactive",c[3]),c[0]?f?(f.p(c,d),d&1&&M(f,1)):(f=$p(c),f.c(),M(f,1),f.m(e,null)):f&&(re(),D(f,1,1,()=>{f=null}),ae()),(!s||d&130&&l!==(l="accordion "+(c[7]?"drag-over":"")+" "+c[1]))&&p(e,"class",l),(!s||d&131)&&ee(e,"active",c[0])},i(c){s||(M(u,c),M(f),s=!0)},o(c){D(u,c),D(f),s=!1},d(c){c&&y(e),u&&u.d(c),f&&f.d(),n[22](null),o=!1,Ie(r)}}}function z6(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=kt();let o,r,{class:a=""}=e,{draggable:u=!1}=e,{active:f=!1}=e,{interactive:c=!0}=e,{single:d=!1}=e,m=!1;function h(){return!!f}function g(){S(),t(0,f=!0),s("expand")}function _(){t(0,f=!1),clearTimeout(r),s("collapse")}function k(){s("toggle"),f?_():g()}function S(){if(d&&o.closest(".accordions")){const P=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const N of P)N.click()}}Xt(()=>()=>clearTimeout(r));function $(P){Pe.call(this,n,P)}const T=()=>c&&k(),O=P=>{u&&(t(7,m=!1),S(),s("drop",P))},E=P=>u&&s("dragstart",P),L=P=>{u&&(t(7,m=!0),s("dragenter",P))},I=P=>{u&&(t(7,m=!1),s("dragleave",P))};function A(P){ie[P?"unshift":"push"](()=>{o=P,t(6,o)})}return n.$$set=P=>{"class"in P&&t(1,a=P.class),"draggable"in P&&t(2,u=P.draggable),"active"in P&&t(0,f=P.active),"interactive"in P&&t(3,c=P.interactive),"single"in P&&t(9,d=P.single),"$$scope"in P&&t(14,l=P.$$scope)},n.$$.update=()=>{n.$$.dirty&8257&&f&&(clearTimeout(r),t(13,r=setTimeout(()=>{o!=null&&o.scrollIntoViewIfNeeded?o.scrollIntoViewIfNeeded():o!=null&&o.scrollIntoView&&o.scrollIntoView({behavior:"smooth",block:"nearest"})},200)))},[f,a,u,c,k,S,o,m,s,d,h,g,_,r,l,i,$,T,O,E,L,I,A]}class ji extends Se{constructor(e){super(),we(this,e,z6,j6,ke,{class:1,draggable:2,active:0,interactive:3,single:9,isExpanded:10,expand:11,collapse:12,toggle:4,collapseSiblings:5})}get isExpanded(){return this.$$.ctx[10]}get expand(){return this.$$.ctx[11]}get collapse(){return this.$$.ctx[12]}get toggle(){return this.$$.ctx[4]}get collapseSiblings(){return this.$$.ctx[5]}}function Cp(n,e,t){const i=n.slice();return i[25]=e[t],i}function Op(n,e,t){const i=n.slice();return i[25]=e[t],i}function Mp(n){let e,t,i=de(n[3]),l=[];for(let s=0;s{"class"in l&&t(0,i=l.class)},[i]}class _y extends Se{constructor(e){super(),we(this,e,c6,f6,ke,{class:0})}}function d6(n){let e,t,i,l,s,o,r,a,u,f,c;return t=new fe({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[m6,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),l=new fe({props:{class:"form-field",name:"logs.minLevel",$$slots:{default:[h6,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field form-field-toggle",name:"logs.logIP",$$slots:{default:[_6,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),a=new fe({props:{class:"form-field form-field-toggle",name:"logs.logAuthId",$$slots:{default:[g6,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),j(t.$$.fragment),i=C(),j(l.$$.fragment),s=C(),j(o.$$.fragment),r=C(),j(a.$$.fragment),p(e,"id",n[6]),p(e,"class","grid"),p(e,"autocomplete","off")},m(d,m){v(d,e,m),q(t,e,null),w(e,i),q(l,e,null),w(e,s),q(o,e,null),w(e,r),q(a,e,null),u=!0,f||(c=W(e,"submit",nt(n[7])),f=!0)},p(d,m){const h={};m&25165826&&(h.$$scope={dirty:m,ctx:d}),t.$set(h);const g={};m&25165826&&(g.$$scope={dirty:m,ctx:d}),l.$set(g);const _={};m&25165826&&(_.$$scope={dirty:m,ctx:d}),o.$set(_);const k={};m&25165826&&(k.$$scope={dirty:m,ctx:d}),a.$set(k)},i(d){u||(M(t.$$.fragment,d),M(l.$$.fragment,d),M(o.$$.fragment,d),M(a.$$.fragment,d),u=!0)},o(d){D(t.$$.fragment,d),D(l.$$.fragment,d),D(o.$$.fragment,d),D(a.$$.fragment,d),u=!1},d(d){d&&y(e),H(t),H(l),H(o),H(a),f=!1,c()}}}function p6(n){let e;return{c(){e=b("div"),e.innerHTML='
',p(e,"class","block txt-center")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function m6(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=B("Max days retention"),l=C(),s=b("input"),r=C(),a=b("div"),a.innerHTML="Set to 0 to disable logs persistence.",p(e,"for",i=n[23]),p(s,"type","number"),p(s,"id",o=n[23]),s.required=!0,p(a,"class","help-block")},m(c,d){v(c,e,d),w(e,t),v(c,l,d),v(c,s,d),he(s,n[1].logs.maxDays),v(c,r,d),v(c,a,d),u||(f=W(s,"input",n[11]),u=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&p(e,"for",i),d&8388608&&o!==(o=c[23])&&p(s,"id",o),d&2&>(s.value)!==c[1].logs.maxDays&&he(s,c[1].logs.maxDays)},d(c){c&&(y(e),y(l),y(s),y(r),y(a)),u=!1,f()}}}function h6(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return f=new _y({}),{c(){e=b("label"),t=B("Min log level"),l=C(),s=b("input"),o=C(),r=b("div"),a=b("p"),a.textContent="Logs with level below the minimum will be ignored.",u=C(),j(f.$$.fragment),p(e,"for",i=n[23]),p(s,"type","number"),s.required=!0,p(s,"min","-100"),p(s,"max","100"),p(r,"class","help-block")},m(h,g){v(h,e,g),w(e,t),v(h,l,g),v(h,s,g),he(s,n[1].logs.minLevel),v(h,o,g),v(h,r,g),w(r,a),w(r,u),q(f,r,null),c=!0,d||(m=W(s,"input",n[12]),d=!0)},p(h,g){(!c||g&8388608&&i!==(i=h[23]))&&p(e,"for",i),g&2&>(s.value)!==h[1].logs.minLevel&&he(s,h[1].logs.minLevel)},i(h){c||(M(f.$$.fragment,h),c=!0)},o(h){D(f.$$.fragment,h),c=!1},d(h){h&&(y(e),y(l),y(s),y(o),y(r)),H(f),d=!1,m()}}}function _6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=B("Enable IP logging"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(l,"for",o=n[23])},m(u,f){v(u,e,f),e.checked=n[1].logs.logIP,v(u,i,f),v(u,l,f),w(l,s),r||(a=W(e,"change",n[13]),r=!0)},p(u,f){f&8388608&&t!==(t=u[23])&&p(e,"id",t),f&2&&(e.checked=u[1].logs.logIP),f&8388608&&o!==(o=u[23])&&p(l,"for",o)},d(u){u&&(y(e),y(i),y(l)),r=!1,a()}}}function g6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=B("Enable Auth Id logging"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(l,"for",o=n[23])},m(u,f){v(u,e,f),e.checked=n[1].logs.logAuthId,v(u,i,f),v(u,l,f),w(l,s),r||(a=W(e,"change",n[14]),r=!0)},p(u,f){f&8388608&&t!==(t=u[23])&&p(e,"id",t),f&2&&(e.checked=u[1].logs.logAuthId),f&8388608&&o!==(o=u[23])&&p(l,"for",o)},d(u){u&&(y(e),y(i),y(l)),r=!1,a()}}}function b6(n){let e,t,i,l;const s=[p6,d6],o=[];function r(a,u){return a[4]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),v(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),D(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&y(i),o[e].d(a)}}}function k6(n){let e;return{c(){e=b("h4"),e.textContent="Logs settings"},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function y6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=C(),l=b("button"),s=b("span"),s.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[3],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[3],ee(l,"btn-loading",n[3])},m(u,f){v(u,e,f),w(e,t),v(u,i,f),v(u,l,f),w(l,s),r||(a=W(e,"click",n[0]),r=!0)},p(u,f){f&8&&(e.disabled=u[3]),f&40&&o!==(o=!u[5]||u[3])&&(l.disabled=o),f&8&&ee(l,"btn-loading",u[3])},d(u){u&&(y(e),y(i),y(l)),r=!1,a()}}}function v6(n){let e,t,i={popup:!0,class:"superuser-panel",beforeHide:n[15],$$slots:{footer:[y6],header:[k6],default:[b6]},$$scope:{ctx:n}};return e=new Qt({props:i}),n[16](e),e.$on("hide",n[17]),e.$on("show",n[18]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&8&&(o.beforeHide=l[15]),s&16777274&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[16](null),H(e,l)}}}function w6(n,e,t){let i,l;const s=kt(),o="logs_settings_"+V.randomString(3);let r,a=!1,u=!1,f={},c={};function d(){return h(),g(),r==null?void 0:r.show()}function m(){return r==null?void 0:r.hide()}function h(){Ut(),t(9,f={}),t(1,c=JSON.parse(JSON.stringify(f||{})))}async function g(){t(4,u=!0);try{const P=await _e.settings.getAll()||{};k(P)}catch(P){_e.error(P)}t(4,u=!1)}async function _(){if(l){t(3,a=!0);try{const P=await _e.settings.update(V.filterRedactedProps(c));k(P),t(3,a=!1),m(),nn("Successfully saved logs settings."),s("save",P)}catch(P){t(3,a=!1),_e.error(P)}}}function k(P={}){t(1,c={logs:(P==null?void 0:P.logs)||{}}),t(9,f=JSON.parse(JSON.stringify(c)))}function S(){c.logs.maxDays=gt(this.value),t(1,c)}function $(){c.logs.minLevel=gt(this.value),t(1,c)}function T(){c.logs.logIP=this.checked,t(1,c)}function O(){c.logs.logAuthId=this.checked,t(1,c)}const E=()=>!a;function L(P){ie[P?"unshift":"push"](()=>{r=P,t(2,r)})}function I(P){Pe.call(this,n,P)}function A(P){Pe.call(this,n,P)}return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(f)),n.$$.dirty&1026&&t(5,l=i!=JSON.stringify(c))},[m,c,r,a,u,l,o,_,d,f,i,S,$,T,O,E,L,I,A]}class S6 extends Se{constructor(e){super(),we(this,e,w6,v6,ke,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function T6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=B("Include requests by superusers"),p(e,"type","checkbox"),p(e,"id",t=n[25]),p(l,"for",o=n[25])},m(u,f){v(u,e,f),e.checked=n[2],v(u,i,f),v(u,l,f),w(l,s),r||(a=W(e,"change",n[12]),r=!0)},p(u,f){f&33554432&&t!==(t=u[25])&&p(e,"id",t),f&4&&(e.checked=u[2]),f&33554432&&o!==(o=u[25])&&p(l,"for",o)},d(u){u&&(y(e),y(i),y(l)),r=!1,a()}}}function pp(n){let e,t,i;function l(o){n[14](o)}let s={filter:n[1],presets:n[6]};return n[5]!==void 0&&(s.zoom=n[5]),e=new UC({props:s}),ie.push(()=>be(e,"zoom",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&2&&(a.filter=o[1]),r&64&&(a.presets=o[6]),!t&&r&32&&(t=!0,a.zoom=o[5],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function mp(n){let e,t,i,l;function s(a){n[15](a)}function o(a){n[16](a)}let r={presets:n[6]};return n[1]!==void 0&&(r.filter=n[1]),n[5]!==void 0&&(r.zoom=n[5]),e=new U3({props:r}),ie.push(()=>be(e,"filter",s)),ie.push(()=>be(e,"zoom",o)),e.$on("select",n[17]),{c(){j(e.$$.fragment)},m(a,u){q(e,a,u),l=!0},p(a,u){const f={};u&64&&(f.presets=a[6]),!t&&u&2&&(t=!0,f.filter=a[1],$e(()=>t=!1)),!i&&u&32&&(i=!0,f.zoom=a[5],$e(()=>i=!1)),e.$set(f)},i(a){l||(M(e.$$.fragment,a),l=!0)},o(a){D(e.$$.fragment,a),l=!1},d(a){H(e,a)}}}function $6(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T=n[4],O,E=n[4],L,I,A,P;u=new Pu({}),u.$on("refresh",n[11]),h=new fe({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[T6,({uniqueId:z})=>({25:z}),({uniqueId:z})=>z?33554432:0]},$$scope:{ctx:n}}}),_=new Hr({props:{value:n[1],placeholder:"Search term or filter like `level > 0 && data.auth = 'guest'`",extraAutocompleteKeys:["level","message","data."]}}),_.$on("submit",n[13]),S=new _y({props:{class:"block txt-sm txt-hint m-t-xs m-b-base"}});let N=pp(n),R=mp(n);return{c(){e=b("div"),t=b("header"),i=b("nav"),l=b("div"),s=B(n[7]),o=C(),r=b("button"),r.innerHTML='',a=C(),j(u.$$.fragment),f=C(),c=b("div"),d=C(),m=b("div"),j(h.$$.fragment),g=C(),j(_.$$.fragment),k=C(),j(S.$$.fragment),$=C(),N.c(),O=C(),R.c(),L=ye(),p(l,"class","breadcrumb-item"),p(i,"class","breadcrumbs"),p(r,"type","button"),p(r,"aria-label","Logs settings"),p(r,"class","btn btn-transparent btn-circle"),p(c,"class","flex-fill"),p(m,"class","inline-flex"),p(t,"class","page-header"),p(e,"class","page-header-wrapper m-b-0")},m(z,F){v(z,e,F),w(e,t),w(t,i),w(i,l),w(l,s),w(t,o),w(t,r),w(t,a),q(u,t,null),w(t,f),w(t,c),w(t,d),w(t,m),q(h,m,null),w(e,g),q(_,e,null),w(e,k),q(S,e,null),w(e,$),N.m(e,null),v(z,O,F),R.m(z,F),v(z,L,F),I=!0,A||(P=[Oe(qe.call(null,r,{text:"Logs settings",position:"right"})),W(r,"click",n[10])],A=!0)},p(z,F){(!I||F&128)&&oe(s,z[7]);const U={};F&100663300&&(U.$$scope={dirty:F,ctx:z}),h.$set(U);const J={};F&2&&(J.value=z[1]),_.$set(J),F&16&&ke(T,T=z[4])?(re(),D(N,1,1,te),ae(),N=pp(z),N.c(),M(N,1),N.m(e,null)):N.p(z,F),F&16&&ke(E,E=z[4])?(re(),D(R,1,1,te),ae(),R=mp(z),R.c(),M(R,1),R.m(L.parentNode,L)):R.p(z,F)},i(z){I||(M(u.$$.fragment,z),M(h.$$.fragment,z),M(_.$$.fragment,z),M(S.$$.fragment,z),M(N),M(R),I=!0)},o(z){D(u.$$.fragment,z),D(h.$$.fragment,z),D(_.$$.fragment,z),D(S.$$.fragment,z),D(N),D(R),I=!1},d(z){z&&(y(e),y(O),y(L)),H(u),H(h),H(_),H(S),N.d(z),R.d(z),A=!1,Ie(P)}}}function C6(n){let e,t,i,l,s,o;e=new pi({props:{$$slots:{default:[$6]},$$scope:{ctx:n}}});let r={};i=new r6({props:r}),n[18](i),i.$on("show",n[19]),i.$on("hide",n[20]);let a={};return s=new S6({props:a}),n[21](s),s.$on("save",n[8]),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment),l=C(),j(s.$$.fragment)},m(u,f){q(e,u,f),v(u,t,f),q(i,u,f),v(u,l,f),q(s,u,f),o=!0},p(u,[f]){const c={};f&67109119&&(c.$$scope={dirty:f,ctx:u}),e.$set(c);const d={};i.$set(d);const m={};s.$set(m)},i(u){o||(M(e.$$.fragment,u),M(i.$$.fragment,u),M(s.$$.fragment,u),o=!0)},o(u){D(e.$$.fragment,u),D(i.$$.fragment,u),D(s.$$.fragment,u),o=!1},d(u){u&&(y(t),y(l)),H(e,u),n[18](null),H(i,u),n[21](null),H(s,u)}}}const Ko="logId",hp="superuserRequests",_p="superuserLogRequests";function O6(n,e,t){var R;let i,l,s;Qe(n,Au,z=>t(22,l=z)),Qe(n,un,z=>t(7,s=z)),Rn(un,s="Logs",s);const o=new URLSearchParams(l);let r,a,u=1,f=o.get("filter")||"",c={},d=(o.get(hp)||((R=window.localStorage)==null?void 0:R.getItem(_p)))<<0,m=d;function h(){t(4,u++,u)}function g(z={}){let F={};F.filter=f||null,F[hp]=d<<0||null,V.replaceHashQueryParams(Object.assign(F,z))}const _=()=>a==null?void 0:a.show(),k=()=>h();function S(){d=this.checked,t(2,d)}const $=z=>t(1,f=z.detail);function T(z){c=z,t(5,c)}function O(z){f=z,t(1,f)}function E(z){c=z,t(5,c)}const L=z=>r==null?void 0:r.show(z==null?void 0:z.detail);function I(z){ie[z?"unshift":"push"](()=>{r=z,t(0,r)})}const A=z=>{var U;let F={};F[Ko]=((U=z.detail)==null?void 0:U.id)||null,V.replaceHashQueryParams(F)},P=()=>{let z={};z[Ko]=null,V.replaceHashQueryParams(z)};function N(z){ie[z?"unshift":"push"](()=>{a=z,t(3,a)})}return n.$$.update=()=>{var z;n.$$.dirty&1&&o.get(Ko)&&r&&r.show(o.get(Ko)),n.$$.dirty&4&&t(6,i=d?"":'data.auth!="_superusers"'),n.$$.dirty&516&&m!=d&&(t(9,m=d),(z=window.localStorage)==null||z.setItem(_p,d<<0),g()),n.$$.dirty&2&&typeof f<"u"&&g()},[r,f,d,a,u,c,i,s,h,m,_,k,S,$,T,O,E,L,I,A,P,N]}class M6 extends Se{constructor(e){super(),we(this,e,O6,C6,ke,{})}}function gp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function bp(n){n[18]=n[19].default}function kp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function yp(n){let e;return{c(){e=b("hr"),p(e,"class","m-t-sm m-b-sm")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function E6(n){let e,t=n[15].label+"",i,l,s,o;function r(){return n[9](n[14])}return{c(){e=b("button"),i=B(t),l=C(),p(e,"type","button"),p(e,"class","sidebar-item"),ee(e,"active",n[5]===n[14])},m(a,u){v(a,e,u),w(e,i),w(e,l),s||(o=W(e,"click",r),s=!0)},p(a,u){n=a,u&8&&t!==(t=n[15].label+"")&&oe(i,t),u&40&&ee(e,"active",n[5]===n[14])},d(a){a&&y(e),s=!1,o()}}}function D6(n){let e,t=n[15].label+"",i,l,s,o;return{c(){e=b("div"),i=B(t),l=C(),p(e,"class","sidebar-item disabled")},m(r,a){v(r,e,a),w(e,i),w(e,l),s||(o=Oe(qe.call(null,e,{position:"left",text:"Not enabled for the collection"})),s=!0)},p(r,a){a&8&&t!==(t=r[15].label+"")&&oe(i,t)},d(r){r&&y(e),s=!1,o()}}}function vp(n,e){let t,i=e[21]===Object.keys(e[6]).length,l,s,o=i&&yp();function r(f,c){return f[15].disabled?D6:E6}let a=r(e),u=a(e);return{key:n,first:null,c(){t=ye(),o&&o.c(),l=C(),u.c(),s=ye(),this.first=t},m(f,c){v(f,t,c),o&&o.m(f,c),v(f,l,c),u.m(f,c),v(f,s,c)},p(f,c){e=f,c&8&&(i=e[21]===Object.keys(e[6]).length),i?o||(o=yp(),o.c(),o.m(l.parentNode,l)):o&&(o.d(1),o=null),a===(a=r(e))&&u?u.p(e,c):(u.d(1),u=a(e),u&&(u.c(),u.m(s.parentNode,s)))},d(f){f&&(y(t),y(l),y(s)),o&&o.d(f),u.d(f)}}}function wp(n){let e,t,i,l={ctx:n,current:null,token:null,hasCatch:!1,pending:A6,then:L6,catch:I6,value:19,blocks:[,,,]};return mf(t=n[15].component,l),{c(){e=ye(),l.block.c()},m(s,o){v(s,e,o),l.block.m(s,l.anchor=o),l.mount=()=>e.parentNode,l.anchor=e,i=!0},p(s,o){n=s,l.ctx=n,o&8&&t!==(t=n[15].component)&&mf(t,l)||Jy(l,n,o)},i(s){i||(M(l.block),i=!0)},o(s){for(let o=0;o<3;o+=1){const r=l.blocks[o];D(r)}i=!1},d(s){s&&y(e),l.block.d(s),l.token=null,l=null}}}function I6(n){return{c:te,m:te,p:te,i:te,o:te,d:te}}function L6(n){bp(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){j(e.$$.fragment),t=C()},m(l,s){q(e,l,s),v(l,t,s),i=!0},p(l,s){bp(l);const o={};s&4&&(o.collection=l[2]),e.$set(o)},i(l){i||(M(e.$$.fragment,l),i=!0)},o(l){D(e.$$.fragment,l),i=!1},d(l){l&&y(t),H(e,l)}}}function A6(n){return{c:te,m:te,p:te,i:te,o:te,d:te}}function Sp(n,e){let t,i,l,s=e[5]===e[14]&&wp(e);return{key:n,first:null,c(){t=ye(),s&&s.c(),i=ye(),this.first=t},m(o,r){v(o,t,r),s&&s.m(o,r),v(o,i,r),l=!0},p(o,r){e=o,e[5]===e[14]?s?(s.p(e,r),r&40&&M(s,1)):(s=wp(e),s.c(),M(s,1),s.m(i.parentNode,i)):s&&(re(),D(s,1,1,()=>{s=null}),ae())},i(o){l||(M(s),l=!0)},o(o){D(s),l=!1},d(o){o&&(y(t),y(i)),s&&s.d(o)}}}function P6(n){let e,t,i,l=[],s=new Map,o,r,a=[],u=new Map,f,c=de(Object.entries(n[3]));const d=g=>g[14];for(let g=0;gg[14];for(let g=0;gClose',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(l,s){v(l,e,s),t||(i=W(e,"click",n[8]),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function R6(n){let e,t,i={class:"docs-panel",$$slots:{footer:[N6],default:[P6]},$$scope:{ctx:n}};return e=new Qt({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&4194348&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[10](null),H(e,l)}}}function F6(n,e,t){const i={list:{label:"List/Search",component:Tt(()=>import("./ListApiDocs-C43-0tDt.js"),__vite__mapDeps([2,3,4]),import.meta.url)},view:{label:"View",component:Tt(()=>import("./ViewApiDocs-DL4sWQDZ.js"),__vite__mapDeps([5,3]),import.meta.url)},create:{label:"Create",component:Tt(()=>import("./CreateApiDocs-D603KXnO.js"),__vite__mapDeps([6,3]),import.meta.url)},update:{label:"Update",component:Tt(()=>import("./UpdateApiDocs-Qjcnv2Ln.js"),__vite__mapDeps([7,3]),import.meta.url)},delete:{label:"Delete",component:Tt(()=>import("./DeleteApiDocs-BEM8M84w.js"),[],import.meta.url)},realtime:{label:"Realtime",component:Tt(()=>import("./RealtimeApiDocs-BC7IwiaY.js"),[],import.meta.url)},batch:{label:"Batch",component:Tt(()=>import("./BatchApiDocs-D2OLD1A6.js"),[],import.meta.url)}},l={"list-auth-methods":{label:"List auth methods",component:Tt(()=>import("./AuthMethodsDocs-LOcNuTNq.js"),__vite__mapDeps([8,3]),import.meta.url)},"auth-with-password":{label:"Auth with password",component:Tt(()=>import("./AuthWithPasswordDocs-p2UV8l8M.js"),__vite__mapDeps([9,3]),import.meta.url)},"auth-with-oauth2":{label:"Auth with OAuth2",component:Tt(()=>import("./AuthWithOAuth2Docs-Bjy57_lX.js"),__vite__mapDeps([10,3]),import.meta.url)},"auth-with-otp":{label:"Auth with OTP",component:Tt(()=>import("./AuthWithOtpDocs-qA-H_yTO.js"),[],import.meta.url)},refresh:{label:"Auth refresh",component:Tt(()=>import("./AuthRefreshDocs-tAKBTotE.js"),__vite__mapDeps([11,3]),import.meta.url)},verification:{label:"Verification",component:Tt(()=>import("./VerificationDocs-12SqmFuG.js"),[],import.meta.url)},"password-reset":{label:"Password reset",component:Tt(()=>import("./PasswordResetDocs-DsQvQsH3.js"),[],import.meta.url)},"email-change":{label:"Email change",component:Tt(()=>import("./EmailChangeDocs-Bks_OEhb.js"),[],import.meta.url)}};let s,o={},r,a=[];a.length&&(r=Object.keys(a)[0]);function u(k){return t(2,o=k),c(Object.keys(a)[0]),s==null?void 0:s.show()}function f(){return s==null?void 0:s.hide()}function c(k){t(5,r=k)}const d=()=>f(),m=k=>c(k);function h(k){ie[k?"unshift":"push"](()=>{s=k,t(4,s)})}function g(k){Pe.call(this,n,k)}function _(k){Pe.call(this,n,k)}return n.$$.update=()=>{n.$$.dirty&12&&(o.type==="auth"?(t(3,a=Object.assign({},i,l)),t(3,a["auth-with-password"].disabled=!o.passwordAuth.enabled,a),t(3,a["auth-with-oauth2"].disabled=!o.oauth2.enabled,a),t(3,a["auth-with-otp"].disabled=!o.otp.enabled,a)):o.type==="view"?(t(3,a=Object.assign({},i)),delete a.create,delete a.update,delete a.delete,delete a.realtime,delete a.batch):t(3,a=Object.assign({},i)))},[f,c,o,a,s,r,i,u,d,m,h,g,_]}class q6 extends Se{constructor(e){super(),we(this,e,F6,R6,ke,{show:7,hide:0,changeTab:1})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}get changeTab(){return this.$$.ctx[1]}}const H6=n=>({active:n&1}),Tp=n=>({active:n[0]});function $p(n){let e,t,i;const l=n[15].default,s=Lt(l,n,n[14],null);return{c(){e=b("div"),s&&s.c(),p(e,"class","accordion-content")},m(o,r){v(o,e,r),s&&s.m(e,null),i=!0},p(o,r){s&&s.p&&(!i||r&16384)&&Pt(s,l,o,o[14],i?At(l,o[14],r,null):Nt(o[14]),null)},i(o){i||(M(s,o),o&&tt(()=>{i&&(t||(t=He(e,mt,{delay:10,duration:150},!0)),t.run(1))}),i=!0)},o(o){D(s,o),o&&(t||(t=He(e,mt,{delay:10,duration:150},!1)),t.run(0)),i=!1},d(o){o&&y(e),s&&s.d(o),o&&t&&t.end()}}}function j6(n){let e,t,i,l,s,o,r;const a=n[15].header,u=Lt(a,n,n[14],Tp);let f=n[0]&&$p(n);return{c(){e=b("div"),t=b("button"),u&&u.c(),i=C(),f&&f.c(),p(t,"type","button"),p(t,"class","accordion-header"),p(t,"draggable",n[2]),p(t,"aria-expanded",n[0]),ee(t,"interactive",n[3]),p(e,"class",l="accordion "+(n[7]?"drag-over":"")+" "+n[1]),ee(e,"active",n[0])},m(c,d){v(c,e,d),w(e,t),u&&u.m(t,null),w(e,i),f&&f.m(e,null),n[22](e),s=!0,o||(r=[W(t,"click",nt(n[17])),W(t,"drop",nt(n[18])),W(t,"dragstart",n[19]),W(t,"dragenter",n[20]),W(t,"dragleave",n[21]),W(t,"dragover",nt(n[16]))],o=!0)},p(c,[d]){u&&u.p&&(!s||d&16385)&&Pt(u,a,c,c[14],s?At(a,c[14],d,H6):Nt(c[14]),Tp),(!s||d&4)&&p(t,"draggable",c[2]),(!s||d&1)&&p(t,"aria-expanded",c[0]),(!s||d&8)&&ee(t,"interactive",c[3]),c[0]?f?(f.p(c,d),d&1&&M(f,1)):(f=$p(c),f.c(),M(f,1),f.m(e,null)):f&&(re(),D(f,1,1,()=>{f=null}),ae()),(!s||d&130&&l!==(l="accordion "+(c[7]?"drag-over":"")+" "+c[1]))&&p(e,"class",l),(!s||d&131)&&ee(e,"active",c[0])},i(c){s||(M(u,c),M(f),s=!0)},o(c){D(u,c),D(f),s=!1},d(c){c&&y(e),u&&u.d(c),f&&f.d(),n[22](null),o=!1,Ie(r)}}}function z6(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=kt();let o,r,{class:a=""}=e,{draggable:u=!1}=e,{active:f=!1}=e,{interactive:c=!0}=e,{single:d=!1}=e,m=!1;function h(){return!!f}function g(){S(),t(0,f=!0),s("expand")}function _(){t(0,f=!1),clearTimeout(r),s("collapse")}function k(){s("toggle"),f?_():g()}function S(){if(d&&o.closest(".accordions")){const P=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const N of P)N.click()}}Xt(()=>()=>clearTimeout(r));function $(P){Pe.call(this,n,P)}const T=()=>c&&k(),O=P=>{u&&(t(7,m=!1),S(),s("drop",P))},E=P=>u&&s("dragstart",P),L=P=>{u&&(t(7,m=!0),s("dragenter",P))},I=P=>{u&&(t(7,m=!1),s("dragleave",P))};function A(P){ie[P?"unshift":"push"](()=>{o=P,t(6,o)})}return n.$$set=P=>{"class"in P&&t(1,a=P.class),"draggable"in P&&t(2,u=P.draggable),"active"in P&&t(0,f=P.active),"interactive"in P&&t(3,c=P.interactive),"single"in P&&t(9,d=P.single),"$$scope"in P&&t(14,l=P.$$scope)},n.$$.update=()=>{n.$$.dirty&8257&&f&&(clearTimeout(r),t(13,r=setTimeout(()=>{o!=null&&o.scrollIntoViewIfNeeded?o.scrollIntoViewIfNeeded():o!=null&&o.scrollIntoView&&o.scrollIntoView({behavior:"smooth",block:"nearest"})},200)))},[f,a,u,c,k,S,o,m,s,d,h,g,_,r,l,i,$,T,O,E,L,I,A]}class ji extends Se{constructor(e){super(),we(this,e,z6,j6,ke,{class:1,draggable:2,active:0,interactive:3,single:9,isExpanded:10,expand:11,collapse:12,toggle:4,collapseSiblings:5})}get isExpanded(){return this.$$.ctx[10]}get expand(){return this.$$.ctx[11]}get collapse(){return this.$$.ctx[12]}get toggle(){return this.$$.ctx[4]}get collapseSiblings(){return this.$$.ctx[5]}}function Cp(n,e,t){const i=n.slice();return i[25]=e[t],i}function Op(n,e,t){const i=n.slice();return i[25]=e[t],i}function Mp(n){let e,t,i=de(n[3]),l=[];for(let s=0;s0&&Mp(n);return{c(){e=b("label"),t=B("Subject"),l=C(),s=b("input"),r=C(),c&&c.c(),a=ye(),p(e,"for",i=n[24]),p(s,"type","text"),p(s,"id",o=n[24]),p(s,"spellcheck","false"),s.required=!0},m(m,h){v(m,e,h),w(e,t),v(m,l,h),v(m,s,h),he(s,n[0].subject),v(m,r,h),c&&c.m(m,h),v(m,a,h),u||(f=W(s,"input",n[14]),u=!0)},p(m,h){var g;h&16777216&&i!==(i=m[24])&&p(e,"for",i),h&16777216&&o!==(o=m[24])&&p(s,"id",o),h&1&&s.value!==m[0].subject&&he(s,m[0].subject),((g=m[3])==null?void 0:g.length)>0?c?c.p(m,h):(c=Mp(m),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(m){m&&(y(e),y(l),y(s),y(r),y(a)),c&&c.d(m),u=!1,f()}}}function V6(n){let e,t,i,l;return{c(){e=b("textarea"),p(e,"id",t=n[24]),p(e,"class","txt-mono"),p(e,"spellcheck","false"),p(e,"rows","14"),e.required=!0},m(s,o){v(s,e,o),he(e,n[0].body),i||(l=W(e,"input",n[17]),i=!0)},p(s,o){o&16777216&&t!==(t=s[24])&&p(e,"id",t),o&1&&he(e,s[0].body)},i:te,o:te,d(s){s&&y(e),i=!1,l()}}}function B6(n){let e,t,i,l;function s(a){n[16](a)}var o=n[5];function r(a,u){let f={id:a[24],language:"html"};return a[0].body!==void 0&&(f.value=a[0].body),{props:f}}return o&&(e=zt(o,r(n)),ie.push(()=>be(e,"value",s))),{c(){e&&j(e.$$.fragment),i=ye()},m(a,u){e&&q(e,a,u),v(a,i,u),l=!0},p(a,u){if(u&32&&o!==(o=a[5])){if(e){re();const f=e;D(f.$$.fragment,1,0,()=>{H(f,1)}),ae()}o?(e=zt(o,r(a)),ie.push(()=>be(e,"value",s)),j(e.$$.fragment),M(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else if(o){const f={};u&16777216&&(f.id=a[24]),!t&&u&1&&(t=!0,f.value=a[0].body,$e(()=>t=!1)),e.$set(f)}},i(a){l||(e&&M(e.$$.fragment,a),l=!0)},o(a){e&&D(e.$$.fragment,a),l=!1},d(a){a&&y(i),e&&H(e,a)}}}function Dp(n){let e,t,i=de(n[3]),l=[];for(let s=0;s0&&Dp(n);return{c(){e=b("label"),t=B("Body (HTML)"),l=C(),o.c(),r=C(),m&&m.c(),a=ye(),p(e,"for",i=n[24])},m(g,_){v(g,e,_),w(e,t),v(g,l,_),c[s].m(g,_),v(g,r,_),m&&m.m(g,_),v(g,a,_),u=!0},p(g,_){var S;(!u||_&16777216&&i!==(i=g[24]))&&p(e,"for",i);let k=s;s=d(g),s===k?c[s].p(g,_):(re(),D(c[k],1,1,()=>{c[k]=null}),ae(),o=c[s],o?o.p(g,_):(o=c[s]=f[s](g),o.c()),M(o,1),o.m(r.parentNode,r)),((S=g[3])==null?void 0:S.length)>0?m?m.p(g,_):(m=Dp(g),m.c(),m.m(a.parentNode,a)):m&&(m.d(1),m=null)},i(g){u||(M(o),u=!0)},o(g){D(o),u=!1},d(g){g&&(y(e),y(l),y(r),y(a)),c[s].d(g),m&&m.d(g)}}}function Y6(n){let e,t,i,l;return e=new fe({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[U6,({uniqueId:s})=>({24:s}),({uniqueId:s})=>s?16777216:0]},$$scope:{ctx:n}}}),i=new fe({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[W6,({uniqueId:s})=>({24:s}),({uniqueId:s})=>s?16777216:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(s,o){q(e,s,o),v(s,t,o),q(i,s,o),l=!0},p(s,o){const r={};o&2&&(r.name=s[1]+".subject"),o&1090519049&&(r.$$scope={dirty:o,ctx:s}),e.$set(r);const a={};o&2&&(a.name=s[1]+".body"),o&1090519145&&(a.$$scope={dirty:o,ctx:s}),i.$set(a)},i(s){l||(M(e.$$.fragment,s),M(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&y(t),H(e,s),H(i,s)}}}function Lp(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Oe(qe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,$t,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,$t,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function K6(n){let e,t,i,l,s,o,r,a,u,f=n[7]&&Lp();return{c(){e=b("div"),t=b("i"),i=C(),l=b("span"),s=B(n[2]),o=C(),r=b("div"),a=C(),f&&f.c(),u=ye(),p(t,"class","ri-draft-line"),p(l,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){v(c,e,d),w(e,t),w(e,i),w(e,l),w(l,s),v(c,o,d),v(c,r,d),v(c,a,d),f&&f.m(c,d),v(c,u,d)},p(c,d){d&4&&oe(s,c[2]),c[7]?f?d&128&&M(f,1):(f=Lp(),f.c(),M(f,1),f.m(u.parentNode,u)):f&&(re(),D(f,1,1,()=>{f=null}),ae())},d(c){c&&(y(e),y(o),y(r),y(a),y(u)),f&&f.d(c)}}}function J6(n){let e,t;const i=[n[9]];let l={$$slots:{header:[K6],default:[Y6]},$$scope:{ctx:n}};for(let s=0;st(13,o=R));let{key:r}=e,{title:a}=e,{config:u={}}=e,{placeholders:f=[]}=e,c,d=Ap,m=!1;function h(){c==null||c.expand()}function g(){c==null||c.collapse()}function _(){c==null||c.collapseSiblings()}async function k(){d||m||(t(6,m=!0),t(5,d=(await Tt(async()=>{const{default:R}=await import("./CodeEditor-Dl2IHbSx.js");return{default:R}},__vite__mapDeps([12,1]),import.meta.url)).default),Ap=d,t(6,m=!1))}function S(R){R=R.replace("*",""),V.copyToClipboard(R),Ks(`Copied ${R} to clipboard`,2e3)}k();function $(){u.subject=this.value,t(0,u)}const T=R=>S("{"+R+"}");function O(R){n.$$.not_equal(u.body,R)&&(u.body=R,t(0,u))}function E(){u.body=this.value,t(0,u)}const L=R=>S("{"+R+"}");function I(R){ie[R?"unshift":"push"](()=>{c=R,t(4,c)})}function A(R){Pe.call(this,n,R)}function P(R){Pe.call(this,n,R)}function N(R){Pe.call(this,n,R)}return n.$$set=R=>{e=je(je({},e),Wt(R)),t(9,s=lt(e,l)),"key"in R&&t(1,r=R.key),"title"in R&&t(2,a=R.title),"config"in R&&t(0,u=R.config),"placeholders"in R&&t(3,f=R.placeholders)},n.$$.update=()=>{n.$$.dirty&8194&&t(7,i=!V.isEmpty(V.getNestedVal(o,r))),n.$$.dirty&3&&(u.enabled||Yn(r))},[u,r,a,f,c,d,m,i,S,s,h,g,_,o,$,T,O,E,L,I,A,P,N]}class G6 extends Se{constructor(e){super(),we(this,e,Z6,J6,ke,{key:1,title:2,config:0,placeholders:3,expand:10,collapse:11,collapseSiblings:12})}get expand(){return this.$$.ctx[10]}get collapse(){return this.$$.ctx[11]}get collapseSiblings(){return this.$$.ctx[12]}}function X6(n){let e,t,i,l,s,o,r,a,u,f,c,d;return{c(){e=b("label"),t=B(n[3]),i=B(" duration (in seconds)"),s=C(),o=b("input"),a=C(),u=b("div"),f=b("span"),f.textContent="Invalidate all previously issued tokens",p(e,"for",l=n[6]),p(o,"type","number"),p(o,"id",r=n[6]),o.required=!0,p(o,"placeholder","No change"),p(f,"class","link-primary"),ee(f,"txt-success",!!n[1]),p(u,"class","help-block")},m(m,h){v(m,e,h),w(e,t),w(e,i),v(m,s,h),v(m,o,h),he(o,n[0]),v(m,a,h),v(m,u,h),w(u,f),c||(d=[W(o,"input",n[4]),W(f,"click",n[5])],c=!0)},p(m,h){h&8&&oe(t,m[3]),h&64&&l!==(l=m[6])&&p(e,"for",l),h&64&&r!==(r=m[6])&&p(o,"id",r),h&1&>(o.value)!==m[0]&&he(o,m[0]),h&2&&ee(f,"txt-success",!!m[1])},d(m){m&&(y(e),y(s),y(o),y(a),y(u)),c=!1,Ie(d)}}}function Q6(n){let e,t;return e=new fe({props:{class:"form-field required",name:n[2]+".duration",$$slots:{default:[X6,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&4&&(s.name=i[2]+".duration"),l&203&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function x6(n,e,t){let{key:i}=e,{label:l}=e,{duration:s}=e,{secret:o}=e;function r(){s=gt(this.value),t(0,s)}const a=()=>{o?t(1,o=void 0):t(1,o=V.randomSecret(50))};return n.$$set=u=>{"key"in u&&t(2,i=u.key),"label"in u&&t(3,l=u.label),"duration"in u&&t(0,s=u.duration),"secret"in u&&t(1,o=u.secret)},[s,o,i,l,r,a]}class e5 extends Se{constructor(e){super(),we(this,e,x6,Q6,ke,{key:2,label:3,duration:0,secret:1})}}function Pp(n,e,t){const i=n.slice();return i[8]=e[t],i[9]=e,i[10]=t,i}function Np(n,e){let t,i,l,s,o,r;function a(c){e[5](c,e[8])}function u(c){e[6](c,e[8])}let f={key:e[8].key,label:e[8].label};return e[0][e[8].key].duration!==void 0&&(f.duration=e[0][e[8].key].duration),e[0][e[8].key].secret!==void 0&&(f.secret=e[0][e[8].key].secret),i=new e5({props:f}),ie.push(()=>be(i,"duration",a)),ie.push(()=>be(i,"secret",u)),{key:n,first:null,c(){t=b("div"),j(i.$$.fragment),o=C(),p(t,"class","col-sm-6"),this.first=t},m(c,d){v(c,t,d),q(i,t,null),w(t,o),r=!0},p(c,d){e=c;const m={};d&2&&(m.key=e[8].key),d&2&&(m.label=e[8].label),!l&&d&3&&(l=!0,m.duration=e[0][e[8].key].duration,$e(()=>l=!1)),!s&&d&3&&(s=!0,m.secret=e[0][e[8].key].secret,$e(()=>s=!1)),i.$set(m)},i(c){r||(M(i.$$.fragment,c),r=!0)},o(c){D(i.$$.fragment,c),r=!1},d(c){c&&y(t),H(i)}}}function t5(n){let e,t=[],i=new Map,l,s=de(n[1]);const o=r=>r[8].key;for(let r=0;r{i&&(t||(t=He(e,$t,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,$t,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function n5(n){let e,t,i,l,s,o=n[2]&&Rp();return{c(){e=b("div"),e.innerHTML=' Tokens options (invalidate, duration)',t=C(),i=b("div"),l=C(),o&&o.c(),s=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(r,a){v(r,e,a),v(r,t,a),v(r,i,a),v(r,l,a),o&&o.m(r,a),v(r,s,a)},p(r,a){r[2]?o?a&4&&M(o,1):(o=Rp(),o.c(),M(o,1),o.m(s.parentNode,s)):o&&(re(),D(o,1,1,()=>{o=null}),ae())},d(r){r&&(y(e),y(t),y(i),y(l),y(s)),o&&o.d(r)}}}function i5(n){let e,t;return e=new ji({props:{single:!0,$$slots:{header:[n5],default:[t5]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2055&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function l5(n,e,t){let i,l,s;Qe(n,yn,c=>t(4,s=c));let{collection:o}=e,r=[];function a(c){if(V.isEmpty(c))return!1;for(let d of r)if(c[d.key])return!0;return!1}function u(c,d){n.$$.not_equal(o[d.key].duration,c)&&(o[d.key].duration=c,t(0,o))}function f(c,d){n.$$.not_equal(o[d.key].secret,c)&&(o[d.key].secret=c,t(0,o))}return n.$$set=c=>{"collection"in c&&t(0,o=c.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(3,i=(o==null?void 0:o.system)&&(o==null?void 0:o.name)==="_superusers"),n.$$.dirty&8&&t(1,r=i?[{key:"authToken",label:"Auth"},{key:"passwordResetToken",label:"Password reset"},{key:"fileToken",label:"Protected file access"}]:[{key:"authToken",label:"Auth"},{key:"verificationToken",label:"Email verification"},{key:"passwordResetToken",label:"Password reset"},{key:"emailChangeToken",label:"Email change"},{key:"fileToken",label:"Protected file access"}]),n.$$.dirty&16&&t(2,l=a(s))},[o,r,l,i,s,u,f]}class s5 extends Se{constructor(e){super(),we(this,e,l5,i5,ke,{collection:0})}}const o5=n=>({isSuperuserOnly:n&2048}),Fp=n=>({isSuperuserOnly:n[11]}),r5=n=>({isSuperuserOnly:n&2048}),qp=n=>({isSuperuserOnly:n[11]}),a5=n=>({isSuperuserOnly:n&2048}),Hp=n=>({isSuperuserOnly:n[11]});function u5(n){let e,t;return e=new fe({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[11]?"disabled":""),name:n[3],$$slots:{default:[c5,({uniqueId:i})=>({21:i}),({uniqueId:i})=>i?2097152:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&2064&&(s.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[11]?"disabled":"")),l&8&&(s.name=i[3]),l&2362855&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function f5(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","txt-center")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function jp(n){let e,t,i,l,s,o;return{c(){e=b("button"),t=b("i"),i=C(),l=b("span"),l.textContent="Set Superusers only",p(t,"class","ri-lock-line"),p(t,"aria-hidden","true"),p(l,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-hint lock-toggle svelte-dnx4io"),p(e,"aria-hidden",n[10]),e.disabled=n[10]},m(r,a){v(r,e,a),w(e,t),w(e,i),w(e,l),s||(o=W(e,"click",n[13]),s=!0)},p(r,a){a&1024&&p(e,"aria-hidden",r[10]),a&1024&&(e.disabled=r[10])},d(r){r&&y(e),s=!1,o()}}}function zp(n){let e,t,i,l,s,o,r,a=!n[10]&&Up();return{c(){e=b("button"),a&&a.c(),t=C(),i=b("div"),i.innerHTML='',p(i,"class","icon svelte-dnx4io"),p(i,"aria-hidden","true"),p(e,"type","button"),p(e,"class","unlock-overlay svelte-dnx4io"),e.disabled=n[10],p(e,"aria-hidden",n[10])},m(u,f){v(u,e,f),a&&a.m(e,null),w(e,t),w(e,i),s=!0,o||(r=W(e,"click",n[12]),o=!0)},p(u,f){u[10]?a&&(a.d(1),a=null):a||(a=Up(),a.c(),a.m(e,t)),(!s||f&1024)&&(e.disabled=u[10]),(!s||f&1024)&&p(e,"aria-hidden",u[10])},i(u){s||(u&&tt(()=>{s&&(l||(l=He(e,$t,{duration:150,start:.98},!0)),l.run(1))}),s=!0)},o(u){u&&(l||(l=He(e,$t,{duration:150,start:.98},!1)),l.run(0)),s=!1},d(u){u&&y(e),a&&a.d(),u&&l&&l.end(),o=!1,r()}}}function Up(n){let e;return{c(){e=b("small"),e.textContent="Unlock and set custom rule",p(e,"class","txt svelte-dnx4io")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function c5(n){let e,t,i,l,s,o,r=n[11]?"- Superusers only":"",a,u,f,c,d,m,h,g,_,k,S,$,T,O;const E=n[15].beforeLabel,L=Lt(E,n,n[18],Hp),I=n[15].afterLabel,A=Lt(I,n,n[18],qp);let P=n[5]&&!n[11]&&jp(n);function N(Y){n[17](Y)}var R=n[8];function z(Y,Z){let G={id:Y[21],baseCollection:Y[1],disabled:Y[10]||Y[11],placeholder:Y[11]?"":Y[6]};return Y[0]!==void 0&&(G.value=Y[0]),{props:G}}R&&(m=zt(R,z(n)),n[16](m),ie.push(()=>be(m,"value",N)));let F=n[5]&&n[11]&&zp(n);const U=n[15].default,J=Lt(U,n,n[18],Fp);return{c(){e=b("div"),t=b("label"),L&&L.c(),i=C(),l=b("span"),s=B(n[2]),o=C(),a=B(r),u=C(),A&&A.c(),f=C(),P&&P.c(),d=C(),m&&j(m.$$.fragment),g=C(),F&&F.c(),k=C(),S=b("div"),J&&J.c(),p(l,"class","txt"),ee(l,"txt-hint",n[11]),p(t,"for",c=n[21]),p(e,"class","input-wrapper svelte-dnx4io"),p(S,"class","help-block")},m(Y,Z){v(Y,e,Z),w(e,t),L&&L.m(t,null),w(t,i),w(t,l),w(l,s),w(l,o),w(l,a),w(t,u),A&&A.m(t,null),w(t,f),P&&P.m(t,null),w(e,d),m&&q(m,e,null),w(e,g),F&&F.m(e,null),v(Y,k,Z),v(Y,S,Z),J&&J.m(S,null),$=!0,T||(O=Oe(_=qe.call(null,e,n[1].system?{text:"System collection rule cannot be changed.",position:"top"}:void 0)),T=!0)},p(Y,Z){if(L&&L.p&&(!$||Z&264192)&&Pt(L,E,Y,Y[18],$?At(E,Y[18],Z,a5):Nt(Y[18]),Hp),(!$||Z&4)&&oe(s,Y[2]),(!$||Z&2048)&&r!==(r=Y[11]?"- Superusers only":"")&&oe(a,r),(!$||Z&2048)&&ee(l,"txt-hint",Y[11]),A&&A.p&&(!$||Z&264192)&&Pt(A,I,Y,Y[18],$?At(I,Y[18],Z,r5):Nt(Y[18]),qp),Y[5]&&!Y[11]?P?P.p(Y,Z):(P=jp(Y),P.c(),P.m(t,null)):P&&(P.d(1),P=null),(!$||Z&2097152&&c!==(c=Y[21]))&&p(t,"for",c),Z&256&&R!==(R=Y[8])){if(m){re();const G=m;D(G.$$.fragment,1,0,()=>{H(G,1)}),ae()}R?(m=zt(R,z(Y)),Y[16](m),ie.push(()=>be(m,"value",N)),j(m.$$.fragment),M(m.$$.fragment,1),q(m,e,g)):m=null}else if(R){const G={};Z&2097152&&(G.id=Y[21]),Z&2&&(G.baseCollection=Y[1]),Z&3072&&(G.disabled=Y[10]||Y[11]),Z&2112&&(G.placeholder=Y[11]?"":Y[6]),!h&&Z&1&&(h=!0,G.value=Y[0],$e(()=>h=!1)),m.$set(G)}Y[5]&&Y[11]?F?(F.p(Y,Z),Z&2080&&M(F,1)):(F=zp(Y),F.c(),M(F,1),F.m(e,null)):F&&(re(),D(F,1,1,()=>{F=null}),ae()),_&&It(_.update)&&Z&2&&_.update.call(null,Y[1].system?{text:"System collection rule cannot be changed.",position:"top"}:void 0),J&&J.p&&(!$||Z&264192)&&Pt(J,U,Y,Y[18],$?At(U,Y[18],Z,o5):Nt(Y[18]),Fp)},i(Y){$||(M(L,Y),M(A,Y),m&&M(m.$$.fragment,Y),M(F),M(J,Y),$=!0)},o(Y){D(L,Y),D(A,Y),m&&D(m.$$.fragment,Y),D(F),D(J,Y),$=!1},d(Y){Y&&(y(e),y(k),y(S)),L&&L.d(Y),A&&A.d(Y),P&&P.d(),n[16](null),m&&H(m),F&&F.d(),J&&J.d(Y),T=!1,O()}}}function d5(n){let e,t,i,l;const s=[f5,u5],o=[];function r(a,u){return a[9]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),v(a,i,u),l=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),D(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&y(i),o[e].d(a)}}}let Vp;function p5(n,e,t){let i,l,{$$slots:s={},$$scope:o}=e,{collection:r=null}=e,{rule:a=null}=e,{label:u="Rule"}=e,{formKey:f="rule"}=e,{required:c=!1}=e,{disabled:d=!1}=e,{superuserToggle:m=!0}=e,{placeholder:h="Leave empty to grant everyone access..."}=e,g=null,_=null,k=Vp,S=!1;$();async function $(){k||S||(t(9,S=!0),t(8,k=(await Tt(async()=>{const{default:I}=await import("./FilterAutocompleteInput-Ek7e14PX.js");return{default:I}},__vite__mapDeps([0,1]),import.meta.url)).default),Vp=k,t(9,S=!1))}async function T(){t(0,a=_||""),await dn(),g==null||g.focus()}function O(){_=a,t(0,a=null)}function E(I){ie[I?"unshift":"push"](()=>{g=I,t(7,g)})}function L(I){a=I,t(0,a)}return n.$$set=I=>{"collection"in I&&t(1,r=I.collection),"rule"in I&&t(0,a=I.rule),"label"in I&&t(2,u=I.label),"formKey"in I&&t(3,f=I.formKey),"required"in I&&t(4,c=I.required),"disabled"in I&&t(14,d=I.disabled),"superuserToggle"in I&&t(5,m=I.superuserToggle),"placeholder"in I&&t(6,h=I.placeholder),"$$scope"in I&&t(18,o=I.$$scope)},n.$$.update=()=>{n.$$.dirty&33&&t(11,i=m&&a===null),n.$$.dirty&16386&&t(10,l=d||r.system)},[a,r,u,f,c,m,h,g,k,S,l,i,T,O,d,s,E,L,o]}class il extends Se{constructor(e){super(),we(this,e,p5,d5,ke,{collection:1,rule:0,label:2,formKey:3,required:4,disabled:14,superuserToggle:5,placeholder:6})}}function m5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=b("span"),s.textContent="Enable",p(e,"type","checkbox"),p(e,"id",t=n[5]),p(s,"class","txt"),p(l,"for",o=n[5])},m(u,f){v(u,e,f),e.checked=n[0].mfa.enabled,v(u,i,f),v(u,l,f),w(l,s),r||(a=W(e,"change",n[3]),r=!0)},p(u,f){f&32&&t!==(t=u[5])&&p(e,"id",t),f&1&&(e.checked=u[0].mfa.enabled),f&32&&o!==(o=u[5])&&p(l,"for",o)},d(u){u&&(y(e),y(i),y(l)),r=!1,a()}}}function h5(n){let e,t,i,l,s;return{c(){e=b("p"),e.textContent="This optional rule could be used to enable/disable MFA per account basis.",t=C(),i=b("p"),i.innerHTML=`For example, to require MFA only for accounts with non-empty email you can set it to - email != ''.`,l=C(),s=b("p"),s.textContent="Leave the rule empty to require MFA for everyone."},m(o,r){v(o,e,r),v(o,t,r),v(o,i,r),v(o,l,r),v(o,s,r)},p:te,d(o){o&&(y(e),y(t),y(i),y(l),y(s))}}}function _5(n){let e,t,i,l,s,o,r,a,u;l=new fe({props:{class:"form-field form-field-toggle",name:"mfa.enabled",$$slots:{default:[m5,({uniqueId:d})=>({5:d}),({uniqueId:d})=>d?32:0]},$$scope:{ctx:n}}});function f(d){n[4](d)}let c={label:"MFA rule",formKey:"mfa.rule",superuserToggle:!1,disabled:!n[0].mfa.enabled,placeholder:"Leave empty to require MFA for everyone",collection:n[0],$$slots:{default:[h5]},$$scope:{ctx:n}};return n[0].mfa.rule!==void 0&&(c.rule=n[0].mfa.rule),r=new il({props:c}),ie.push(()=>be(r,"rule",f)),{c(){e=b("div"),e.innerHTML=`

This feature is experimental and may change in the future.

Multi-factor authentication (MFA) requires the user to authenticate with any 2 different auth + `);for(let s=0;s0&&Dp(n);return{c(){e=b("label"),t=B("Body (HTML)"),l=C(),o.c(),r=C(),m&&m.c(),a=ye(),p(e,"for",i=n[24])},m(g,_){v(g,e,_),w(e,t),v(g,l,_),c[s].m(g,_),v(g,r,_),m&&m.m(g,_),v(g,a,_),u=!0},p(g,_){var S;(!u||_&16777216&&i!==(i=g[24]))&&p(e,"for",i);let k=s;s=d(g),s===k?c[s].p(g,_):(re(),D(c[k],1,1,()=>{c[k]=null}),ae(),o=c[s],o?o.p(g,_):(o=c[s]=f[s](g),o.c()),M(o,1),o.m(r.parentNode,r)),((S=g[3])==null?void 0:S.length)>0?m?m.p(g,_):(m=Dp(g),m.c(),m.m(a.parentNode,a)):m&&(m.d(1),m=null)},i(g){u||(M(o),u=!0)},o(g){D(o),u=!1},d(g){g&&(y(e),y(l),y(r),y(a)),c[s].d(g),m&&m.d(g)}}}function Y6(n){let e,t,i,l;return e=new fe({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[U6,({uniqueId:s})=>({24:s}),({uniqueId:s})=>s?16777216:0]},$$scope:{ctx:n}}}),i=new fe({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[W6,({uniqueId:s})=>({24:s}),({uniqueId:s})=>s?16777216:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(s,o){q(e,s,o),v(s,t,o),q(i,s,o),l=!0},p(s,o){const r={};o&2&&(r.name=s[1]+".subject"),o&1090519049&&(r.$$scope={dirty:o,ctx:s}),e.$set(r);const a={};o&2&&(a.name=s[1]+".body"),o&1090519145&&(a.$$scope={dirty:o,ctx:s}),i.$set(a)},i(s){l||(M(e.$$.fragment,s),M(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&y(t),H(e,s),H(i,s)}}}function Lp(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Oe(qe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,$t,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,$t,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function K6(n){let e,t,i,l,s,o,r,a,u,f=n[7]&&Lp();return{c(){e=b("div"),t=b("i"),i=C(),l=b("span"),s=B(n[2]),o=C(),r=b("div"),a=C(),f&&f.c(),u=ye(),p(t,"class","ri-draft-line"),p(l,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){v(c,e,d),w(e,t),w(e,i),w(e,l),w(l,s),v(c,o,d),v(c,r,d),v(c,a,d),f&&f.m(c,d),v(c,u,d)},p(c,d){d&4&&oe(s,c[2]),c[7]?f?d&128&&M(f,1):(f=Lp(),f.c(),M(f,1),f.m(u.parentNode,u)):f&&(re(),D(f,1,1,()=>{f=null}),ae())},d(c){c&&(y(e),y(o),y(r),y(a),y(u)),f&&f.d(c)}}}function J6(n){let e,t;const i=[n[9]];let l={$$slots:{header:[K6],default:[Y6]},$$scope:{ctx:n}};for(let s=0;st(13,o=R));let{key:r}=e,{title:a}=e,{config:u={}}=e,{placeholders:f=[]}=e,c,d=Ap,m=!1;function h(){c==null||c.expand()}function g(){c==null||c.collapse()}function _(){c==null||c.collapseSiblings()}async function k(){d||m||(t(6,m=!0),t(5,d=(await Tt(async()=>{const{default:R}=await import("./CodeEditor-B_VWhJeL.js");return{default:R}},__vite__mapDeps([12,1]),import.meta.url)).default),Ap=d,t(6,m=!1))}function S(R){R=R.replace("*",""),V.copyToClipboard(R),Ks(`Copied ${R} to clipboard`,2e3)}k();function $(){u.subject=this.value,t(0,u)}const T=R=>S("{"+R+"}");function O(R){n.$$.not_equal(u.body,R)&&(u.body=R,t(0,u))}function E(){u.body=this.value,t(0,u)}const L=R=>S("{"+R+"}");function I(R){ie[R?"unshift":"push"](()=>{c=R,t(4,c)})}function A(R){Pe.call(this,n,R)}function P(R){Pe.call(this,n,R)}function N(R){Pe.call(this,n,R)}return n.$$set=R=>{e=je(je({},e),Wt(R)),t(9,s=lt(e,l)),"key"in R&&t(1,r=R.key),"title"in R&&t(2,a=R.title),"config"in R&&t(0,u=R.config),"placeholders"in R&&t(3,f=R.placeholders)},n.$$.update=()=>{n.$$.dirty&8194&&t(7,i=!V.isEmpty(V.getNestedVal(o,r))),n.$$.dirty&3&&(u.enabled||Yn(r))},[u,r,a,f,c,d,m,i,S,s,h,g,_,o,$,T,O,E,L,I,A,P,N]}class G6 extends Se{constructor(e){super(),we(this,e,Z6,J6,ke,{key:1,title:2,config:0,placeholders:3,expand:10,collapse:11,collapseSiblings:12})}get expand(){return this.$$.ctx[10]}get collapse(){return this.$$.ctx[11]}get collapseSiblings(){return this.$$.ctx[12]}}function X6(n){let e,t,i,l,s,o,r,a,u,f,c,d;return{c(){e=b("label"),t=B(n[3]),i=B(" duration (in seconds)"),s=C(),o=b("input"),a=C(),u=b("div"),f=b("span"),f.textContent="Invalidate all previously issued tokens",p(e,"for",l=n[6]),p(o,"type","number"),p(o,"id",r=n[6]),o.required=!0,p(o,"placeholder","No change"),p(f,"class","link-primary"),ee(f,"txt-success",!!n[1]),p(u,"class","help-block")},m(m,h){v(m,e,h),w(e,t),w(e,i),v(m,s,h),v(m,o,h),he(o,n[0]),v(m,a,h),v(m,u,h),w(u,f),c||(d=[W(o,"input",n[4]),W(f,"click",n[5])],c=!0)},p(m,h){h&8&&oe(t,m[3]),h&64&&l!==(l=m[6])&&p(e,"for",l),h&64&&r!==(r=m[6])&&p(o,"id",r),h&1&>(o.value)!==m[0]&&he(o,m[0]),h&2&&ee(f,"txt-success",!!m[1])},d(m){m&&(y(e),y(s),y(o),y(a),y(u)),c=!1,Ie(d)}}}function Q6(n){let e,t;return e=new fe({props:{class:"form-field required",name:n[2]+".duration",$$slots:{default:[X6,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&4&&(s.name=i[2]+".duration"),l&203&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function x6(n,e,t){let{key:i}=e,{label:l}=e,{duration:s}=e,{secret:o}=e;function r(){s=gt(this.value),t(0,s)}const a=()=>{o?t(1,o=void 0):t(1,o=V.randomSecret(50))};return n.$$set=u=>{"key"in u&&t(2,i=u.key),"label"in u&&t(3,l=u.label),"duration"in u&&t(0,s=u.duration),"secret"in u&&t(1,o=u.secret)},[s,o,i,l,r,a]}class e8 extends Se{constructor(e){super(),we(this,e,x6,Q6,ke,{key:2,label:3,duration:0,secret:1})}}function Pp(n,e,t){const i=n.slice();return i[8]=e[t],i[9]=e,i[10]=t,i}function Np(n,e){let t,i,l,s,o,r;function a(c){e[5](c,e[8])}function u(c){e[6](c,e[8])}let f={key:e[8].key,label:e[8].label};return e[0][e[8].key].duration!==void 0&&(f.duration=e[0][e[8].key].duration),e[0][e[8].key].secret!==void 0&&(f.secret=e[0][e[8].key].secret),i=new e8({props:f}),ie.push(()=>be(i,"duration",a)),ie.push(()=>be(i,"secret",u)),{key:n,first:null,c(){t=b("div"),j(i.$$.fragment),o=C(),p(t,"class","col-sm-6"),this.first=t},m(c,d){v(c,t,d),q(i,t,null),w(t,o),r=!0},p(c,d){e=c;const m={};d&2&&(m.key=e[8].key),d&2&&(m.label=e[8].label),!l&&d&3&&(l=!0,m.duration=e[0][e[8].key].duration,$e(()=>l=!1)),!s&&d&3&&(s=!0,m.secret=e[0][e[8].key].secret,$e(()=>s=!1)),i.$set(m)},i(c){r||(M(i.$$.fragment,c),r=!0)},o(c){D(i.$$.fragment,c),r=!1},d(c){c&&y(t),H(i)}}}function t8(n){let e,t=[],i=new Map,l,s=de(n[1]);const o=r=>r[8].key;for(let r=0;r{i&&(t||(t=He(e,$t,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,$t,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function n8(n){let e,t,i,l,s,o=n[2]&&Rp();return{c(){e=b("div"),e.innerHTML=' Tokens options (invalidate, duration)',t=C(),i=b("div"),l=C(),o&&o.c(),s=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(r,a){v(r,e,a),v(r,t,a),v(r,i,a),v(r,l,a),o&&o.m(r,a),v(r,s,a)},p(r,a){r[2]?o?a&4&&M(o,1):(o=Rp(),o.c(),M(o,1),o.m(s.parentNode,s)):o&&(re(),D(o,1,1,()=>{o=null}),ae())},d(r){r&&(y(e),y(t),y(i),y(l),y(s)),o&&o.d(r)}}}function i8(n){let e,t;return e=new ji({props:{single:!0,$$slots:{header:[n8],default:[t8]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2055&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function l8(n,e,t){let i,l,s;Qe(n,yn,c=>t(4,s=c));let{collection:o}=e,r=[];function a(c){if(V.isEmpty(c))return!1;for(let d of r)if(c[d.key])return!0;return!1}function u(c,d){n.$$.not_equal(o[d.key].duration,c)&&(o[d.key].duration=c,t(0,o))}function f(c,d){n.$$.not_equal(o[d.key].secret,c)&&(o[d.key].secret=c,t(0,o))}return n.$$set=c=>{"collection"in c&&t(0,o=c.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(3,i=(o==null?void 0:o.system)&&(o==null?void 0:o.name)==="_superusers"),n.$$.dirty&8&&t(1,r=i?[{key:"authToken",label:"Auth"},{key:"passwordResetToken",label:"Password reset"},{key:"fileToken",label:"Protected file access"}]:[{key:"authToken",label:"Auth"},{key:"verificationToken",label:"Email verification"},{key:"passwordResetToken",label:"Password reset"},{key:"emailChangeToken",label:"Email change"},{key:"fileToken",label:"Protected file access"}]),n.$$.dirty&16&&t(2,l=a(s))},[o,r,l,i,s,u,f]}class s8 extends Se{constructor(e){super(),we(this,e,l8,i8,ke,{collection:0})}}const o8=n=>({isSuperuserOnly:n&2048}),Fp=n=>({isSuperuserOnly:n[11]}),r8=n=>({isSuperuserOnly:n&2048}),qp=n=>({isSuperuserOnly:n[11]}),a8=n=>({isSuperuserOnly:n&2048}),Hp=n=>({isSuperuserOnly:n[11]});function u8(n){let e,t;return e=new fe({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[11]?"disabled":""),name:n[3],$$slots:{default:[c8,({uniqueId:i})=>({21:i}),({uniqueId:i})=>i?2097152:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&2064&&(s.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[11]?"disabled":"")),l&8&&(s.name=i[3]),l&2362855&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function f8(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","txt-center")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function jp(n){let e,t,i,l,s,o;return{c(){e=b("button"),t=b("i"),i=C(),l=b("span"),l.textContent="Set Superusers only",p(t,"class","ri-lock-line"),p(t,"aria-hidden","true"),p(l,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-hint lock-toggle svelte-dnx4io"),p(e,"aria-hidden",n[10]),e.disabled=n[10]},m(r,a){v(r,e,a),w(e,t),w(e,i),w(e,l),s||(o=W(e,"click",n[13]),s=!0)},p(r,a){a&1024&&p(e,"aria-hidden",r[10]),a&1024&&(e.disabled=r[10])},d(r){r&&y(e),s=!1,o()}}}function zp(n){let e,t,i,l,s,o,r,a=!n[10]&&Up();return{c(){e=b("button"),a&&a.c(),t=C(),i=b("div"),i.innerHTML='',p(i,"class","icon svelte-dnx4io"),p(i,"aria-hidden","true"),p(e,"type","button"),p(e,"class","unlock-overlay svelte-dnx4io"),e.disabled=n[10],p(e,"aria-hidden",n[10])},m(u,f){v(u,e,f),a&&a.m(e,null),w(e,t),w(e,i),s=!0,o||(r=W(e,"click",n[12]),o=!0)},p(u,f){u[10]?a&&(a.d(1),a=null):a||(a=Up(),a.c(),a.m(e,t)),(!s||f&1024)&&(e.disabled=u[10]),(!s||f&1024)&&p(e,"aria-hidden",u[10])},i(u){s||(u&&tt(()=>{s&&(l||(l=He(e,$t,{duration:150,start:.98},!0)),l.run(1))}),s=!0)},o(u){u&&(l||(l=He(e,$t,{duration:150,start:.98},!1)),l.run(0)),s=!1},d(u){u&&y(e),a&&a.d(),u&&l&&l.end(),o=!1,r()}}}function Up(n){let e;return{c(){e=b("small"),e.textContent="Unlock and set custom rule",p(e,"class","txt svelte-dnx4io")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function c8(n){let e,t,i,l,s,o,r=n[11]?"- Superusers only":"",a,u,f,c,d,m,h,g,_,k,S,$,T,O;const E=n[15].beforeLabel,L=Lt(E,n,n[18],Hp),I=n[15].afterLabel,A=Lt(I,n,n[18],qp);let P=n[5]&&!n[11]&&jp(n);function N(Y){n[17](Y)}var R=n[8];function z(Y,Z){let G={id:Y[21],baseCollection:Y[1],disabled:Y[10]||Y[11],placeholder:Y[11]?"":Y[6]};return Y[0]!==void 0&&(G.value=Y[0]),{props:G}}R&&(m=zt(R,z(n)),n[16](m),ie.push(()=>be(m,"value",N)));let F=n[5]&&n[11]&&zp(n);const U=n[15].default,J=Lt(U,n,n[18],Fp);return{c(){e=b("div"),t=b("label"),L&&L.c(),i=C(),l=b("span"),s=B(n[2]),o=C(),a=B(r),u=C(),A&&A.c(),f=C(),P&&P.c(),d=C(),m&&j(m.$$.fragment),g=C(),F&&F.c(),k=C(),S=b("div"),J&&J.c(),p(l,"class","txt"),ee(l,"txt-hint",n[11]),p(t,"for",c=n[21]),p(e,"class","input-wrapper svelte-dnx4io"),p(S,"class","help-block")},m(Y,Z){v(Y,e,Z),w(e,t),L&&L.m(t,null),w(t,i),w(t,l),w(l,s),w(l,o),w(l,a),w(t,u),A&&A.m(t,null),w(t,f),P&&P.m(t,null),w(e,d),m&&q(m,e,null),w(e,g),F&&F.m(e,null),v(Y,k,Z),v(Y,S,Z),J&&J.m(S,null),$=!0,T||(O=Oe(_=qe.call(null,e,n[1].system?{text:"System collection rule cannot be changed.",position:"top"}:void 0)),T=!0)},p(Y,Z){if(L&&L.p&&(!$||Z&264192)&&Pt(L,E,Y,Y[18],$?At(E,Y[18],Z,a8):Nt(Y[18]),Hp),(!$||Z&4)&&oe(s,Y[2]),(!$||Z&2048)&&r!==(r=Y[11]?"- Superusers only":"")&&oe(a,r),(!$||Z&2048)&&ee(l,"txt-hint",Y[11]),A&&A.p&&(!$||Z&264192)&&Pt(A,I,Y,Y[18],$?At(I,Y[18],Z,r8):Nt(Y[18]),qp),Y[5]&&!Y[11]?P?P.p(Y,Z):(P=jp(Y),P.c(),P.m(t,null)):P&&(P.d(1),P=null),(!$||Z&2097152&&c!==(c=Y[21]))&&p(t,"for",c),Z&256&&R!==(R=Y[8])){if(m){re();const G=m;D(G.$$.fragment,1,0,()=>{H(G,1)}),ae()}R?(m=zt(R,z(Y)),Y[16](m),ie.push(()=>be(m,"value",N)),j(m.$$.fragment),M(m.$$.fragment,1),q(m,e,g)):m=null}else if(R){const G={};Z&2097152&&(G.id=Y[21]),Z&2&&(G.baseCollection=Y[1]),Z&3072&&(G.disabled=Y[10]||Y[11]),Z&2112&&(G.placeholder=Y[11]?"":Y[6]),!h&&Z&1&&(h=!0,G.value=Y[0],$e(()=>h=!1)),m.$set(G)}Y[5]&&Y[11]?F?(F.p(Y,Z),Z&2080&&M(F,1)):(F=zp(Y),F.c(),M(F,1),F.m(e,null)):F&&(re(),D(F,1,1,()=>{F=null}),ae()),_&&It(_.update)&&Z&2&&_.update.call(null,Y[1].system?{text:"System collection rule cannot be changed.",position:"top"}:void 0),J&&J.p&&(!$||Z&264192)&&Pt(J,U,Y,Y[18],$?At(U,Y[18],Z,o8):Nt(Y[18]),Fp)},i(Y){$||(M(L,Y),M(A,Y),m&&M(m.$$.fragment,Y),M(F),M(J,Y),$=!0)},o(Y){D(L,Y),D(A,Y),m&&D(m.$$.fragment,Y),D(F),D(J,Y),$=!1},d(Y){Y&&(y(e),y(k),y(S)),L&&L.d(Y),A&&A.d(Y),P&&P.d(),n[16](null),m&&H(m),F&&F.d(),J&&J.d(Y),T=!1,O()}}}function d8(n){let e,t,i,l;const s=[f8,u8],o=[];function r(a,u){return a[9]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),v(a,i,u),l=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),D(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&y(i),o[e].d(a)}}}let Vp;function p8(n,e,t){let i,l,{$$slots:s={},$$scope:o}=e,{collection:r=null}=e,{rule:a=null}=e,{label:u="Rule"}=e,{formKey:f="rule"}=e,{required:c=!1}=e,{disabled:d=!1}=e,{superuserToggle:m=!0}=e,{placeholder:h="Leave empty to grant everyone access..."}=e,g=null,_=null,k=Vp,S=!1;$();async function $(){k||S||(t(9,S=!0),t(8,k=(await Tt(async()=>{const{default:I}=await import("./FilterAutocompleteInput-DNssmiMR.js");return{default:I}},__vite__mapDeps([0,1]),import.meta.url)).default),Vp=k,t(9,S=!1))}async function T(){t(0,a=_||""),await dn(),g==null||g.focus()}function O(){_=a,t(0,a=null)}function E(I){ie[I?"unshift":"push"](()=>{g=I,t(7,g)})}function L(I){a=I,t(0,a)}return n.$$set=I=>{"collection"in I&&t(1,r=I.collection),"rule"in I&&t(0,a=I.rule),"label"in I&&t(2,u=I.label),"formKey"in I&&t(3,f=I.formKey),"required"in I&&t(4,c=I.required),"disabled"in I&&t(14,d=I.disabled),"superuserToggle"in I&&t(5,m=I.superuserToggle),"placeholder"in I&&t(6,h=I.placeholder),"$$scope"in I&&t(18,o=I.$$scope)},n.$$.update=()=>{n.$$.dirty&33&&t(11,i=m&&a===null),n.$$.dirty&16386&&t(10,l=d||r.system)},[a,r,u,f,c,m,h,g,k,S,l,i,T,O,d,s,E,L,o]}class il extends Se{constructor(e){super(),we(this,e,p8,d8,ke,{collection:1,rule:0,label:2,formKey:3,required:4,disabled:14,superuserToggle:5,placeholder:6})}}function m8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=b("span"),s.textContent="Enable",p(e,"type","checkbox"),p(e,"id",t=n[5]),p(s,"class","txt"),p(l,"for",o=n[5])},m(u,f){v(u,e,f),e.checked=n[0].mfa.enabled,v(u,i,f),v(u,l,f),w(l,s),r||(a=W(e,"change",n[3]),r=!0)},p(u,f){f&32&&t!==(t=u[5])&&p(e,"id",t),f&1&&(e.checked=u[0].mfa.enabled),f&32&&o!==(o=u[5])&&p(l,"for",o)},d(u){u&&(y(e),y(i),y(l)),r=!1,a()}}}function h8(n){let e,t,i,l,s;return{c(){e=b("p"),e.textContent="This optional rule could be used to enable/disable MFA per account basis.",t=C(),i=b("p"),i.innerHTML=`For example, to require MFA only for accounts with non-empty email you can set it to + email != ''.`,l=C(),s=b("p"),s.textContent="Leave the rule empty to require MFA for everyone."},m(o,r){v(o,e,r),v(o,t,r),v(o,i,r),v(o,l,r),v(o,s,r)},p:te,d(o){o&&(y(e),y(t),y(i),y(l),y(s))}}}function _8(n){let e,t,i,l,s,o,r,a,u;l=new fe({props:{class:"form-field form-field-toggle",name:"mfa.enabled",$$slots:{default:[m8,({uniqueId:d})=>({5:d}),({uniqueId:d})=>d?32:0]},$$scope:{ctx:n}}});function f(d){n[4](d)}let c={label:"MFA rule",formKey:"mfa.rule",superuserToggle:!1,disabled:!n[0].mfa.enabled,placeholder:"Leave empty to require MFA for everyone",collection:n[0],$$slots:{default:[h8]},$$scope:{ctx:n}};return n[0].mfa.rule!==void 0&&(c.rule=n[0].mfa.rule),r=new il({props:c}),ie.push(()=>be(r,"rule",f)),{c(){e=b("div"),e.innerHTML=`

This feature is experimental and may change in the future.

Multi-factor authentication (MFA) requires the user to authenticate with any 2 different auth methods (otp, identity/password, oauth2) before issuing an auth token. - (Learn more) .

`,t=C(),i=b("div"),j(l.$$.fragment),s=C(),o=b("div"),j(r.$$.fragment),p(e,"class","content m-b-sm"),p(o,"class","content"),ee(o,"fade",!n[0].mfa.enabled),p(i,"class","grid")},m(d,m){v(d,e,m),v(d,t,m),v(d,i,m),q(l,i,null),w(i,s),w(i,o),q(r,o,null),u=!0},p(d,m){const h={};m&97&&(h.$$scope={dirty:m,ctx:d}),l.$set(h);const g={};m&1&&(g.disabled=!d[0].mfa.enabled),m&1&&(g.collection=d[0]),m&64&&(g.$$scope={dirty:m,ctx:d}),!a&&m&1&&(a=!0,g.rule=d[0].mfa.rule,$e(()=>a=!1)),r.$set(g),(!u||m&1)&&ee(o,"fade",!d[0].mfa.enabled)},i(d){u||(M(l.$$.fragment,d),M(r.$$.fragment,d),u=!0)},o(d){D(l.$$.fragment,d),D(r.$$.fragment,d),u=!1},d(d){d&&(y(e),y(t),y(i)),H(l),H(r)}}}function g5(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function b5(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function Bp(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Oe(qe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,$t,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,$t,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function k5(n){let e,t,i,l,s,o;function r(c,d){return c[0].mfa.enabled?b5:g5}let a=r(n),u=a(n),f=n[1]&&Bp();return{c(){e=b("div"),e.innerHTML=' Multi-factor authentication (MFA)',t=C(),i=b("div"),l=C(),u.c(),s=C(),f&&f.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){v(c,e,d),v(c,t,d),v(c,i,d),v(c,l,d),u.m(c,d),v(c,s,d),f&&f.m(c,d),v(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(s.parentNode,s))),c[1]?f?d&2&&M(f,1):(f=Bp(),f.c(),M(f,1),f.m(o.parentNode,o)):f&&(re(),D(f,1,1,()=>{f=null}),ae())},d(c){c&&(y(e),y(t),y(i),y(l),y(s),y(o)),u.d(c),f&&f.d(c)}}}function y5(n){let e,t;return e=new ji({props:{single:!0,$$slots:{header:[k5],default:[_5]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&67&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function v5(n,e,t){let i,l;Qe(n,yn,a=>t(2,l=a));let{collection:s}=e;function o(){s.mfa.enabled=this.checked,t(0,s)}function r(a){n.$$.not_equal(s.mfa.rule,a)&&(s.mfa.rule=a,t(0,s))}return n.$$set=a=>{"collection"in a&&t(0,s=a.collection)},n.$$.update=()=>{n.$$.dirty&4&&t(1,i=!V.isEmpty(l==null?void 0:l.mfa))},[s,i,l,o,r]}class w5 extends Se{constructor(e){super(),we(this,e,v5,y5,ke,{collection:0})}}const S5=n=>({}),Wp=n=>({});function Yp(n,e,t){const i=n.slice();return i[50]=e[t],i}const T5=n=>({}),Kp=n=>({});function Jp(n,e,t){const i=n.slice();return i[50]=e[t],i[54]=t,i}function Zp(n){let e,t,i;return{c(){e=b("div"),t=B(n[2]),i=C(),p(e,"class","block txt-placeholder"),ee(e,"link-hint",!n[5]&&!n[6])},m(l,s){v(l,e,s),w(e,t),w(e,i)},p(l,s){s[0]&4&&oe(t,l[2]),s[0]&96&&ee(e,"link-hint",!l[5]&&!l[6])},d(l){l&&y(e)}}}function $5(n){let e,t=n[50]+"",i;return{c(){e=b("span"),i=B(t),p(e,"class","txt")},m(l,s){v(l,e,s),w(e,i)},p(l,s){s[0]&1&&t!==(t=l[50]+"")&&oe(i,t)},i:te,o:te,d(l){l&&y(e)}}}function C5(n){let e,t,i;const l=[{item:n[50]},n[11]];var s=n[10];function o(r,a){let u={};for(let f=0;f{H(u,1)}),ae()}s?(e=zt(s,o(r,a)),j(e.$$.fragment),M(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(s){const u=a[0]&2049?wt(l,[a[0]&1&&{item:r[50]},a[0]&2048&&Rt(r[11])]):{};e.$set(u)}},i(r){i||(e&&M(e.$$.fragment,r),i=!0)},o(r){e&&D(e.$$.fragment,r),i=!1},d(r){r&&y(t),e&&H(e,r)}}}function Gp(n){let e,t,i;function l(){return n[37](n[50])}return{c(){e=b("span"),e.innerHTML='',p(e,"class","clear")},m(s,o){v(s,e,o),t||(i=[Oe(qe.call(null,e,"Clear")),W(e,"click",On(nt(l)))],t=!0)},p(s,o){n=s},d(s){s&&y(e),t=!1,Ie(i)}}}function Xp(n){let e,t,i,l,s,o;const r=[C5,$5],a=[];function u(c,d){return c[10]?0:1}t=u(n),i=a[t]=r[t](n);let f=(n[4]||n[8])&&Gp(n);return{c(){e=b("div"),i.c(),l=C(),f&&f.c(),s=C(),p(e,"class","option")},m(c,d){v(c,e,d),a[t].m(e,null),w(e,l),f&&f.m(e,null),w(e,s),o=!0},p(c,d){let m=t;t=u(c),t===m?a[t].p(c,d):(re(),D(a[m],1,1,()=>{a[m]=null}),ae(),i=a[t],i?i.p(c,d):(i=a[t]=r[t](c),i.c()),M(i,1),i.m(e,l)),c[4]||c[8]?f?f.p(c,d):(f=Gp(c),f.c(),f.m(e,s)):f&&(f.d(1),f=null)},i(c){o||(M(i),o=!0)},o(c){D(i),o=!1},d(c){c&&y(e),a[t].d(),f&&f.d()}}}function Qp(n){let e,t,i={class:"dropdown dropdown-block options-dropdown dropdown-left "+(n[7]?"dropdown-upside":""),trigger:n[20],$$slots:{default:[E5]},$$scope:{ctx:n}};return e=new jn({props:i}),n[42](e),e.$on("show",n[26]),e.$on("hide",n[43]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,s){const o={};s[0]&128&&(o.class="dropdown dropdown-block options-dropdown dropdown-left "+(l[7]?"dropdown-upside":"")),s[0]&1048576&&(o.trigger=l[20]),s[0]&6451722|s[1]&16384&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[42](null),H(e,l)}}}function xp(n){let e,t,i,l,s,o,r,a,u=n[17].length&&em(n);return{c(){e=b("div"),t=b("label"),i=b("div"),i.innerHTML='',l=C(),s=b("input"),o=C(),u&&u.c(),p(i,"class","addon p-r-0"),s.autofocus=!0,p(s,"type","text"),p(s,"placeholder",n[3]),p(t,"class","input-group"),p(e,"class","form-field form-field-sm options-search")},m(f,c){v(f,e,c),w(e,t),w(t,i),w(t,l),w(t,s),he(s,n[17]),w(t,o),u&&u.m(t,null),s.focus(),r||(a=W(s,"input",n[39]),r=!0)},p(f,c){c[0]&8&&p(s,"placeholder",f[3]),c[0]&131072&&s.value!==f[17]&&he(s,f[17]),f[17].length?u?u.p(f,c):(u=em(f),u.c(),u.m(t,null)):u&&(u.d(1),u=null)},d(f){f&&y(e),u&&u.d(),r=!1,a()}}}function em(n){let e,t,i,l;return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-transparent clear"),p(e,"class","addon suffix p-r-5")},m(s,o){v(s,e,o),w(e,t),i||(l=W(t,"click",On(nt(n[23]))),i=!0)},p:te,d(s){s&&y(e),i=!1,l()}}}function tm(n){let e,t=n[1]&&nm(n);return{c(){t&&t.c(),e=ye()},m(i,l){t&&t.m(i,l),v(i,e,l)},p(i,l){i[1]?t?t.p(i,l):(t=nm(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&y(e),t&&t.d(i)}}}function nm(n){let e,t;return{c(){e=b("div"),t=B(n[1]),p(e,"class","txt-missing")},m(i,l){v(i,e,l),w(e,t)},p(i,l){l[0]&2&&oe(t,i[1])},d(i){i&&y(e)}}}function O5(n){let e=n[50]+"",t;return{c(){t=B(e)},m(i,l){v(i,t,l)},p(i,l){l[0]&4194304&&e!==(e=i[50]+"")&&oe(t,e)},i:te,o:te,d(i){i&&y(t)}}}function M5(n){let e,t,i;const l=[{item:n[50]},n[13]];var s=n[12];function o(r,a){let u={};for(let f=0;f{H(u,1)}),ae()}s?(e=zt(s,o(r,a)),j(e.$$.fragment),M(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(s){const u=a[0]&4202496?wt(l,[a[0]&4194304&&{item:r[50]},a[0]&8192&&Rt(r[13])]):{};e.$set(u)}},i(r){i||(e&&M(e.$$.fragment,r),i=!0)},o(r){e&&D(e.$$.fragment,r),i=!1},d(r){r&&y(t),e&&H(e,r)}}}function im(n){let e,t,i,l,s,o,r;const a=[M5,O5],u=[];function f(m,h){return m[12]?0:1}t=f(n),i=u[t]=a[t](n);function c(...m){return n[40](n[50],...m)}function d(...m){return n[41](n[50],...m)}return{c(){e=b("div"),i.c(),l=C(),p(e,"tabindex","0"),p(e,"class","dropdown-item option"),p(e,"role","menuitem"),ee(e,"closable",n[9]),ee(e,"selected",n[21](n[50]))},m(m,h){v(m,e,h),u[t].m(e,null),w(e,l),s=!0,o||(r=[W(e,"click",c),W(e,"keydown",d)],o=!0)},p(m,h){n=m;let g=t;t=f(n),t===g?u[t].p(n,h):(re(),D(u[g],1,1,()=>{u[g]=null}),ae(),i=u[t],i?i.p(n,h):(i=u[t]=a[t](n),i.c()),M(i,1),i.m(e,l)),(!s||h[0]&512)&&ee(e,"closable",n[9]),(!s||h[0]&6291456)&&ee(e,"selected",n[21](n[50]))},i(m){s||(M(i),s=!0)},o(m){D(i),s=!1},d(m){m&&y(e),u[t].d(),o=!1,Ie(r)}}}function E5(n){let e,t,i,l,s,o=n[14]&&xp(n);const r=n[36].beforeOptions,a=Lt(r,n,n[45],Kp);let u=de(n[22]),f=[];for(let g=0;gD(f[g],1,1,()=>{f[g]=null});let d=null;u.length||(d=tm(n));const m=n[36].afterOptions,h=Lt(m,n,n[45],Wp);return{c(){o&&o.c(),e=C(),a&&a.c(),t=C(),i=b("div");for(let g=0;gD(a[d],1,1,()=>{a[d]=null});let f=null;r.length||(f=Zp(n));let c=!n[5]&&!n[6]&&Qp(n);return{c(){e=b("div"),t=b("div");for(let d=0;d{c=null}),ae()),(!o||m[0]&32768&&s!==(s="select "+d[15]))&&p(e,"class",s),(!o||m[0]&32896)&&ee(e,"upside",d[7]),(!o||m[0]&32784)&&ee(e,"multiple",d[4]),(!o||m[0]&32800)&&ee(e,"disabled",d[5]),(!o||m[0]&32832)&&ee(e,"readonly",d[6])},i(d){if(!o){for(let m=0;md?[]:void 0}=e,{selected:k=_()}=e,{toggle:S=d}=e,{closable:$=!0}=e,{labelComponent:T=void 0}=e,{labelComponentProps:O={}}=e,{optionComponent:E=void 0}=e,{optionComponentProps:L={}}=e,{searchable:I=!1}=e,{searchFunc:A=void 0}=e;const P=kt();let{class:N=""}=e,R,z="",F,U;function J(ve){if(V.isEmpty(k))return;let Ce=V.toArray(k);V.inArray(Ce,ve)&&(V.removeByValue(Ce,ve),t(0,k=d?Ce:(Ce==null?void 0:Ce[0])||_())),P("change",{selected:k}),F==null||F.dispatchEvent(new CustomEvent("change",{detail:k,bubbles:!0}))}function Y(ve){if(d){let Ce=V.toArray(k);V.inArray(Ce,ve)||t(0,k=[...Ce,ve])}else t(0,k=ve);P("change",{selected:k}),F==null||F.dispatchEvent(new CustomEvent("change",{detail:k,bubbles:!0}))}function Z(ve){return l(ve)?J(ve):Y(ve)}function G(){t(0,k=_()),P("change",{selected:k}),F==null||F.dispatchEvent(new CustomEvent("change",{detail:k,bubbles:!0}))}function pe(){R!=null&&R.show&&(R==null||R.show())}function ce(){R!=null&&R.hide&&(R==null||R.hide())}function ue(){if(V.isEmpty(k)||V.isEmpty(c))return;let ve=V.toArray(k),Ce=[];for(const ct of ve)V.inArray(c,ct)||Ce.push(ct);if(Ce.length){for(const ct of Ce)V.removeByValue(ve,ct);t(0,k=d?ve:ve[0])}}function Te(){t(17,z="")}function Ke(ve,Ce){ve=ve||[];const ct=A||I5;return ve.filter(Ht=>ct(Ht,Ce))||[]}function Je(ve,Ce){ve.preventDefault(),S&&d?Z(Ce):Y(Ce)}function ft(ve,Ce){(ve.code==="Enter"||ve.code==="Space")&&(Je(ve,Ce),$&&ce())}function et(){Te(),setTimeout(()=>{const ve=F==null?void 0:F.querySelector(".dropdown-item.option.selected");ve&&(ve.focus(),ve.scrollIntoView({block:"nearest"}))},0)}function xe(ve){ve.stopPropagation(),!h&&!m&&(R==null||R.toggle())}Xt(()=>{const ve=document.querySelectorAll(`label[for="${r}"]`);for(const Ce of ve)Ce.addEventListener("click",xe);return()=>{for(const Ce of ve)Ce.removeEventListener("click",xe)}});const We=ve=>J(ve);function at(ve){ie[ve?"unshift":"push"](()=>{U=ve,t(20,U)})}function jt(){z=this.value,t(17,z)}const Ve=(ve,Ce)=>Je(Ce,ve),Ee=(ve,Ce)=>ft(Ce,ve);function st(ve){ie[ve?"unshift":"push"](()=>{R=ve,t(18,R)})}function De(ve){Pe.call(this,n,ve)}function Ye(ve){ie[ve?"unshift":"push"](()=>{F=ve,t(19,F)})}return n.$$set=ve=>{"id"in ve&&t(27,r=ve.id),"noOptionsText"in ve&&t(1,a=ve.noOptionsText),"selectPlaceholder"in ve&&t(2,u=ve.selectPlaceholder),"searchPlaceholder"in ve&&t(3,f=ve.searchPlaceholder),"items"in ve&&t(28,c=ve.items),"multiple"in ve&&t(4,d=ve.multiple),"disabled"in ve&&t(5,m=ve.disabled),"readonly"in ve&&t(6,h=ve.readonly),"upside"in ve&&t(7,g=ve.upside),"zeroFunc"in ve&&t(29,_=ve.zeroFunc),"selected"in ve&&t(0,k=ve.selected),"toggle"in ve&&t(8,S=ve.toggle),"closable"in ve&&t(9,$=ve.closable),"labelComponent"in ve&&t(10,T=ve.labelComponent),"labelComponentProps"in ve&&t(11,O=ve.labelComponentProps),"optionComponent"in ve&&t(12,E=ve.optionComponent),"optionComponentProps"in ve&&t(13,L=ve.optionComponentProps),"searchable"in ve&&t(14,I=ve.searchable),"searchFunc"in ve&&t(30,A=ve.searchFunc),"class"in ve&&t(15,N=ve.class),"$$scope"in ve&&t(45,o=ve.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&268435456&&c&&(ue(),Te()),n.$$.dirty[0]&268566528&&t(22,i=Ke(c,z)),n.$$.dirty[0]&1&&t(21,l=function(ve){const Ce=V.toArray(k);return V.inArray(Ce,ve)})},[k,a,u,f,d,m,h,g,S,$,T,O,E,L,I,N,J,z,R,F,U,l,i,Te,Je,ft,et,r,c,_,A,Y,Z,G,pe,ce,s,We,at,jt,Ve,Ee,st,De,Ye,o]}class ps extends Se{constructor(e){super(),we(this,e,L5,D5,ke,{id:27,noOptionsText:1,selectPlaceholder:2,searchPlaceholder:3,items:28,multiple:4,disabled:5,readonly:6,upside:7,zeroFunc:29,selected:0,toggle:8,closable:9,labelComponent:10,labelComponentProps:11,optionComponent:12,optionComponentProps:13,searchable:14,searchFunc:30,class:15,deselectItem:16,selectItem:31,toggleItem:32,reset:33,showDropdown:34,hideDropdown:35},null,[-1,-1])}get deselectItem(){return this.$$.ctx[16]}get selectItem(){return this.$$.ctx[31]}get toggleItem(){return this.$$.ctx[32]}get reset(){return this.$$.ctx[33]}get showDropdown(){return this.$$.ctx[34]}get hideDropdown(){return this.$$.ctx[35]}}function A5(n){let e,t,i,l=[{type:"password"},{autocomplete:"new-password"},n[4]],s={};for(let o=0;o',i=C(),l=b("input"),p(t,"type","button"),p(t,"class","btn btn-transparent btn-circle"),p(e,"class","form-field-addon"),ei(l,a)},m(u,f){v(u,e,f),w(e,t),v(u,i,f),v(u,l,f),l.autofocus&&l.focus(),s||(o=[Oe(qe.call(null,t,{position:"left",text:"Set new value"})),W(t,"click",nt(n[3]))],s=!0)},p(u,f){ei(l,a=wt(r,[{disabled:!0},{type:"text"},{placeholder:"******"},f&16&&u[4]]))},d(u){u&&(y(e),y(i),y(l)),s=!1,Ie(o)}}}function N5(n){let e;function t(s,o){return s[1]?P5:A5}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),v(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:te,o:te,d(s){s&&y(e),l.d(s)}}}function R5(n,e,t){const i=["value","mask"];let l=lt(e,i),{value:s=void 0}=e,{mask:o=!1}=e,r;async function a(){t(0,s=""),t(1,o=!1),await dn(),r==null||r.focus()}function u(c){ie[c?"unshift":"push"](()=>{r=c,t(2,r)})}function f(){s=this.value,t(0,s)}return n.$$set=c=>{e=je(je({},e),Wt(c)),t(4,l=lt(e,i)),"value"in c&&t(0,s=c.value),"mask"in c&&t(1,o=c.mask)},[s,o,r,a,l,u,f]}class ef extends Se{constructor(e){super(),we(this,e,R5,N5,ke,{value:0,mask:1})}}function F5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Client ID"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23])},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[1].clientId),r||(a=W(s,"input",n[14]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(s,"id",o),f&2&&s.value!==u[1].clientId&&he(s,u[1].clientId)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function q5(n){let e,t,i,l,s,o,r,a;function u(d){n[15](d)}function f(d){n[16](d)}let c={id:n[23]};return n[5]!==void 0&&(c.mask=n[5]),n[1].clientSecret!==void 0&&(c.value=n[1].clientSecret),s=new ef({props:c}),ie.push(()=>be(s,"mask",u)),ie.push(()=>be(s,"value",f)),{c(){e=b("label"),t=B("Client secret"),l=C(),j(s.$$.fragment),p(e,"for",i=n[23])},m(d,m){v(d,e,m),w(e,t),v(d,l,m),q(s,d,m),a=!0},p(d,m){(!a||m&8388608&&i!==(i=d[23]))&&p(e,"for",i);const h={};m&8388608&&(h.id=d[23]),!o&&m&32&&(o=!0,h.mask=d[5],$e(()=>o=!1)),!r&&m&2&&(r=!0,h.value=d[1].clientSecret,$e(()=>r=!1)),s.$set(h)},i(d){a||(M(s.$$.fragment,d),a=!0)},o(d){D(s.$$.fragment,d),a=!1},d(d){d&&(y(e),y(l)),H(s,d)}}}function lm(n){let e,t,i,l;const s=[{key:n[6]},n[3].optionsComponentProps||{}];function o(u){n[17](u)}var r=n[3].optionsComponent;function a(u,f){let c={};for(let d=0;dbe(t,"config",o))),{c(){e=b("div"),t&&j(t.$$.fragment),p(e,"class","col-lg-12")},m(u,f){v(u,e,f),t&&q(t,e,null),l=!0},p(u,f){if(f&8&&r!==(r=u[3].optionsComponent)){if(t){re();const c=t;D(c.$$.fragment,1,0,()=>{H(c,1)}),ae()}r?(t=zt(r,a(u,f)),ie.push(()=>be(t,"config",o)),j(t.$$.fragment),M(t.$$.fragment,1),q(t,e,null)):t=null}else if(r){const c=f&72?wt(s,[f&64&&{key:u[6]},f&8&&Rt(u[3].optionsComponentProps||{})]):{};!i&&f&2&&(i=!0,c.config=u[1],$e(()=>i=!1)),t.$set(c)}},i(u){l||(t&&M(t.$$.fragment,u),l=!0)},o(u){t&&D(t.$$.fragment,u),l=!1},d(u){u&&y(e),t&&H(t)}}}function H5(n){let e,t,i,l,s,o,r,a;t=new fe({props:{class:"form-field required",name:n[6]+".clientId",$$slots:{default:[F5,({uniqueId:f})=>({23:f}),({uniqueId:f})=>f?8388608:0]},$$scope:{ctx:n}}}),l=new fe({props:{class:"form-field required",name:n[6]+".clientSecret",$$slots:{default:[q5,({uniqueId:f})=>({23:f}),({uniqueId:f})=>f?8388608:0]},$$scope:{ctx:n}}});let u=n[3].optionsComponent&&lm(n);return{c(){e=b("form"),j(t.$$.fragment),i=C(),j(l.$$.fragment),s=C(),u&&u.c(),p(e,"id",n[8]),p(e,"autocomplete","off")},m(f,c){v(f,e,c),q(t,e,null),w(e,i),q(l,e,null),w(e,s),u&&u.m(e,null),o=!0,r||(a=W(e,"submit",nt(n[18])),r=!0)},p(f,c){const d={};c&64&&(d.name=f[6]+".clientId"),c&25165826&&(d.$$scope={dirty:c,ctx:f}),t.$set(d);const m={};c&64&&(m.name=f[6]+".clientSecret"),c&25165858&&(m.$$scope={dirty:c,ctx:f}),l.$set(m),f[3].optionsComponent?u?(u.p(f,c),c&8&&M(u,1)):(u=lm(f),u.c(),M(u,1),u.m(e,null)):u&&(re(),D(u,1,1,()=>{u=null}),ae())},i(f){o||(M(t.$$.fragment,f),M(l.$$.fragment,f),M(u),o=!0)},o(f){D(t.$$.fragment,f),D(l.$$.fragment,f),D(u),o=!1},d(f){f&&y(e),H(t),H(l),u&&u.d(),r=!1,a()}}}function j5(n){let e;return{c(){e=b("i"),p(e,"class","ri-puzzle-line txt-sm txt-hint")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function z5(n){let e,t,i;return{c(){e=b("img"),bn(e.src,t="./images/oauth2/"+n[3].logo)||p(e,"src",t),p(e,"alt",i=n[3].title+" logo")},m(l,s){v(l,e,s)},p(l,s){s&8&&!bn(e.src,t="./images/oauth2/"+l[3].logo)&&p(e,"src",t),s&8&&i!==(i=l[3].title+" logo")&&p(e,"alt",i)},d(l){l&&y(e)}}}function U5(n){let e,t,i,l=n[3].title+"",s,o,r,a,u=n[3].key+"",f,c;function d(g,_){return g[3].logo?z5:j5}let m=d(n),h=m(n);return{c(){e=b("figure"),h.c(),t=C(),i=b("h4"),s=B(l),o=C(),r=b("small"),a=B("("),f=B(u),c=B(")"),p(e,"class","provider-logo"),p(r,"class","txt-hint"),p(i,"class","center txt-break")},m(g,_){v(g,e,_),h.m(e,null),v(g,t,_),v(g,i,_),w(i,s),w(i,o),w(i,r),w(r,a),w(r,f),w(r,c)},p(g,_){m===(m=d(g))&&h?h.p(g,_):(h.d(1),h=m(g),h&&(h.c(),h.m(e,null))),_&8&&l!==(l=g[3].title+"")&&oe(s,l),_&8&&u!==(u=g[3].key+"")&&oe(f,u)},d(g){g&&(y(e),y(t),y(i)),h.d()}}}function sm(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='',t=C(),i=b("div"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-circle btn-hint btn-sm"),p(e,"aria-label","Remove provider"),p(i,"class","flex-fill")},m(o,r){v(o,e,r),v(o,t,r),v(o,i,r),l||(s=[Oe(qe.call(null,e,{text:"Remove provider",position:"right"})),W(e,"click",n[10])],l=!0)},p:te,d(o){o&&(y(e),y(t),y(i)),l=!1,Ie(s)}}}function V5(n){let e,t,i,l,s,o,r,a,u=!n[4]&&sm(n);return{c(){u&&u.c(),e=C(),t=b("button"),t.textContent="Cancel",i=C(),l=b("button"),s=b("span"),s.textContent="Set provider config",p(t,"type","button"),p(t,"class","btn btn-transparent"),p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[8]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[7]},m(f,c){u&&u.m(f,c),v(f,e,c),v(f,t,c),v(f,i,c),v(f,l,c),w(l,s),r||(a=W(t,"click",n[0]),r=!0)},p(f,c){f[4]?u&&(u.d(1),u=null):u?u.p(f,c):(u=sm(f),u.c(),u.m(e.parentNode,e)),c&128&&o!==(o=!f[7])&&(l.disabled=o)},d(f){f&&(y(e),y(t),y(i),y(l)),u&&u.d(f),r=!1,a()}}}function B5(n){let e,t,i={btnClose:!1,$$slots:{footer:[V5],header:[U5],default:[H5]},$$scope:{ctx:n}};return e=new Qt({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&16777466&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[19](null),H(e,l)}}}function W5(n,e,t){let i,l;const s=kt(),o="provider_popup_"+V.randomString(5);let r,a={},u={},f=!1,c="",d=!1,m=0;function h(P,N,R){t(13,m=R||0),t(4,f=V.isEmpty(N)),t(3,a=Object.assign({},P)),t(1,u=Object.assign({},N)),t(5,d=!!u.clientId),t(12,c=JSON.stringify(u)),r==null||r.show()}function g(){Yn(l),r==null||r.hide()}async function _(){s("submit",{uiOptions:a,config:u}),g()}async function k(){_n(`Do you really want to remove the "${a.title}" OAuth2 provider from the collection?`,()=>{s("remove",{uiOptions:a}),g()})}function S(){u.clientId=this.value,t(1,u)}function $(P){d=P,t(5,d)}function T(P){n.$$.not_equal(u.clientSecret,P)&&(u.clientSecret=P,t(1,u))}function O(P){u=P,t(1,u)}const E=()=>_();function L(P){ie[P?"unshift":"push"](()=>{r=P,t(2,r)})}function I(P){Pe.call(this,n,P)}function A(P){Pe.call(this,n,P)}return n.$$.update=()=>{n.$$.dirty&4098&&t(7,i=JSON.stringify(u)!=c),n.$$.dirty&8192&&t(6,l="oauth2.providers."+m)},[g,u,r,a,f,d,l,i,o,_,k,h,c,m,S,$,T,O,E,L,I,A]}class Y5 extends Se{constructor(e){super(),we(this,e,W5,B5,ke,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function K5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Client ID"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[2]),r||(a=W(s,"input",n[12]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(s,"id",o),f&4&&s.value!==u[2]&&he(s,u[2])},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function J5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Team ID"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[3]),r||(a=W(s,"input",n[13]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(s,"id",o),f&8&&s.value!==u[3]&&he(s,u[3])},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function Z5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Key ID"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[4]),r||(a=W(s,"input",n[14]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(s,"id",o),f&16&&s.value!==u[4]&&he(s,u[4])},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function G5(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=b("span"),t.textContent="Duration (in seconds)",i=C(),l=b("i"),o=C(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[23]),p(r,"type","number"),p(r,"id",a=n[23]),p(r,"max",ur),r.required=!0},m(c,d){v(c,e,d),w(e,t),w(e,i),w(e,l),v(c,o,d),v(c,r,d),he(r,n[6]),u||(f=[Oe(qe.call(null,l,{text:`Max ${ur} seconds (~${ur/(60*60*24*30)<<0} months).`,position:"top"})),W(r,"input",n[15])],u=!0)},p(c,d){d&8388608&&s!==(s=c[23])&&p(e,"for",s),d&8388608&&a!==(a=c[23])&&p(r,"id",a),d&64&>(r.value)!==c[6]&&he(r,c[6])},d(c){c&&(y(e),y(o),y(r)),u=!1,Ie(f)}}}function X5(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=B("Private key"),l=C(),s=b("textarea"),r=C(),a=b("div"),a.textContent="The key is not stored on the server and it is used only for generating the signed JWT.",p(e,"for",i=n[23]),p(s,"id",o=n[23]),s.required=!0,p(s,"rows","8"),p(s,"placeholder",`-----BEGIN PRIVATE KEY----- + (Learn more) .

`,t=C(),i=b("div"),j(l.$$.fragment),s=C(),o=b("div"),j(r.$$.fragment),p(e,"class","content m-b-sm"),p(o,"class","content"),ee(o,"fade",!n[0].mfa.enabled),p(i,"class","grid")},m(d,m){v(d,e,m),v(d,t,m),v(d,i,m),q(l,i,null),w(i,s),w(i,o),q(r,o,null),u=!0},p(d,m){const h={};m&97&&(h.$$scope={dirty:m,ctx:d}),l.$set(h);const g={};m&1&&(g.disabled=!d[0].mfa.enabled),m&1&&(g.collection=d[0]),m&64&&(g.$$scope={dirty:m,ctx:d}),!a&&m&1&&(a=!0,g.rule=d[0].mfa.rule,$e(()=>a=!1)),r.$set(g),(!u||m&1)&&ee(o,"fade",!d[0].mfa.enabled)},i(d){u||(M(l.$$.fragment,d),M(r.$$.fragment,d),u=!0)},o(d){D(l.$$.fragment,d),D(r.$$.fragment,d),u=!1},d(d){d&&(y(e),y(t),y(i)),H(l),H(r)}}}function g8(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function b8(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function Bp(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Oe(qe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,$t,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,$t,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function k8(n){let e,t,i,l,s,o;function r(c,d){return c[0].mfa.enabled?b8:g8}let a=r(n),u=a(n),f=n[1]&&Bp();return{c(){e=b("div"),e.innerHTML=' Multi-factor authentication (MFA)',t=C(),i=b("div"),l=C(),u.c(),s=C(),f&&f.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){v(c,e,d),v(c,t,d),v(c,i,d),v(c,l,d),u.m(c,d),v(c,s,d),f&&f.m(c,d),v(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(s.parentNode,s))),c[1]?f?d&2&&M(f,1):(f=Bp(),f.c(),M(f,1),f.m(o.parentNode,o)):f&&(re(),D(f,1,1,()=>{f=null}),ae())},d(c){c&&(y(e),y(t),y(i),y(l),y(s),y(o)),u.d(c),f&&f.d(c)}}}function y8(n){let e,t;return e=new ji({props:{single:!0,$$slots:{header:[k8],default:[_8]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&67&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function v8(n,e,t){let i,l;Qe(n,yn,a=>t(2,l=a));let{collection:s}=e;function o(){s.mfa.enabled=this.checked,t(0,s)}function r(a){n.$$.not_equal(s.mfa.rule,a)&&(s.mfa.rule=a,t(0,s))}return n.$$set=a=>{"collection"in a&&t(0,s=a.collection)},n.$$.update=()=>{n.$$.dirty&4&&t(1,i=!V.isEmpty(l==null?void 0:l.mfa))},[s,i,l,o,r]}class w8 extends Se{constructor(e){super(),we(this,e,v8,y8,ke,{collection:0})}}const S8=n=>({}),Wp=n=>({});function Yp(n,e,t){const i=n.slice();return i[50]=e[t],i}const T8=n=>({}),Kp=n=>({});function Jp(n,e,t){const i=n.slice();return i[50]=e[t],i[54]=t,i}function Zp(n){let e,t,i;return{c(){e=b("div"),t=B(n[2]),i=C(),p(e,"class","block txt-placeholder"),ee(e,"link-hint",!n[5]&&!n[6])},m(l,s){v(l,e,s),w(e,t),w(e,i)},p(l,s){s[0]&4&&oe(t,l[2]),s[0]&96&&ee(e,"link-hint",!l[5]&&!l[6])},d(l){l&&y(e)}}}function $8(n){let e,t=n[50]+"",i;return{c(){e=b("span"),i=B(t),p(e,"class","txt")},m(l,s){v(l,e,s),w(e,i)},p(l,s){s[0]&1&&t!==(t=l[50]+"")&&oe(i,t)},i:te,o:te,d(l){l&&y(e)}}}function C8(n){let e,t,i;const l=[{item:n[50]},n[11]];var s=n[10];function o(r,a){let u={};for(let f=0;f{H(u,1)}),ae()}s?(e=zt(s,o(r,a)),j(e.$$.fragment),M(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(s){const u=a[0]&2049?wt(l,[a[0]&1&&{item:r[50]},a[0]&2048&&Rt(r[11])]):{};e.$set(u)}},i(r){i||(e&&M(e.$$.fragment,r),i=!0)},o(r){e&&D(e.$$.fragment,r),i=!1},d(r){r&&y(t),e&&H(e,r)}}}function Gp(n){let e,t,i;function l(){return n[37](n[50])}return{c(){e=b("span"),e.innerHTML='',p(e,"class","clear")},m(s,o){v(s,e,o),t||(i=[Oe(qe.call(null,e,"Clear")),W(e,"click",On(nt(l)))],t=!0)},p(s,o){n=s},d(s){s&&y(e),t=!1,Ie(i)}}}function Xp(n){let e,t,i,l,s,o;const r=[C8,$8],a=[];function u(c,d){return c[10]?0:1}t=u(n),i=a[t]=r[t](n);let f=(n[4]||n[8])&&Gp(n);return{c(){e=b("div"),i.c(),l=C(),f&&f.c(),s=C(),p(e,"class","option")},m(c,d){v(c,e,d),a[t].m(e,null),w(e,l),f&&f.m(e,null),w(e,s),o=!0},p(c,d){let m=t;t=u(c),t===m?a[t].p(c,d):(re(),D(a[m],1,1,()=>{a[m]=null}),ae(),i=a[t],i?i.p(c,d):(i=a[t]=r[t](c),i.c()),M(i,1),i.m(e,l)),c[4]||c[8]?f?f.p(c,d):(f=Gp(c),f.c(),f.m(e,s)):f&&(f.d(1),f=null)},i(c){o||(M(i),o=!0)},o(c){D(i),o=!1},d(c){c&&y(e),a[t].d(),f&&f.d()}}}function Qp(n){let e,t,i={class:"dropdown dropdown-block options-dropdown dropdown-left "+(n[7]?"dropdown-upside":""),trigger:n[20],$$slots:{default:[E8]},$$scope:{ctx:n}};return e=new jn({props:i}),n[42](e),e.$on("show",n[26]),e.$on("hide",n[43]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,s){const o={};s[0]&128&&(o.class="dropdown dropdown-block options-dropdown dropdown-left "+(l[7]?"dropdown-upside":"")),s[0]&1048576&&(o.trigger=l[20]),s[0]&6451722|s[1]&16384&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[42](null),H(e,l)}}}function xp(n){let e,t,i,l,s,o,r,a,u=n[17].length&&em(n);return{c(){e=b("div"),t=b("label"),i=b("div"),i.innerHTML='',l=C(),s=b("input"),o=C(),u&&u.c(),p(i,"class","addon p-r-0"),s.autofocus=!0,p(s,"type","text"),p(s,"placeholder",n[3]),p(t,"class","input-group"),p(e,"class","form-field form-field-sm options-search")},m(f,c){v(f,e,c),w(e,t),w(t,i),w(t,l),w(t,s),he(s,n[17]),w(t,o),u&&u.m(t,null),s.focus(),r||(a=W(s,"input",n[39]),r=!0)},p(f,c){c[0]&8&&p(s,"placeholder",f[3]),c[0]&131072&&s.value!==f[17]&&he(s,f[17]),f[17].length?u?u.p(f,c):(u=em(f),u.c(),u.m(t,null)):u&&(u.d(1),u=null)},d(f){f&&y(e),u&&u.d(),r=!1,a()}}}function em(n){let e,t,i,l;return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-transparent clear"),p(e,"class","addon suffix p-r-5")},m(s,o){v(s,e,o),w(e,t),i||(l=W(t,"click",On(nt(n[23]))),i=!0)},p:te,d(s){s&&y(e),i=!1,l()}}}function tm(n){let e,t=n[1]&&nm(n);return{c(){t&&t.c(),e=ye()},m(i,l){t&&t.m(i,l),v(i,e,l)},p(i,l){i[1]?t?t.p(i,l):(t=nm(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&y(e),t&&t.d(i)}}}function nm(n){let e,t;return{c(){e=b("div"),t=B(n[1]),p(e,"class","txt-missing")},m(i,l){v(i,e,l),w(e,t)},p(i,l){l[0]&2&&oe(t,i[1])},d(i){i&&y(e)}}}function O8(n){let e=n[50]+"",t;return{c(){t=B(e)},m(i,l){v(i,t,l)},p(i,l){l[0]&4194304&&e!==(e=i[50]+"")&&oe(t,e)},i:te,o:te,d(i){i&&y(t)}}}function M8(n){let e,t,i;const l=[{item:n[50]},n[13]];var s=n[12];function o(r,a){let u={};for(let f=0;f{H(u,1)}),ae()}s?(e=zt(s,o(r,a)),j(e.$$.fragment),M(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(s){const u=a[0]&4202496?wt(l,[a[0]&4194304&&{item:r[50]},a[0]&8192&&Rt(r[13])]):{};e.$set(u)}},i(r){i||(e&&M(e.$$.fragment,r),i=!0)},o(r){e&&D(e.$$.fragment,r),i=!1},d(r){r&&y(t),e&&H(e,r)}}}function im(n){let e,t,i,l,s,o,r;const a=[M8,O8],u=[];function f(m,h){return m[12]?0:1}t=f(n),i=u[t]=a[t](n);function c(...m){return n[40](n[50],...m)}function d(...m){return n[41](n[50],...m)}return{c(){e=b("div"),i.c(),l=C(),p(e,"tabindex","0"),p(e,"class","dropdown-item option"),p(e,"role","menuitem"),ee(e,"closable",n[9]),ee(e,"selected",n[21](n[50]))},m(m,h){v(m,e,h),u[t].m(e,null),w(e,l),s=!0,o||(r=[W(e,"click",c),W(e,"keydown",d)],o=!0)},p(m,h){n=m;let g=t;t=f(n),t===g?u[t].p(n,h):(re(),D(u[g],1,1,()=>{u[g]=null}),ae(),i=u[t],i?i.p(n,h):(i=u[t]=a[t](n),i.c()),M(i,1),i.m(e,l)),(!s||h[0]&512)&&ee(e,"closable",n[9]),(!s||h[0]&6291456)&&ee(e,"selected",n[21](n[50]))},i(m){s||(M(i),s=!0)},o(m){D(i),s=!1},d(m){m&&y(e),u[t].d(),o=!1,Ie(r)}}}function E8(n){let e,t,i,l,s,o=n[14]&&xp(n);const r=n[36].beforeOptions,a=Lt(r,n,n[45],Kp);let u=de(n[22]),f=[];for(let g=0;gD(f[g],1,1,()=>{f[g]=null});let d=null;u.length||(d=tm(n));const m=n[36].afterOptions,h=Lt(m,n,n[45],Wp);return{c(){o&&o.c(),e=C(),a&&a.c(),t=C(),i=b("div");for(let g=0;gD(a[d],1,1,()=>{a[d]=null});let f=null;r.length||(f=Zp(n));let c=!n[5]&&!n[6]&&Qp(n);return{c(){e=b("div"),t=b("div");for(let d=0;d{c=null}),ae()),(!o||m[0]&32768&&s!==(s="select "+d[15]))&&p(e,"class",s),(!o||m[0]&32896)&&ee(e,"upside",d[7]),(!o||m[0]&32784)&&ee(e,"multiple",d[4]),(!o||m[0]&32800)&&ee(e,"disabled",d[5]),(!o||m[0]&32832)&&ee(e,"readonly",d[6])},i(d){if(!o){for(let m=0;md?[]:void 0}=e,{selected:k=_()}=e,{toggle:S=d}=e,{closable:$=!0}=e,{labelComponent:T=void 0}=e,{labelComponentProps:O={}}=e,{optionComponent:E=void 0}=e,{optionComponentProps:L={}}=e,{searchable:I=!1}=e,{searchFunc:A=void 0}=e;const P=kt();let{class:N=""}=e,R,z="",F,U;function J(ve){if(V.isEmpty(k))return;let Ce=V.toArray(k);V.inArray(Ce,ve)&&(V.removeByValue(Ce,ve),t(0,k=d?Ce:(Ce==null?void 0:Ce[0])||_())),P("change",{selected:k}),F==null||F.dispatchEvent(new CustomEvent("change",{detail:k,bubbles:!0}))}function Y(ve){if(d){let Ce=V.toArray(k);V.inArray(Ce,ve)||t(0,k=[...Ce,ve])}else t(0,k=ve);P("change",{selected:k}),F==null||F.dispatchEvent(new CustomEvent("change",{detail:k,bubbles:!0}))}function Z(ve){return l(ve)?J(ve):Y(ve)}function G(){t(0,k=_()),P("change",{selected:k}),F==null||F.dispatchEvent(new CustomEvent("change",{detail:k,bubbles:!0}))}function pe(){R!=null&&R.show&&(R==null||R.show())}function ce(){R!=null&&R.hide&&(R==null||R.hide())}function ue(){if(V.isEmpty(k)||V.isEmpty(c))return;let ve=V.toArray(k),Ce=[];for(const ct of ve)V.inArray(c,ct)||Ce.push(ct);if(Ce.length){for(const ct of Ce)V.removeByValue(ve,ct);t(0,k=d?ve:ve[0])}}function Te(){t(17,z="")}function Ke(ve,Ce){ve=ve||[];const ct=A||I8;return ve.filter(Ht=>ct(Ht,Ce))||[]}function Je(ve,Ce){ve.preventDefault(),S&&d?Z(Ce):Y(Ce)}function ft(ve,Ce){(ve.code==="Enter"||ve.code==="Space")&&(Je(ve,Ce),$&&ce())}function et(){Te(),setTimeout(()=>{const ve=F==null?void 0:F.querySelector(".dropdown-item.option.selected");ve&&(ve.focus(),ve.scrollIntoView({block:"nearest"}))},0)}function xe(ve){ve.stopPropagation(),!h&&!m&&(R==null||R.toggle())}Xt(()=>{const ve=document.querySelectorAll(`label[for="${r}"]`);for(const Ce of ve)Ce.addEventListener("click",xe);return()=>{for(const Ce of ve)Ce.removeEventListener("click",xe)}});const We=ve=>J(ve);function at(ve){ie[ve?"unshift":"push"](()=>{U=ve,t(20,U)})}function jt(){z=this.value,t(17,z)}const Ve=(ve,Ce)=>Je(Ce,ve),Ee=(ve,Ce)=>ft(Ce,ve);function st(ve){ie[ve?"unshift":"push"](()=>{R=ve,t(18,R)})}function De(ve){Pe.call(this,n,ve)}function Ye(ve){ie[ve?"unshift":"push"](()=>{F=ve,t(19,F)})}return n.$$set=ve=>{"id"in ve&&t(27,r=ve.id),"noOptionsText"in ve&&t(1,a=ve.noOptionsText),"selectPlaceholder"in ve&&t(2,u=ve.selectPlaceholder),"searchPlaceholder"in ve&&t(3,f=ve.searchPlaceholder),"items"in ve&&t(28,c=ve.items),"multiple"in ve&&t(4,d=ve.multiple),"disabled"in ve&&t(5,m=ve.disabled),"readonly"in ve&&t(6,h=ve.readonly),"upside"in ve&&t(7,g=ve.upside),"zeroFunc"in ve&&t(29,_=ve.zeroFunc),"selected"in ve&&t(0,k=ve.selected),"toggle"in ve&&t(8,S=ve.toggle),"closable"in ve&&t(9,$=ve.closable),"labelComponent"in ve&&t(10,T=ve.labelComponent),"labelComponentProps"in ve&&t(11,O=ve.labelComponentProps),"optionComponent"in ve&&t(12,E=ve.optionComponent),"optionComponentProps"in ve&&t(13,L=ve.optionComponentProps),"searchable"in ve&&t(14,I=ve.searchable),"searchFunc"in ve&&t(30,A=ve.searchFunc),"class"in ve&&t(15,N=ve.class),"$$scope"in ve&&t(45,o=ve.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&268435456&&c&&(ue(),Te()),n.$$.dirty[0]&268566528&&t(22,i=Ke(c,z)),n.$$.dirty[0]&1&&t(21,l=function(ve){const Ce=V.toArray(k);return V.inArray(Ce,ve)})},[k,a,u,f,d,m,h,g,S,$,T,O,E,L,I,N,J,z,R,F,U,l,i,Te,Je,ft,et,r,c,_,A,Y,Z,G,pe,ce,s,We,at,jt,Ve,Ee,st,De,Ye,o]}class ps extends Se{constructor(e){super(),we(this,e,L8,D8,ke,{id:27,noOptionsText:1,selectPlaceholder:2,searchPlaceholder:3,items:28,multiple:4,disabled:5,readonly:6,upside:7,zeroFunc:29,selected:0,toggle:8,closable:9,labelComponent:10,labelComponentProps:11,optionComponent:12,optionComponentProps:13,searchable:14,searchFunc:30,class:15,deselectItem:16,selectItem:31,toggleItem:32,reset:33,showDropdown:34,hideDropdown:35},null,[-1,-1])}get deselectItem(){return this.$$.ctx[16]}get selectItem(){return this.$$.ctx[31]}get toggleItem(){return this.$$.ctx[32]}get reset(){return this.$$.ctx[33]}get showDropdown(){return this.$$.ctx[34]}get hideDropdown(){return this.$$.ctx[35]}}function A8(n){let e,t,i,l=[{type:"password"},{autocomplete:"new-password"},n[4]],s={};for(let o=0;o',i=C(),l=b("input"),p(t,"type","button"),p(t,"class","btn btn-transparent btn-circle"),p(e,"class","form-field-addon"),ei(l,a)},m(u,f){v(u,e,f),w(e,t),v(u,i,f),v(u,l,f),l.autofocus&&l.focus(),s||(o=[Oe(qe.call(null,t,{position:"left",text:"Set new value"})),W(t,"click",nt(n[3]))],s=!0)},p(u,f){ei(l,a=wt(r,[{disabled:!0},{type:"text"},{placeholder:"******"},f&16&&u[4]]))},d(u){u&&(y(e),y(i),y(l)),s=!1,Ie(o)}}}function N8(n){let e;function t(s,o){return s[1]?P8:A8}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),v(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:te,o:te,d(s){s&&y(e),l.d(s)}}}function R8(n,e,t){const i=["value","mask"];let l=lt(e,i),{value:s=void 0}=e,{mask:o=!1}=e,r;async function a(){t(0,s=""),t(1,o=!1),await dn(),r==null||r.focus()}function u(c){ie[c?"unshift":"push"](()=>{r=c,t(2,r)})}function f(){s=this.value,t(0,s)}return n.$$set=c=>{e=je(je({},e),Wt(c)),t(4,l=lt(e,i)),"value"in c&&t(0,s=c.value),"mask"in c&&t(1,o=c.mask)},[s,o,r,a,l,u,f]}class ef extends Se{constructor(e){super(),we(this,e,R8,N8,ke,{value:0,mask:1})}}function F8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Client ID"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23])},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[1].clientId),r||(a=W(s,"input",n[14]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(s,"id",o),f&2&&s.value!==u[1].clientId&&he(s,u[1].clientId)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function q8(n){let e,t,i,l,s,o,r,a;function u(d){n[15](d)}function f(d){n[16](d)}let c={id:n[23]};return n[5]!==void 0&&(c.mask=n[5]),n[1].clientSecret!==void 0&&(c.value=n[1].clientSecret),s=new ef({props:c}),ie.push(()=>be(s,"mask",u)),ie.push(()=>be(s,"value",f)),{c(){e=b("label"),t=B("Client secret"),l=C(),j(s.$$.fragment),p(e,"for",i=n[23])},m(d,m){v(d,e,m),w(e,t),v(d,l,m),q(s,d,m),a=!0},p(d,m){(!a||m&8388608&&i!==(i=d[23]))&&p(e,"for",i);const h={};m&8388608&&(h.id=d[23]),!o&&m&32&&(o=!0,h.mask=d[5],$e(()=>o=!1)),!r&&m&2&&(r=!0,h.value=d[1].clientSecret,$e(()=>r=!1)),s.$set(h)},i(d){a||(M(s.$$.fragment,d),a=!0)},o(d){D(s.$$.fragment,d),a=!1},d(d){d&&(y(e),y(l)),H(s,d)}}}function lm(n){let e,t,i,l;const s=[{key:n[6]},n[3].optionsComponentProps||{}];function o(u){n[17](u)}var r=n[3].optionsComponent;function a(u,f){let c={};for(let d=0;dbe(t,"config",o))),{c(){e=b("div"),t&&j(t.$$.fragment),p(e,"class","col-lg-12")},m(u,f){v(u,e,f),t&&q(t,e,null),l=!0},p(u,f){if(f&8&&r!==(r=u[3].optionsComponent)){if(t){re();const c=t;D(c.$$.fragment,1,0,()=>{H(c,1)}),ae()}r?(t=zt(r,a(u,f)),ie.push(()=>be(t,"config",o)),j(t.$$.fragment),M(t.$$.fragment,1),q(t,e,null)):t=null}else if(r){const c=f&72?wt(s,[f&64&&{key:u[6]},f&8&&Rt(u[3].optionsComponentProps||{})]):{};!i&&f&2&&(i=!0,c.config=u[1],$e(()=>i=!1)),t.$set(c)}},i(u){l||(t&&M(t.$$.fragment,u),l=!0)},o(u){t&&D(t.$$.fragment,u),l=!1},d(u){u&&y(e),t&&H(t)}}}function H8(n){let e,t,i,l,s,o,r,a;t=new fe({props:{class:"form-field required",name:n[6]+".clientId",$$slots:{default:[F8,({uniqueId:f})=>({23:f}),({uniqueId:f})=>f?8388608:0]},$$scope:{ctx:n}}}),l=new fe({props:{class:"form-field required",name:n[6]+".clientSecret",$$slots:{default:[q8,({uniqueId:f})=>({23:f}),({uniqueId:f})=>f?8388608:0]},$$scope:{ctx:n}}});let u=n[3].optionsComponent&&lm(n);return{c(){e=b("form"),j(t.$$.fragment),i=C(),j(l.$$.fragment),s=C(),u&&u.c(),p(e,"id",n[8]),p(e,"autocomplete","off")},m(f,c){v(f,e,c),q(t,e,null),w(e,i),q(l,e,null),w(e,s),u&&u.m(e,null),o=!0,r||(a=W(e,"submit",nt(n[18])),r=!0)},p(f,c){const d={};c&64&&(d.name=f[6]+".clientId"),c&25165826&&(d.$$scope={dirty:c,ctx:f}),t.$set(d);const m={};c&64&&(m.name=f[6]+".clientSecret"),c&25165858&&(m.$$scope={dirty:c,ctx:f}),l.$set(m),f[3].optionsComponent?u?(u.p(f,c),c&8&&M(u,1)):(u=lm(f),u.c(),M(u,1),u.m(e,null)):u&&(re(),D(u,1,1,()=>{u=null}),ae())},i(f){o||(M(t.$$.fragment,f),M(l.$$.fragment,f),M(u),o=!0)},o(f){D(t.$$.fragment,f),D(l.$$.fragment,f),D(u),o=!1},d(f){f&&y(e),H(t),H(l),u&&u.d(),r=!1,a()}}}function j8(n){let e;return{c(){e=b("i"),p(e,"class","ri-puzzle-line txt-sm txt-hint")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function z8(n){let e,t,i;return{c(){e=b("img"),bn(e.src,t="./images/oauth2/"+n[3].logo)||p(e,"src",t),p(e,"alt",i=n[3].title+" logo")},m(l,s){v(l,e,s)},p(l,s){s&8&&!bn(e.src,t="./images/oauth2/"+l[3].logo)&&p(e,"src",t),s&8&&i!==(i=l[3].title+" logo")&&p(e,"alt",i)},d(l){l&&y(e)}}}function U8(n){let e,t,i,l=n[3].title+"",s,o,r,a,u=n[3].key+"",f,c;function d(g,_){return g[3].logo?z8:j8}let m=d(n),h=m(n);return{c(){e=b("figure"),h.c(),t=C(),i=b("h4"),s=B(l),o=C(),r=b("small"),a=B("("),f=B(u),c=B(")"),p(e,"class","provider-logo"),p(r,"class","txt-hint"),p(i,"class","center txt-break")},m(g,_){v(g,e,_),h.m(e,null),v(g,t,_),v(g,i,_),w(i,s),w(i,o),w(i,r),w(r,a),w(r,f),w(r,c)},p(g,_){m===(m=d(g))&&h?h.p(g,_):(h.d(1),h=m(g),h&&(h.c(),h.m(e,null))),_&8&&l!==(l=g[3].title+"")&&oe(s,l),_&8&&u!==(u=g[3].key+"")&&oe(f,u)},d(g){g&&(y(e),y(t),y(i)),h.d()}}}function sm(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='',t=C(),i=b("div"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-circle btn-hint btn-sm"),p(e,"aria-label","Remove provider"),p(i,"class","flex-fill")},m(o,r){v(o,e,r),v(o,t,r),v(o,i,r),l||(s=[Oe(qe.call(null,e,{text:"Remove provider",position:"right"})),W(e,"click",n[10])],l=!0)},p:te,d(o){o&&(y(e),y(t),y(i)),l=!1,Ie(s)}}}function V8(n){let e,t,i,l,s,o,r,a,u=!n[4]&&sm(n);return{c(){u&&u.c(),e=C(),t=b("button"),t.textContent="Cancel",i=C(),l=b("button"),s=b("span"),s.textContent="Set provider config",p(t,"type","button"),p(t,"class","btn btn-transparent"),p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[8]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[7]},m(f,c){u&&u.m(f,c),v(f,e,c),v(f,t,c),v(f,i,c),v(f,l,c),w(l,s),r||(a=W(t,"click",n[0]),r=!0)},p(f,c){f[4]?u&&(u.d(1),u=null):u?u.p(f,c):(u=sm(f),u.c(),u.m(e.parentNode,e)),c&128&&o!==(o=!f[7])&&(l.disabled=o)},d(f){f&&(y(e),y(t),y(i),y(l)),u&&u.d(f),r=!1,a()}}}function B8(n){let e,t,i={btnClose:!1,$$slots:{footer:[V8],header:[U8],default:[H8]},$$scope:{ctx:n}};return e=new Qt({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&16777466&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[19](null),H(e,l)}}}function W8(n,e,t){let i,l;const s=kt(),o="provider_popup_"+V.randomString(5);let r,a={},u={},f=!1,c="",d=!1,m=0;function h(P,N,R){t(13,m=R||0),t(4,f=V.isEmpty(N)),t(3,a=Object.assign({},P)),t(1,u=Object.assign({},N)),t(5,d=!!u.clientId),t(12,c=JSON.stringify(u)),r==null||r.show()}function g(){Yn(l),r==null||r.hide()}async function _(){s("submit",{uiOptions:a,config:u}),g()}async function k(){_n(`Do you really want to remove the "${a.title}" OAuth2 provider from the collection?`,()=>{s("remove",{uiOptions:a}),g()})}function S(){u.clientId=this.value,t(1,u)}function $(P){d=P,t(5,d)}function T(P){n.$$.not_equal(u.clientSecret,P)&&(u.clientSecret=P,t(1,u))}function O(P){u=P,t(1,u)}const E=()=>_();function L(P){ie[P?"unshift":"push"](()=>{r=P,t(2,r)})}function I(P){Pe.call(this,n,P)}function A(P){Pe.call(this,n,P)}return n.$$.update=()=>{n.$$.dirty&4098&&t(7,i=JSON.stringify(u)!=c),n.$$.dirty&8192&&t(6,l="oauth2.providers."+m)},[g,u,r,a,f,d,l,i,o,_,k,h,c,m,S,$,T,O,E,L,I,A]}class Y8 extends Se{constructor(e){super(),we(this,e,W8,B8,ke,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function K8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Client ID"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[2]),r||(a=W(s,"input",n[12]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(s,"id",o),f&4&&s.value!==u[2]&&he(s,u[2])},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function J8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Team ID"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[3]),r||(a=W(s,"input",n[13]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(s,"id",o),f&8&&s.value!==u[3]&&he(s,u[3])},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function Z8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Key ID"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[4]),r||(a=W(s,"input",n[14]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(s,"id",o),f&16&&s.value!==u[4]&&he(s,u[4])},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function G8(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=b("span"),t.textContent="Duration (in seconds)",i=C(),l=b("i"),o=C(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[23]),p(r,"type","number"),p(r,"id",a=n[23]),p(r,"max",ur),r.required=!0},m(c,d){v(c,e,d),w(e,t),w(e,i),w(e,l),v(c,o,d),v(c,r,d),he(r,n[6]),u||(f=[Oe(qe.call(null,l,{text:`Max ${ur} seconds (~${ur/(60*60*24*30)<<0} months).`,position:"top"})),W(r,"input",n[15])],u=!0)},p(c,d){d&8388608&&s!==(s=c[23])&&p(e,"for",s),d&8388608&&a!==(a=c[23])&&p(r,"id",a),d&64&>(r.value)!==c[6]&&he(r,c[6])},d(c){c&&(y(e),y(o),y(r)),u=!1,Ie(f)}}}function X8(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=B("Private key"),l=C(),s=b("textarea"),r=C(),a=b("div"),a.textContent="The key is not stored on the server and it is used only for generating the signed JWT.",p(e,"for",i=n[23]),p(s,"id",o=n[23]),s.required=!0,p(s,"rows","8"),p(s,"placeholder",`-----BEGIN PRIVATE KEY----- ... ------END PRIVATE KEY-----`),p(a,"class","help-block")},m(c,d){v(c,e,d),w(e,t),v(c,l,d),v(c,s,d),he(s,n[5]),v(c,r,d),v(c,a,d),u||(f=W(s,"input",n[16]),u=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&p(e,"for",i),d&8388608&&o!==(o=c[23])&&p(s,"id",o),d&32&&he(s,c[5])},d(c){c&&(y(e),y(l),y(s),y(r),y(a)),u=!1,f()}}}function Q5(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S;return l=new fe({props:{class:"form-field required",name:"clientId",$$slots:{default:[K5,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field required",name:"teamId",$$slots:{default:[J5,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),f=new fe({props:{class:"form-field required",name:"keyId",$$slots:{default:[Z5,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),m=new fe({props:{class:"form-field required",name:"duration",$$slots:{default:[G5,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),g=new fe({props:{class:"form-field required",name:"privateKey",$$slots:{default:[X5,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),i=b("div"),j(l.$$.fragment),s=C(),o=b("div"),j(r.$$.fragment),a=C(),u=b("div"),j(f.$$.fragment),c=C(),d=b("div"),j(m.$$.fragment),h=C(),j(g.$$.fragment),p(i,"class","col-lg-6"),p(o,"class","col-lg-6"),p(u,"class","col-lg-6"),p(d,"class","col-lg-6"),p(t,"class","grid"),p(e,"id",n[9]),p(e,"autocomplete","off")},m($,T){v($,e,T),w(e,t),w(t,i),q(l,i,null),w(t,s),w(t,o),q(r,o,null),w(t,a),w(t,u),q(f,u,null),w(t,c),w(t,d),q(m,d,null),w(t,h),q(g,t,null),_=!0,k||(S=W(e,"submit",nt(n[17])),k=!0)},p($,T){const O={};T&25165828&&(O.$$scope={dirty:T,ctx:$}),l.$set(O);const E={};T&25165832&&(E.$$scope={dirty:T,ctx:$}),r.$set(E);const L={};T&25165840&&(L.$$scope={dirty:T,ctx:$}),f.$set(L);const I={};T&25165888&&(I.$$scope={dirty:T,ctx:$}),m.$set(I);const A={};T&25165856&&(A.$$scope={dirty:T,ctx:$}),g.$set(A)},i($){_||(M(l.$$.fragment,$),M(r.$$.fragment,$),M(f.$$.fragment,$),M(m.$$.fragment,$),M(g.$$.fragment,$),_=!0)},o($){D(l.$$.fragment,$),D(r.$$.fragment,$),D(f.$$.fragment,$),D(m.$$.fragment,$),D(g.$$.fragment,$),_=!1},d($){$&&y(e),H(l),H(r),H(f),H(m),H(g),k=!1,S()}}}function x5(n){let e;return{c(){e=b("h4"),e.textContent="Generate Apple client secret",p(e,"class","center txt-break")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function e8(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("button"),t=B("Close"),i=C(),l=b("button"),s=b("i"),o=C(),r=b("span"),r.textContent="Generate and set secret",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[7],p(s,"class","ri-key-line"),p(r,"class","txt"),p(l,"type","submit"),p(l,"form",n[9]),p(l,"class","btn btn-expanded"),l.disabled=a=!n[8]||n[7],ee(l,"btn-loading",n[7])},m(c,d){v(c,e,d),w(e,t),v(c,i,d),v(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=W(e,"click",n[0]),u=!0)},p(c,d){d&128&&(e.disabled=c[7]),d&384&&a!==(a=!c[8]||c[7])&&(l.disabled=a),d&128&&ee(l,"btn-loading",c[7])},d(c){c&&(y(e),y(i),y(l)),u=!1,f()}}}function t8(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[e8],header:[x5],default:[Q5]},$$scope:{ctx:n}};return e=new Qt({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&128&&(o.overlayClose=!l[7]),s&128&&(o.escClose=!l[7]),s&128&&(o.beforeHide=l[18]),s&16777724&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[19](null),H(e,l)}}}const ur=15777e3;function n8(n,e,t){let i;const l=kt(),s="apple_secret_"+V.randomString(5);let o,r,a,u,f,c,d=!1;function m(P={}){t(2,r=P.clientId||""),t(3,a=P.teamId||""),t(4,u=P.keyId||""),t(5,f=P.privateKey||""),t(6,c=P.duration||ur),Ut({}),o==null||o.show()}function h(){return o==null?void 0:o.hide()}async function g(){t(7,d=!0);try{const P=await _e.settings.generateAppleClientSecret(r,a,u,f.trim(),c);t(7,d=!1),nn("Successfully generated client secret."),l("submit",P),o==null||o.hide()}catch(P){_e.error(P)}t(7,d=!1)}function _(){r=this.value,t(2,r)}function k(){a=this.value,t(3,a)}function S(){u=this.value,t(4,u)}function $(){c=gt(this.value),t(6,c)}function T(){f=this.value,t(5,f)}const O=()=>g(),E=()=>!d;function L(P){ie[P?"unshift":"push"](()=>{o=P,t(1,o)})}function I(P){Pe.call(this,n,P)}function A(P){Pe.call(this,n,P)}return t(8,i=!0),[h,o,r,a,u,f,c,d,i,s,g,m,_,k,S,$,T,O,E,L,I,A]}class i8 extends Se{constructor(e){super(),we(this,e,n8,t8,ke,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function l8(n){let e,t,i,l,s,o,r,a,u,f,c={};return r=new i8({props:c}),n[4](r),r.$on("submit",n[5]),{c(){e=b("button"),t=b("i"),i=C(),l=b("span"),l.textContent="Generate secret",o=C(),j(r.$$.fragment),p(t,"class","ri-key-line"),p(l,"class","txt"),p(e,"type","button"),p(e,"class",s="btn btn-sm btn-secondary btn-provider-"+n[1])},m(d,m){v(d,e,m),w(e,t),w(e,i),w(e,l),v(d,o,m),q(r,d,m),a=!0,u||(f=W(e,"click",n[3]),u=!0)},p(d,[m]){(!a||m&2&&s!==(s="btn btn-sm btn-secondary btn-provider-"+d[1]))&&p(e,"class",s);const h={};r.$set(h)},i(d){a||(M(r.$$.fragment,d),a=!0)},o(d){D(r.$$.fragment,d),a=!1},d(d){d&&(y(e),y(o)),n[4](null),H(r,d),u=!1,f()}}}function s8(n,e,t){let{key:i=""}=e,{config:l={}}=e,s;const o=()=>s==null?void 0:s.show({clientId:l.clientId});function r(u){ie[u?"unshift":"push"](()=>{s=u,t(2,s)})}const a=u=>{var f;t(0,l.clientSecret=((f=u.detail)==null?void 0:f.secret)||"",l)};return n.$$set=u=>{"key"in u&&t(1,i=u.key),"config"in u&&t(0,l=u.config)},[l,i,s,o,r,a]}class o8 extends Se{constructor(e){super(),we(this,e,s8,l8,ke,{key:1,config:0})}}function r8(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=B("Auth URL"),l=C(),s=b("input"),r=C(),a=b("div"),a.textContent="Ex. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/authorize",p(e,"for",i=n[4]),p(s,"type","url"),p(s,"id",o=n[4]),s.required=!0,p(a,"class","help-block")},m(c,d){v(c,e,d),w(e,t),v(c,l,d),v(c,s,d),he(s,n[0].authURL),v(c,r,d),v(c,a,d),u||(f=W(s,"input",n[2]),u=!0)},p(c,d){d&16&&i!==(i=c[4])&&p(e,"for",i),d&16&&o!==(o=c[4])&&p(s,"id",o),d&1&&s.value!==c[0].authURL&&he(s,c[0].authURL)},d(c){c&&(y(e),y(l),y(s),y(r),y(a)),u=!1,f()}}}function a8(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=B("Token URL"),l=C(),s=b("input"),r=C(),a=b("div"),a.textContent="Ex. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/token",p(e,"for",i=n[4]),p(s,"type","url"),p(s,"id",o=n[4]),s.required=!0,p(a,"class","help-block")},m(c,d){v(c,e,d),w(e,t),v(c,l,d),v(c,s,d),he(s,n[0].tokenURL),v(c,r,d),v(c,a,d),u||(f=W(s,"input",n[3]),u=!0)},p(c,d){d&16&&i!==(i=c[4])&&p(e,"for",i),d&16&&o!==(o=c[4])&&p(s,"id",o),d&1&&s.value!==c[0].tokenURL&&he(s,c[0].tokenURL)},d(c){c&&(y(e),y(l),y(s),y(r),y(a)),u=!1,f()}}}function u8(n){let e,t,i,l,s,o;return i=new fe({props:{class:"form-field required",name:n[1]+".authURL",$$slots:{default:[r8,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),s=new fe({props:{class:"form-field required",name:n[1]+".tokenURL",$$slots:{default:[a8,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.textContent="Azure AD endpoints",t=C(),j(i.$$.fragment),l=C(),j(s.$$.fragment),p(e,"class","section-title")},m(r,a){v(r,e,a),v(r,t,a),q(i,r,a),v(r,l,a),q(s,r,a),o=!0},p(r,[a]){const u={};a&2&&(u.name=r[1]+".authURL"),a&49&&(u.$$scope={dirty:a,ctx:r}),i.$set(u);const f={};a&2&&(f.name=r[1]+".tokenURL"),a&49&&(f.$$scope={dirty:a,ctx:r}),s.$set(f)},i(r){o||(M(i.$$.fragment,r),M(s.$$.fragment,r),o=!0)},o(r){D(i.$$.fragment,r),D(s.$$.fragment,r),o=!1},d(r){r&&(y(e),y(t),y(l)),H(i,r),H(s,r)}}}function f8(n,e,t){let{key:i=""}=e,{config:l={}}=e;function s(){l.authURL=this.value,t(0,l)}function o(){l.tokenURL=this.value,t(0,l)}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"config"in r&&t(0,l=r.config)},[l,i,s,o]}class c8 extends Se{constructor(e){super(),we(this,e,f8,u8,ke,{key:1,config:0})}}function om(n){let e,t;return{c(){e=b("i"),p(e,"class",t="icon "+n[0].icon)},m(i,l){v(i,e,l)},p(i,l){l&1&&t!==(t="icon "+i[0].icon)&&p(e,"class",t)},d(i){i&&y(e)}}}function d8(n){let e,t,i=(n[0].label||n[0].name||n[0].title||n[0].id||n[0].value)+"",l,s=n[0].icon&&om(n);return{c(){s&&s.c(),e=C(),t=b("span"),l=B(i),p(t,"class","txt")},m(o,r){s&&s.m(o,r),v(o,e,r),v(o,t,r),w(t,l)},p(o,[r]){o[0].icon?s?s.p(o,r):(s=om(o),s.c(),s.m(e.parentNode,e)):s&&(s.d(1),s=null),r&1&&i!==(i=(o[0].label||o[0].name||o[0].title||o[0].id||o[0].value)+"")&&oe(l,i)},i:te,o:te,d(o){o&&(y(e),y(t)),s&&s.d(o)}}}function p8(n,e,t){let{item:i={}}=e;return n.$$set=l=>{"item"in l&&t(0,i=l.item)},[i]}class rm extends Se{constructor(e){super(),we(this,e,p8,d8,ke,{item:0})}}const m8=n=>({}),am=n=>({});function h8(n){let e;const t=n[8].afterOptions,i=Lt(t,n,n[13],am);return{c(){i&&i.c()},m(l,s){i&&i.m(l,s),e=!0},p(l,s){i&&i.p&&(!e||s&8192)&&Pt(i,t,l,l[13],e?At(t,l[13],s,m8):Nt(l[13]),am)},i(l){e||(M(i,l),e=!0)},o(l){D(i,l),e=!1},d(l){i&&i.d(l)}}}function _8(n){let e,t,i;const l=[{items:n[1]},{multiple:n[2]},{labelComponent:n[3]},{optionComponent:n[4]},n[5]];function s(r){n[9](r)}let o={$$slots:{afterOptions:[h8]},$$scope:{ctx:n}};for(let r=0;rbe(e,"selected",s)),e.$on("show",n[10]),e.$on("hide",n[11]),e.$on("change",n[12]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&62?wt(l,[a&2&&{items:r[1]},a&4&&{multiple:r[2]},a&8&&{labelComponent:r[3]},a&16&&{optionComponent:r[4]},a&32&&Rt(r[5])]):{};a&8192&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.selected=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function g8(n,e,t){const i=["items","multiple","selected","labelComponent","optionComponent","selectionKey","keyOfSelected"];let l=lt(e,i),{$$slots:s={},$$scope:o}=e,{items:r=[]}=e,{multiple:a=!1}=e,{selected:u=a?[]:void 0}=e,{labelComponent:f=rm}=e,{optionComponent:c=rm}=e,{selectionKey:d="value"}=e,{keyOfSelected:m=a?[]:void 0}=e;function h(T){T=V.toArray(T,!0);let O=[];for(let E of T){const L=V.findByKey(r,d,E);L&&O.push(L)}T.length&&!O.length||t(0,u=a?O:O[0])}async function g(T){let O=V.toArray(T,!0).map(E=>E[d]);r.length&&t(6,m=a?O:O[0])}function _(T){u=T,t(0,u)}function k(T){Pe.call(this,n,T)}function S(T){Pe.call(this,n,T)}function $(T){Pe.call(this,n,T)}return n.$$set=T=>{e=je(je({},e),Wt(T)),t(5,l=lt(e,i)),"items"in T&&t(1,r=T.items),"multiple"in T&&t(2,a=T.multiple),"selected"in T&&t(0,u=T.selected),"labelComponent"in T&&t(3,f=T.labelComponent),"optionComponent"in T&&t(4,c=T.optionComponent),"selectionKey"in T&&t(7,d=T.selectionKey),"keyOfSelected"in T&&t(6,m=T.keyOfSelected),"$$scope"in T&&t(13,o=T.$$scope)},n.$$.update=()=>{n.$$.dirty&66&&r&&h(m),n.$$.dirty&1&&g(u)},[u,r,a,f,c,l,m,d,s,_,k,S,$,o]}class zn extends Se{constructor(e){super(),we(this,e,g8,_8,ke,{items:1,multiple:2,selected:0,labelComponent:3,optionComponent:4,selectionKey:7,keyOfSelected:6})}}function b8(n){let e,t,i,l,s=[{type:t=n[5].type||"text"},{value:n[4]},{disabled:n[3]},{readOnly:n[2]},n[5]],o={};for(let r=0;r{t(0,o=V.splitNonEmpty(c.target.value,r))};return n.$$set=c=>{e=je(je({},e),Wt(c)),t(5,s=lt(e,l)),"value"in c&&t(0,o=c.value),"separator"in c&&t(1,r=c.separator),"readonly"in c&&t(2,a=c.readonly),"disabled"in c&&t(3,u=c.disabled)},n.$$.update=()=>{n.$$.dirty&3&&t(4,i=V.joinNonEmpty(o,r+" "))},[o,r,a,u,i,s,f]}class ms extends Se{constructor(e){super(),we(this,e,k8,b8,ke,{value:0,separator:1,readonly:2,disabled:3})}}function y8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Display name"),l=C(),s=b("input"),p(e,"for",i=n[13]),p(s,"type","text"),p(s,"id",o=n[13]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].displayName),r||(a=W(s,"input",n[4]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&p(e,"for",i),f&8192&&o!==(o=u[13])&&p(s,"id",o),f&1&&s.value!==u[0].displayName&&he(s,u[0].displayName)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function v8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Auth URL"),l=C(),s=b("input"),p(e,"for",i=n[13]),p(s,"type","url"),p(s,"id",o=n[13]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].authURL),r||(a=W(s,"input",n[5]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&p(e,"for",i),f&8192&&o!==(o=u[13])&&p(s,"id",o),f&1&&s.value!==u[0].authURL&&he(s,u[0].authURL)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function w8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Token URL"),l=C(),s=b("input"),p(e,"for",i=n[13]),p(s,"type","url"),p(s,"id",o=n[13]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].tokenURL),r||(a=W(s,"input",n[6]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&p(e,"for",i),f&8192&&o!==(o=u[13])&&p(s,"id",o),f&1&&s.value!==u[0].tokenURL&&he(s,u[0].tokenURL)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function S8(n){let e,t,i,l,s,o,r;function a(f){n[7](f)}let u={id:n[13],items:n[3]};return n[2]!==void 0&&(u.keyOfSelected=n[2]),s=new zn({props:u}),ie.push(()=>be(s,"keyOfSelected",a)),{c(){e=b("label"),t=B("Fetch user info from"),l=C(),j(s.$$.fragment),p(e,"for",i=n[13])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c&8192&&i!==(i=f[13]))&&p(e,"for",i);const d={};c&8192&&(d.id=f[13]),!o&&c&4&&(o=!0,d.keyOfSelected=f[2],$e(()=>o=!1)),s.$set(d)},i(f){r||(M(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(y(e),y(l)),H(s,f)}}}function T8(n){let e,t,i,l,s,o,r,a;return l=new fe({props:{class:"form-field m-b-xs",name:n[1]+".extra.jwksURL",$$slots:{default:[C8,({uniqueId:u})=>({13:u}),({uniqueId:u})=>u?8192:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:n[1]+".extra.issuers",$$slots:{default:[O8,({uniqueId:u})=>({13:u}),({uniqueId:u})=>u?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("p"),t.innerHTML=`Both fields are considered optional because the parsed id_token - is a direct result of the trusted server code->token exchange response.`,i=C(),j(l.$$.fragment),s=C(),j(o.$$.fragment),p(t,"class","txt-hint txt-sm m-b-xs"),p(e,"class","content")},m(u,f){v(u,e,f),w(e,t),w(e,i),q(l,e,null),w(e,s),q(o,e,null),a=!0},p(u,f){const c={};f&2&&(c.name=u[1]+".extra.jwksURL"),f&24577&&(c.$$scope={dirty:f,ctx:u}),l.$set(c);const d={};f&2&&(d.name=u[1]+".extra.issuers"),f&24577&&(d.$$scope={dirty:f,ctx:u}),o.$set(d)},i(u){a||(M(l.$$.fragment,u),M(o.$$.fragment,u),u&&tt(()=>{a&&(r||(r=He(e,mt,{delay:10,duration:150},!0)),r.run(1))}),a=!0)},o(u){D(l.$$.fragment,u),D(o.$$.fragment,u),u&&(r||(r=He(e,mt,{delay:10,duration:150},!1)),r.run(0)),a=!1},d(u){u&&y(e),H(l),H(o),u&&r&&r.end()}}}function $8(n){let e,t,i,l;return t=new fe({props:{class:"form-field required",name:n[1]+".userInfoURL",$$slots:{default:[M8,({uniqueId:s})=>({13:s}),({uniqueId:s})=>s?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","content")},m(s,o){v(s,e,o),q(t,e,null),l=!0},p(s,o){const r={};o&2&&(r.name=s[1]+".userInfoURL"),o&24577&&(r.$$scope={dirty:o,ctx:s}),t.$set(r)},i(s){l||(M(t.$$.fragment,s),s&&tt(()=>{l&&(i||(i=He(e,mt,{delay:10,duration:150},!0)),i.run(1))}),l=!0)},o(s){D(t.$$.fragment,s),s&&(i||(i=He(e,mt,{delay:10,duration:150},!1)),i.run(0)),l=!1},d(s){s&&y(e),H(t),s&&i&&i.end()}}}function C8(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=b("span"),t.textContent="JWKS verification URL",i=C(),l=b("i"),o=C(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[13]),p(r,"type","url"),p(r,"id",a=n[13])},m(c,d){v(c,e,d),w(e,t),w(e,i),w(e,l),v(c,o,d),v(c,r,d),he(r,n[0].extra.jwksURL),u||(f=[Oe(qe.call(null,l,{text:"URL to the public token verification keys.",position:"top"})),W(r,"input",n[9])],u=!0)},p(c,d){d&8192&&s!==(s=c[13])&&p(e,"for",s),d&8192&&a!==(a=c[13])&&p(r,"id",a),d&1&&r.value!==c[0].extra.jwksURL&&he(r,c[0].extra.jwksURL)},d(c){c&&(y(e),y(o),y(r)),u=!1,Ie(f)}}}function O8(n){let e,t,i,l,s,o,r,a,u,f,c;function d(h){n[10](h)}let m={id:n[13]};return n[0].extra.issuers!==void 0&&(m.value=n[0].extra.issuers),r=new ms({props:m}),ie.push(()=>be(r,"value",d)),{c(){e=b("label"),t=b("span"),t.textContent="Issuers",i=C(),l=b("i"),o=C(),j(r.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[13])},m(h,g){v(h,e,g),w(e,t),w(e,i),w(e,l),v(h,o,g),q(r,h,g),u=!0,f||(c=Oe(qe.call(null,l,{text:"Comma separated list of accepted values for the iss token claim validation.",position:"top"})),f=!0)},p(h,g){(!u||g&8192&&s!==(s=h[13]))&&p(e,"for",s);const _={};g&8192&&(_.id=h[13]),!a&&g&1&&(a=!0,_.value=h[0].extra.issuers,$e(()=>a=!1)),r.$set(_)},i(h){u||(M(r.$$.fragment,h),u=!0)},o(h){D(r.$$.fragment,h),u=!1},d(h){h&&(y(e),y(o)),H(r,h),f=!1,c()}}}function M8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("User info URL"),l=C(),s=b("input"),p(e,"for",i=n[13]),p(s,"type","url"),p(s,"id",o=n[13]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].userInfoURL),r||(a=W(s,"input",n[8]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&p(e,"for",i),f&8192&&o!==(o=u[13])&&p(s,"id",o),f&1&&s.value!==u[0].userInfoURL&&he(s,u[0].userInfoURL)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function E8(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=C(),l=b("label"),s=b("span"),s.textContent="Support PKCE",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[13])},m(c,d){v(c,e,d),e.checked=n[0].pkce,v(c,i,d),v(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=[W(e,"change",n[11]),Oe(qe.call(null,r,{text:"Usually it should be safe to be always enabled as most providers will just ignore the extra query parameters if they don't support PKCE.",position:"right"}))],u=!0)},p(c,d){d&8192&&t!==(t=c[13])&&p(e,"id",t),d&1&&(e.checked=c[0].pkce),d&8192&&a!==(a=c[13])&&p(l,"for",a)},d(c){c&&(y(e),y(i),y(l)),u=!1,Ie(f)}}}function D8(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_;e=new fe({props:{class:"form-field required",name:n[1]+".displayName",$$slots:{default:[y8,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),s=new fe({props:{class:"form-field required",name:n[1]+".authURL",$$slots:{default:[v8,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field required",name:n[1]+".tokenURL",$$slots:{default:[w8,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),u=new fe({props:{class:"form-field m-b-xs",$$slots:{default:[S8,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}});const k=[$8,T8],S=[];function $(T,O){return T[2]?0:1}return d=$(n),m=S[d]=k[d](n),g=new fe({props:{class:"form-field",name:n[1]+".pkce",$$slots:{default:[E8,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),i=b("div"),i.textContent="Endpoints",l=C(),j(s.$$.fragment),o=C(),j(r.$$.fragment),a=C(),j(u.$$.fragment),f=C(),c=b("div"),m.c(),h=C(),j(g.$$.fragment),p(i,"class","section-title"),p(c,"class","sub-panel m-b-base")},m(T,O){q(e,T,O),v(T,t,O),v(T,i,O),v(T,l,O),q(s,T,O),v(T,o,O),q(r,T,O),v(T,a,O),q(u,T,O),v(T,f,O),v(T,c,O),S[d].m(c,null),v(T,h,O),q(g,T,O),_=!0},p(T,[O]){const E={};O&2&&(E.name=T[1]+".displayName"),O&24577&&(E.$$scope={dirty:O,ctx:T}),e.$set(E);const L={};O&2&&(L.name=T[1]+".authURL"),O&24577&&(L.$$scope={dirty:O,ctx:T}),s.$set(L);const I={};O&2&&(I.name=T[1]+".tokenURL"),O&24577&&(I.$$scope={dirty:O,ctx:T}),r.$set(I);const A={};O&24580&&(A.$$scope={dirty:O,ctx:T}),u.$set(A);let P=d;d=$(T),d===P?S[d].p(T,O):(re(),D(S[P],1,1,()=>{S[P]=null}),ae(),m=S[d],m?m.p(T,O):(m=S[d]=k[d](T),m.c()),M(m,1),m.m(c,null));const N={};O&2&&(N.name=T[1]+".pkce"),O&24577&&(N.$$scope={dirty:O,ctx:T}),g.$set(N)},i(T){_||(M(e.$$.fragment,T),M(s.$$.fragment,T),M(r.$$.fragment,T),M(u.$$.fragment,T),M(m),M(g.$$.fragment,T),_=!0)},o(T){D(e.$$.fragment,T),D(s.$$.fragment,T),D(r.$$.fragment,T),D(u.$$.fragment,T),D(m),D(g.$$.fragment,T),_=!1},d(T){T&&(y(t),y(i),y(l),y(o),y(a),y(f),y(c),y(h)),H(e,T),H(s,T),H(r,T),H(u,T),S[d].d(),H(g,T)}}}function I8(n,e,t){let{key:i=""}=e,{config:l={}}=e;const s=[{label:"User info URL",value:!0},{label:"ID Token",value:!1}];let o=!!l.userInfoURL;V.isEmpty(l.pkce)&&(l.pkce=!0),l.displayName||(l.displayName="OIDC"),l.extra||(l.extra={},o=!0);function r(){o?t(0,l.extra={},l):(t(0,l.userInfoURL="",l),t(0,l.extra=l.extra||{},l))}function a(){l.displayName=this.value,t(0,l)}function u(){l.authURL=this.value,t(0,l)}function f(){l.tokenURL=this.value,t(0,l)}function c(_){o=_,t(2,o)}function d(){l.userInfoURL=this.value,t(0,l)}function m(){l.extra.jwksURL=this.value,t(0,l)}function h(_){n.$$.not_equal(l.extra.issuers,_)&&(l.extra.issuers=_,t(0,l))}function g(){l.pkce=this.checked,t(0,l)}return n.$$set=_=>{"key"in _&&t(1,i=_.key),"config"in _&&t(0,l=_.config)},n.$$.update=()=>{n.$$.dirty&4&&typeof o!==void 0&&r()},[l,i,o,s,a,u,f,c,d,m,h,g]}class va extends Se{constructor(e){super(),we(this,e,I8,D8,ke,{key:1,config:0})}}function L8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Auth URL"),l=C(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[3]},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].authURL),r||(a=W(s,"input",n[5]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(s,"id",o),f&8&&(s.required=u[3]),f&1&&s.value!==u[0].authURL&&he(s,u[0].authURL)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function A8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Token URL"),l=C(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[3]},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].tokenURL),r||(a=W(s,"input",n[6]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(s,"id",o),f&8&&(s.required=u[3]),f&1&&s.value!==u[0].tokenURL&&he(s,u[0].tokenURL)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function P8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("User info URL"),l=C(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[3]},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].userInfoURL),r||(a=W(s,"input",n[7]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(s,"id",o),f&8&&(s.required=u[3]),f&1&&s.value!==u[0].userInfoURL&&he(s,u[0].userInfoURL)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function N8(n){let e,t,i,l,s,o,r,a,u;return l=new fe({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".authURL",$$slots:{default:[L8,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".tokenURL",$$slots:{default:[A8,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),a=new fe({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".userInfoURL",$$slots:{default:[P8,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=B(n[2]),i=C(),j(l.$$.fragment),s=C(),j(o.$$.fragment),r=C(),j(a.$$.fragment),p(e,"class","section-title")},m(f,c){v(f,e,c),w(e,t),v(f,i,c),q(l,f,c),v(f,s,c),q(o,f,c),v(f,r,c),q(a,f,c),u=!0},p(f,[c]){(!u||c&4)&&oe(t,f[2]);const d={};c&8&&(d.class="form-field "+(f[3]?"required":"")),c&2&&(d.name=f[1]+".authURL"),c&777&&(d.$$scope={dirty:c,ctx:f}),l.$set(d);const m={};c&8&&(m.class="form-field "+(f[3]?"required":"")),c&2&&(m.name=f[1]+".tokenURL"),c&777&&(m.$$scope={dirty:c,ctx:f}),o.$set(m);const h={};c&8&&(h.class="form-field "+(f[3]?"required":"")),c&2&&(h.name=f[1]+".userInfoURL"),c&777&&(h.$$scope={dirty:c,ctx:f}),a.$set(h)},i(f){u||(M(l.$$.fragment,f),M(o.$$.fragment,f),M(a.$$.fragment,f),u=!0)},o(f){D(l.$$.fragment,f),D(o.$$.fragment,f),D(a.$$.fragment,f),u=!1},d(f){f&&(y(e),y(i),y(s),y(r)),H(l,f),H(o,f),H(a,f)}}}function R8(n,e,t){let i,{key:l=""}=e,{config:s={}}=e,{required:o=!1}=e,{title:r="Provider endpoints"}=e;function a(){s.authURL=this.value,t(0,s)}function u(){s.tokenURL=this.value,t(0,s)}function f(){s.userInfoURL=this.value,t(0,s)}return n.$$set=c=>{"key"in c&&t(1,l=c.key),"config"in c&&t(0,s=c.config),"required"in c&&t(4,o=c.required),"title"in c&&t(2,r=c.title)},n.$$.update=()=>{n.$$.dirty&17&&t(3,i=o&&(s==null?void 0:s.enabled))},[s,l,r,i,o,a,u,f]}class wa extends Se{constructor(e){super(),we(this,e,R8,N8,ke,{key:1,config:0,required:4,title:2})}}const tf=[{key:"apple",title:"Apple",logo:"apple.svg",optionsComponent:o8},{key:"google",title:"Google",logo:"google.svg"},{key:"microsoft",title:"Microsoft",logo:"microsoft.svg",optionsComponent:c8},{key:"yandex",title:"Yandex",logo:"yandex.svg"},{key:"facebook",title:"Facebook",logo:"facebook.svg"},{key:"instagram2",title:"Instagram",logo:"instagram.svg"},{key:"github",title:"GitHub",logo:"github.svg"},{key:"gitlab",title:"GitLab",logo:"gitlab.svg",optionsComponent:wa,optionsComponentProps:{title:"Self-hosted endpoints (optional)"}},{key:"bitbucket",title:"Bitbucket",logo:"bitbucket.svg"},{key:"gitee",title:"Gitee",logo:"gitee.svg"},{key:"gitea",title:"Gitea",logo:"gitea.svg",optionsComponent:wa,optionsComponentProps:{title:"Self-hosted endpoints (optional)"}},{key:"linear",title:"Linear",logo:"linear.svg"},{key:"discord",title:"Discord",logo:"discord.svg"},{key:"twitter",title:"Twitter",logo:"twitter.svg"},{key:"kakao",title:"Kakao",logo:"kakao.svg"},{key:"vk",title:"VK",logo:"vk.svg"},{key:"notion",title:"Notion",logo:"notion.svg"},{key:"monday",title:"monday.com",logo:"monday.svg"},{key:"spotify",title:"Spotify",logo:"spotify.svg"},{key:"twitch",title:"Twitch",logo:"twitch.svg"},{key:"patreon",title:"Patreon (v2)",logo:"patreon.svg"},{key:"strava",title:"Strava",logo:"strava.svg"},{key:"wakatime",title:"WakaTime",logo:"wakatime.svg"},{key:"livechat",title:"LiveChat",logo:"livechat.svg"},{key:"mailcow",title:"mailcow",logo:"mailcow.svg",optionsComponent:wa,optionsComponentProps:{required:!0}},{key:"planningcenter",title:"Planning Center",logo:"planningcenter.svg"},{key:"oidc",title:"OpenID Connect",logo:"oidc.svg",optionsComponent:va},{key:"oidc2",title:"(2) OpenID Connect",logo:"oidc.svg",optionsComponent:va},{key:"oidc3",title:"(3) OpenID Connect",logo:"oidc.svg",optionsComponent:va}];function um(n,e,t){const i=n.slice();return i[16]=e[t],i}function fm(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(o,r){v(o,e,r),i=!0,l||(s=W(e,"click",n[9]),l=!0)},p:te,i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,qn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,qn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function F8(n){let e,t,i,l,s,o,r,a,u,f,c=n[1]!=""&&fm(n);return{c(){e=b("label"),t=b("i"),l=C(),s=b("input"),r=C(),c&&c.c(),a=ye(),p(t,"class","ri-search-line"),p(e,"for",i=n[19]),p(e,"class","m-l-10 txt-xl"),p(s,"id",o=n[19]),p(s,"type","text"),p(s,"placeholder","Search provider")},m(d,m){v(d,e,m),w(e,t),v(d,l,m),v(d,s,m),he(s,n[1]),v(d,r,m),c&&c.m(d,m),v(d,a,m),u||(f=W(s,"input",n[8]),u=!0)},p(d,m){m&524288&&i!==(i=d[19])&&p(e,"for",i),m&524288&&o!==(o=d[19])&&p(s,"id",o),m&2&&s.value!==d[1]&&he(s,d[1]),d[1]!=""?c?(c.p(d,m),m&2&&M(c,1)):(c=fm(d),c.c(),M(c,1),c.m(a.parentNode,a)):c&&(re(),D(c,1,1,()=>{c=null}),ae())},d(d){d&&(y(e),y(l),y(s),y(r),y(a)),c&&c.d(d),u=!1,f()}}}function cm(n){let e,t,i,l,s=n[1]!=""&&dm(n);return{c(){e=b("div"),t=b("span"),t.textContent="No providers to select.",i=C(),s&&s.c(),l=C(),p(t,"class","txt-hint"),p(e,"class","flex inline-flex")},m(o,r){v(o,e,r),w(e,t),w(e,i),s&&s.m(e,null),w(e,l)},p(o,r){o[1]!=""?s?s.p(o,r):(s=dm(o),s.c(),s.m(e,l)):s&&(s.d(1),s=null)},d(o){o&&y(e),s&&s.d()}}}function dm(n){let e,t,i;return{c(){e=b("button"),e.textContent="Clear filter",p(e,"type","button"),p(e,"class","btn btn-sm btn-secondary")},m(l,s){v(l,e,s),t||(i=W(e,"click",n[5]),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function pm(n){let e,t,i;return{c(){e=b("img"),bn(e.src,t="./images/oauth2/"+n[16].logo)||p(e,"src",t),p(e,"alt",i=n[16].title+" logo")},m(l,s){v(l,e,s)},p(l,s){s&8&&!bn(e.src,t="./images/oauth2/"+l[16].logo)&&p(e,"src",t),s&8&&i!==(i=l[16].title+" logo")&&p(e,"alt",i)},d(l){l&&y(e)}}}function mm(n,e){let t,i,l,s,o,r,a=e[16].title+"",u,f,c,d=e[16].key+"",m,h,g,_,k=e[16].logo&&pm(e);function S(){return e[10](e[16])}return{key:n,first:null,c(){t=b("div"),i=b("button"),l=b("figure"),k&&k.c(),s=C(),o=b("div"),r=b("div"),u=B(a),f=C(),c=b("em"),m=B(d),h=C(),p(l,"class","provider-logo"),p(r,"class","title"),p(c,"class","txt-hint txt-sm m-r-auto"),p(o,"class","content"),p(i,"type","button"),p(i,"class","provider-card handle"),p(t,"class","col-6"),this.first=t},m($,T){v($,t,T),w(t,i),w(i,l),k&&k.m(l,null),w(i,s),w(i,o),w(o,r),w(r,u),w(o,f),w(o,c),w(c,m),w(t,h),g||(_=W(i,"click",S),g=!0)},p($,T){e=$,e[16].logo?k?k.p(e,T):(k=pm(e),k.c(),k.m(l,null)):k&&(k.d(1),k=null),T&8&&a!==(a=e[16].title+"")&&oe(u,a),T&8&&d!==(d=e[16].key+"")&&oe(m,d)},d($){$&&y(t),k&&k.d(),g=!1,_()}}}function q8(n){let e,t,i,l=[],s=new Map,o;e=new fe({props:{class:"searchbar m-b-sm",$$slots:{default:[F8,({uniqueId:f})=>({19:f}),({uniqueId:f})=>f?524288:0]},$$scope:{ctx:n}}});let r=de(n[3]);const a=f=>f[16].key;for(let f=0;f!l.includes(T.key)&&($==""||T.key.toLowerCase().includes($)||T.title.toLowerCase().includes($)))}function d(){t(1,o="")}function m(){o=this.value,t(1,o)}const h=()=>t(1,o=""),g=$=>f($);function _($){ie[$?"unshift":"push"](()=>{s=$,t(2,s)})}function k($){Pe.call(this,n,$)}function S($){Pe.call(this,n,$)}return n.$$set=$=>{"disabled"in $&&t(6,l=$.disabled)},n.$$.update=()=>{n.$$.dirty&66&&(o!==-1||l!==-1)&&t(3,r=c())},[u,o,s,r,f,d,l,a,m,h,g,_,k,S]}class V8 extends Se{constructor(e){super(),we(this,e,U8,z8,ke,{disabled:6,show:7,hide:0})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}}function hm(n,e,t){const i=n.slice();i[28]=e[t],i[31]=t;const l=i[9](i[28].name);return i[29]=l,i}function B8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=B("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[27]),p(l,"for",o=n[27])},m(u,f){v(u,e,f),e.checked=n[0].oauth2.enabled,v(u,i,f),v(u,l,f),w(l,s),r||(a=W(e,"change",n[10]),r=!0)},p(u,f){f[0]&134217728&&t!==(t=u[27])&&p(e,"id",t),f[0]&1&&(e.checked=u[0].oauth2.enabled),f[0]&134217728&&o!==(o=u[27])&&p(l,"for",o)},d(u){u&&(y(e),y(i),y(l)),r=!1,a()}}}function W8(n){let e;return{c(){e=b("i"),p(e,"class","ri-puzzle-line txt-sm txt-hint")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function Y8(n){let e,t,i;return{c(){e=b("img"),bn(e.src,t="./images/oauth2/"+n[29].logo)||p(e,"src",t),p(e,"alt",i=n[29].title+" logo")},m(l,s){v(l,e,s)},p(l,s){s[0]&1&&!bn(e.src,t="./images/oauth2/"+l[29].logo)&&p(e,"src",t),s[0]&1&&i!==(i=l[29].title+" logo")&&p(e,"alt",i)},d(l){l&&y(e)}}}function _m(n){let e,t,i;function l(){return n[11](n[29],n[28],n[31])}return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-circle btn-hint btn-transparent"),p(e,"aria-label","Provider settings")},m(s,o){v(s,e,o),t||(i=[Oe(qe.call(null,e,{text:"Edit config",position:"left"})),W(e,"click",l)],t=!0)},p(s,o){n=s},d(s){s&&y(e),t=!1,Ie(i)}}}function gm(n,e){var $;let t,i,l,s,o,r,a=(e[28].displayName||(($=e[29])==null?void 0:$.title)||"Custom")+"",u,f,c,d=e[28].name+"",m,h;function g(T,O){var E;return(E=T[29])!=null&&E.logo?Y8:W8}let _=g(e),k=_(e),S=e[29]&&_m(e);return{key:n,first:null,c(){var T,O,E;t=b("div"),i=b("div"),l=b("figure"),k.c(),s=C(),o=b("div"),r=b("div"),u=B(a),f=C(),c=b("em"),m=B(d),h=C(),S&&S.c(),p(l,"class","provider-logo"),p(r,"class","title"),p(c,"class","txt-hint txt-sm m-r-auto"),p(o,"class","content"),p(i,"class","provider-card"),ee(i,"error",!V.isEmpty((E=(O=(T=e[1])==null?void 0:T.oauth2)==null?void 0:O.providers)==null?void 0:E[e[31]])),p(t,"class","col-lg-6"),this.first=t},m(T,O){v(T,t,O),w(t,i),w(i,l),k.m(l,null),w(i,s),w(i,o),w(o,r),w(r,u),w(o,f),w(o,c),w(c,m),w(i,h),S&&S.m(i,null)},p(T,O){var E,L,I,A;e=T,_===(_=g(e))&&k?k.p(e,O):(k.d(1),k=_(e),k&&(k.c(),k.m(l,null))),O[0]&1&&a!==(a=(e[28].displayName||((E=e[29])==null?void 0:E.title)||"Custom")+"")&&oe(u,a),O[0]&1&&d!==(d=e[28].name+"")&&oe(m,d),e[29]?S?S.p(e,O):(S=_m(e),S.c(),S.m(i,null)):S&&(S.d(1),S=null),O[0]&3&&ee(i,"error",!V.isEmpty((A=(I=(L=e[1])==null?void 0:L.oauth2)==null?void 0:I.providers)==null?void 0:A[e[31]]))},d(T){T&&y(t),k.d(),S&&S.d()}}}function K8(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function J8(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function bm(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g;return l=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.name",$$slots:{default:[Z8,({uniqueId:_})=>({27:_}),({uniqueId:_})=>[_?134217728:0]]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.avatarURL",$$slots:{default:[G8,({uniqueId:_})=>({27:_}),({uniqueId:_})=>[_?134217728:0]]},$$scope:{ctx:n}}}),f=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.id",$$slots:{default:[X8,({uniqueId:_})=>({27:_}),({uniqueId:_})=>[_?134217728:0]]},$$scope:{ctx:n}}}),m=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.username",$$slots:{default:[Q8,({uniqueId:_})=>({27:_}),({uniqueId:_})=>[_?134217728:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),j(l.$$.fragment),s=C(),o=b("div"),j(r.$$.fragment),a=C(),u=b("div"),j(f.$$.fragment),c=C(),d=b("div"),j(m.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(u,"class","col-sm-6"),p(d,"class","col-sm-6"),p(t,"class","grid grid-sm p-t-xs"),p(e,"class","block")},m(_,k){v(_,e,k),w(e,t),w(t,i),q(l,i,null),w(t,s),w(t,o),q(r,o,null),w(t,a),w(t,u),q(f,u,null),w(t,c),w(t,d),q(m,d,null),g=!0},p(_,k){const S={};k[0]&134217761|k[1]&2&&(S.$$scope={dirty:k,ctx:_}),l.$set(S);const $={};k[0]&134217793|k[1]&2&&($.$$scope={dirty:k,ctx:_}),r.$set($);const T={};k[0]&134217761|k[1]&2&&(T.$$scope={dirty:k,ctx:_}),f.$set(T);const O={};k[0]&134217761|k[1]&2&&(O.$$scope={dirty:k,ctx:_}),m.$set(O)},i(_){g||(M(l.$$.fragment,_),M(r.$$.fragment,_),M(f.$$.fragment,_),M(m.$$.fragment,_),_&&tt(()=>{g&&(h||(h=He(e,mt,{duration:150},!0)),h.run(1))}),g=!0)},o(_){D(l.$$.fragment,_),D(r.$$.fragment,_),D(f.$$.fragment,_),D(m.$$.fragment,_),_&&(h||(h=He(e,mt,{duration:150},!1)),h.run(0)),g=!1},d(_){_&&y(e),H(l),H(r),H(f),H(m),_&&h&&h.end()}}}function Z8(n){let e,t,i,l,s,o,r;function a(f){n[14](f)}let u={id:n[27],items:n[5],toggle:!0,zeroFunc:lO,selectPlaceholder:"Select field"};return n[0].oauth2.mappedFields.name!==void 0&&(u.selected=n[0].oauth2.mappedFields.name),s=new ps({props:u}),ie.push(()=>be(s,"selected",a)),{c(){e=b("label"),t=B("OAuth2 full name"),l=C(),j(s.$$.fragment),p(e,"for",i=n[27])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c[0]&134217728&&i!==(i=f[27]))&&p(e,"for",i);const d={};c[0]&134217728&&(d.id=f[27]),c[0]&32&&(d.items=f[5]),!o&&c[0]&1&&(o=!0,d.selected=f[0].oauth2.mappedFields.name,$e(()=>o=!1)),s.$set(d)},i(f){r||(M(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(y(e),y(l)),H(s,f)}}}function G8(n){let e,t,i,l,s,o,r;function a(f){n[15](f)}let u={id:n[27],items:n[6],toggle:!0,zeroFunc:sO,selectPlaceholder:"Select field"};return n[0].oauth2.mappedFields.avatarURL!==void 0&&(u.selected=n[0].oauth2.mappedFields.avatarURL),s=new ps({props:u}),ie.push(()=>be(s,"selected",a)),{c(){e=b("label"),t=B("OAuth2 avatar"),l=C(),j(s.$$.fragment),p(e,"for",i=n[27])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c[0]&134217728&&i!==(i=f[27]))&&p(e,"for",i);const d={};c[0]&134217728&&(d.id=f[27]),c[0]&64&&(d.items=f[6]),!o&&c[0]&1&&(o=!0,d.selected=f[0].oauth2.mappedFields.avatarURL,$e(()=>o=!1)),s.$set(d)},i(f){r||(M(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(y(e),y(l)),H(s,f)}}}function X8(n){let e,t,i,l,s,o,r;function a(f){n[16](f)}let u={id:n[27],items:n[5],toggle:!0,zeroFunc:oO,selectPlaceholder:"Select field"};return n[0].oauth2.mappedFields.id!==void 0&&(u.selected=n[0].oauth2.mappedFields.id),s=new ps({props:u}),ie.push(()=>be(s,"selected",a)),{c(){e=b("label"),t=B("OAuth2 id"),l=C(),j(s.$$.fragment),p(e,"for",i=n[27])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c[0]&134217728&&i!==(i=f[27]))&&p(e,"for",i);const d={};c[0]&134217728&&(d.id=f[27]),c[0]&32&&(d.items=f[5]),!o&&c[0]&1&&(o=!0,d.selected=f[0].oauth2.mappedFields.id,$e(()=>o=!1)),s.$set(d)},i(f){r||(M(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(y(e),y(l)),H(s,f)}}}function Q8(n){let e,t,i,l,s,o,r;function a(f){n[17](f)}let u={id:n[27],items:n[5],toggle:!0,zeroFunc:rO,selectPlaceholder:"Select field"};return n[0].oauth2.mappedFields.username!==void 0&&(u.selected=n[0].oauth2.mappedFields.username),s=new ps({props:u}),ie.push(()=>be(s,"selected",a)),{c(){e=b("label"),t=B("OAuth2 username"),l=C(),j(s.$$.fragment),p(e,"for",i=n[27])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c[0]&134217728&&i!==(i=f[27]))&&p(e,"for",i);const d={};c[0]&134217728&&(d.id=f[27]),c[0]&32&&(d.items=f[5]),!o&&c[0]&1&&(o=!0,d.selected=f[0].oauth2.mappedFields.username,$e(()=>o=!1)),s.$set(d)},i(f){r||(M(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(y(e),y(l)),H(s,f)}}}function x8(n){let e,t,i,l=[],s=new Map,o,r,a,u,f,c,d,m=n[0].name+"",h,g,_,k,S,$,T,O,E;e=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.enabled",$$slots:{default:[B8,({uniqueId:z})=>({27:z}),({uniqueId:z})=>[z?134217728:0]]},$$scope:{ctx:n}}});let L=de(n[0].oauth2.providers);const I=z=>z[28].name;for(let z=0;z Add provider',u=C(),f=b("button"),c=b("strong"),d=B("Optional "),h=B(m),g=B(" create fields map"),_=C(),N.c(),S=C(),R&&R.c(),$=ye(),p(a,"class","btn btn-block btn-lg btn-secondary txt-base"),p(r,"class","col-lg-6"),p(i,"class","grid grid-sm"),p(c,"class","txt"),p(f,"type","button"),p(f,"class",k="m-t-25 btn btn-sm "+(n[4]?"btn-secondary":"btn-hint btn-transparent"))},m(z,F){q(e,z,F),v(z,t,F),v(z,i,F);for(let U=0;U{R=null}),ae())},i(z){T||(M(e.$$.fragment,z),M(R),T=!0)},o(z){D(e.$$.fragment,z),D(R),T=!1},d(z){z&&(y(t),y(i),y(u),y(f),y(S),y($)),H(e,z);for(let F=0;F0),p(r,"class","label label-success")},m(a,u){v(a,e,u),w(e,t),w(e,i),w(e,s),v(a,o,u),v(a,r,u)},p(a,u){u[0]&128&&oe(t,a[7]),u[0]&128&&l!==(l=a[7]==1?"provider":"providers")&&oe(s,l),u[0]&128&&ee(e,"label-warning",!a[7]),u[0]&128&&ee(e,"label-info",a[7]>0)},d(a){a&&(y(e),y(o),y(r))}}}function km(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Oe(qe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,$t,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,$t,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function nO(n){let e,t,i,l,s,o;function r(c,d){return c[0].oauth2.enabled?tO:eO}let a=r(n),u=a(n),f=n[8]&&km();return{c(){e=b("div"),e.innerHTML=' OAuth2',t=C(),i=b("div"),l=C(),u.c(),s=C(),f&&f.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){v(c,e,d),v(c,t,d),v(c,i,d),v(c,l,d),u.m(c,d),v(c,s,d),f&&f.m(c,d),v(c,o,d)},p(c,d){a===(a=r(c))&&u?u.p(c,d):(u.d(1),u=a(c),u&&(u.c(),u.m(s.parentNode,s))),c[8]?f?d[0]&256&&M(f,1):(f=km(),f.c(),M(f,1),f.m(o.parentNode,o)):f&&(re(),D(f,1,1,()=>{f=null}),ae())},d(c){c&&(y(e),y(t),y(i),y(l),y(s),y(o)),u.d(c),f&&f.d(c)}}}function iO(n){var u,f;let e,t,i,l,s,o;e=new ji({props:{single:!0,$$slots:{header:[nO],default:[x8]},$$scope:{ctx:n}}});let r={disabled:((f=(u=n[0].oauth2)==null?void 0:u.providers)==null?void 0:f.map(ym))||[]};i=new V8({props:r}),n[18](i),i.$on("select",n[19]);let a={};return s=new Y5({props:a}),n[20](s),s.$on("remove",n[21]),s.$on("submit",n[22]),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment),l=C(),j(s.$$.fragment)},m(c,d){q(e,c,d),v(c,t,d),q(i,c,d),v(c,l,d),q(s,c,d),o=!0},p(c,d){var _,k;const m={};d[0]&511|d[1]&2&&(m.$$scope={dirty:d,ctx:c}),e.$set(m);const h={};d[0]&1&&(h.disabled=((k=(_=c[0].oauth2)==null?void 0:_.providers)==null?void 0:k.map(ym))||[]),i.$set(h);const g={};s.$set(g)},i(c){o||(M(e.$$.fragment,c),M(i.$$.fragment,c),M(s.$$.fragment,c),o=!0)},o(c){D(e.$$.fragment,c),D(i.$$.fragment,c),D(s.$$.fragment,c),o=!1},d(c){c&&(y(t),y(l)),H(e,c),n[18](null),H(i,c),n[20](null),H(s,c)}}}const lO=()=>"",sO=()=>"",oO=()=>"",rO=()=>"",ym=n=>n.name;function aO(n,e,t){let i,l,s;Qe(n,yn,F=>t(1,s=F));let{collection:o}=e;const r=["id","email","emailVisibility","verified","tokenKey","password"],a=["text","editor","url","email","json"],u=a.concat("file");let f,c,d=!1,m=[],h=[];function g(F=[]){var U,J;t(5,m=((U=F==null?void 0:F.filter(Y=>a.includes(Y.type)&&!r.includes(Y.name)))==null?void 0:U.map(Y=>Y.name))||[]),t(6,h=((J=F==null?void 0:F.filter(Y=>u.includes(Y.type)&&!r.includes(Y.name)))==null?void 0:J.map(Y=>Y.name))||[])}function _(F){for(let U of tf)if(U.key==F)return U;return null}function k(){o.oauth2.enabled=this.checked,t(0,o)}const S=(F,U,J)=>{c==null||c.show(F,U,J)},$=()=>f==null?void 0:f.show(),T=()=>t(4,d=!d);function O(F){n.$$.not_equal(o.oauth2.mappedFields.name,F)&&(o.oauth2.mappedFields.name=F,t(0,o))}function E(F){n.$$.not_equal(o.oauth2.mappedFields.avatarURL,F)&&(o.oauth2.mappedFields.avatarURL=F,t(0,o))}function L(F){n.$$.not_equal(o.oauth2.mappedFields.id,F)&&(o.oauth2.mappedFields.id=F,t(0,o))}function I(F){n.$$.not_equal(o.oauth2.mappedFields.username,F)&&(o.oauth2.mappedFields.username=F,t(0,o))}function A(F){ie[F?"unshift":"push"](()=>{f=F,t(2,f)})}const P=F=>{var U,J;c.show(F.detail,{},((J=(U=o.oauth2)==null?void 0:U.providers)==null?void 0:J.length)||0)};function N(F){ie[F?"unshift":"push"](()=>{c=F,t(3,c)})}const R=F=>{const U=F.detail.uiOptions;V.removeByKey(o.oauth2.providers,"name",U.key),t(0,o)},z=F=>{const U=F.detail.uiOptions,J=F.detail.config;t(0,o.oauth2.providers=o.oauth2.providers||[],o),V.pushOrReplaceByKey(o.oauth2.providers,Object.assign({name:U.key},J),"name"),t(0,o)};return n.$$set=F=>{"collection"in F&&t(0,o=F.collection)},n.$$.update=()=>{var F,U;n.$$.dirty[0]&1&&V.isEmpty(o.oauth2)&&t(0,o.oauth2={enabled:!1,mappedFields:{},providers:[]},o),n.$$.dirty[0]&1&&g(o.fields),n.$$.dirty[0]&2&&t(8,i=!V.isEmpty(s==null?void 0:s.oauth2)),n.$$.dirty[0]&1&&t(7,l=((U=(F=o.oauth2)==null?void 0:F.providers)==null?void 0:U.length)||0)},[o,s,f,c,d,m,h,l,i,_,k,S,$,T,O,E,L,I,A,P,N,R,z]}class uO extends Se{constructor(e){super(),we(this,e,aO,iO,ke,{collection:0},null,[-1,-1])}}function vm(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-information-line link-hint")},m(l,s){v(l,e,s),t||(i=Oe(qe.call(null,e,{text:"Superusers can have OTP only as part of Two-factor authentication.",position:"right"})),t=!0)},d(l){l&&y(e),t=!1,i()}}}function fO(n){let e,t,i,l,s,o,r,a,u,f,c=n[2]&&vm();return{c(){e=b("input"),i=C(),l=b("label"),s=B("Enable"),r=C(),c&&c.c(),a=ye(),p(e,"type","checkbox"),p(e,"id",t=n[8]),p(l,"for",o=n[8])},m(d,m){v(d,e,m),e.checked=n[0].otp.enabled,v(d,i,m),v(d,l,m),w(l,s),v(d,r,m),c&&c.m(d,m),v(d,a,m),u||(f=[W(e,"change",n[4]),W(e,"change",n[5])],u=!0)},p(d,m){m&256&&t!==(t=d[8])&&p(e,"id",t),m&1&&(e.checked=d[0].otp.enabled),m&256&&o!==(o=d[8])&&p(l,"for",o),d[2]?c||(c=vm(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(y(e),y(i),y(l),y(r),y(a)),c&&c.d(d),u=!1,Ie(f)}}}function cO(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Duration (in seconds)"),l=C(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","number"),p(s,"min","0"),p(s,"step","1"),p(s,"id",o=n[8]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].otp.duration),r||(a=W(s,"input",n[6]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(s,"id",o),f&1&>(s.value)!==u[0].otp.duration&&he(s,u[0].otp.duration)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function dO(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Generated password length"),l=C(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","number"),p(s,"min","0"),p(s,"step","1"),p(s,"id",o=n[8]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].otp.length),r||(a=W(s,"input",n[7]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(s,"id",o),f&1&>(s.value)!==u[0].otp.length&&he(s,u[0].otp.length)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function pO(n){let e,t,i,l,s,o,r,a,u;return e=new fe({props:{class:"form-field form-field-toggle",name:"otp.enabled",$$slots:{default:[fO,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),s=new fe({props:{class:"form-field form-field-toggle required",name:"otp.duration",$$slots:{default:[cO,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),a=new fe({props:{class:"form-field form-field-toggle required",name:"otp.length",$$slots:{default:[dO,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),i=b("div"),l=b("div"),j(s.$$.fragment),o=C(),r=b("div"),j(a.$$.fragment),p(l,"class","col-sm-6"),p(r,"class","col-sm-6"),p(i,"class","grid grid-sm")},m(f,c){q(e,f,c),v(f,t,c),v(f,i,c),w(i,l),q(s,l,null),w(i,o),w(i,r),q(a,r,null),u=!0},p(f,c){const d={};c&773&&(d.$$scope={dirty:c,ctx:f}),e.$set(d);const m={};c&769&&(m.$$scope={dirty:c,ctx:f}),s.$set(m);const h={};c&769&&(h.$$scope={dirty:c,ctx:f}),a.$set(h)},i(f){u||(M(e.$$.fragment,f),M(s.$$.fragment,f),M(a.$$.fragment,f),u=!0)},o(f){D(e.$$.fragment,f),D(s.$$.fragment,f),D(a.$$.fragment,f),u=!1},d(f){f&&(y(t),y(i)),H(e,f),H(s),H(a)}}}function mO(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function hO(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function wm(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Oe(qe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,$t,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,$t,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function _O(n){let e,t,i,l,s,o;function r(c,d){return c[0].otp.enabled?hO:mO}let a=r(n),u=a(n),f=n[1]&&wm();return{c(){e=b("div"),e.innerHTML=' One-time password (OTP)',t=C(),i=b("div"),l=C(),u.c(),s=C(),f&&f.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){v(c,e,d),v(c,t,d),v(c,i,d),v(c,l,d),u.m(c,d),v(c,s,d),f&&f.m(c,d),v(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(s.parentNode,s))),c[1]?f?d&2&&M(f,1):(f=wm(),f.c(),M(f,1),f.m(o.parentNode,o)):f&&(re(),D(f,1,1,()=>{f=null}),ae())},d(c){c&&(y(e),y(t),y(i),y(l),y(s),y(o)),u.d(c),f&&f.d(c)}}}function gO(n){let e,t;return e=new ji({props:{single:!0,$$slots:{header:[_O],default:[pO]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&519&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function bO(n,e,t){let i,l,s;Qe(n,yn,c=>t(3,s=c));let{collection:o}=e;function r(){o.otp.enabled=this.checked,t(0,o)}const a=c=>{i&&t(0,o.mfa.enabled=c.target.checked,o)};function u(){o.otp.duration=gt(this.value),t(0,o)}function f(){o.otp.length=gt(this.value),t(0,o)}return n.$$set=c=>{"collection"in c&&t(0,o=c.collection)},n.$$.update=()=>{n.$$.dirty&1&&V.isEmpty(o.otp)&&t(0,o.otp={enabled:!0,duration:300,length:8},o),n.$$.dirty&1&&t(2,i=(o==null?void 0:o.system)&&(o==null?void 0:o.name)==="_superusers"),n.$$.dirty&8&&t(1,l=!V.isEmpty(s==null?void 0:s.otp))},[o,l,i,s,r,a,u,f]}class kO extends Se{constructor(e){super(),we(this,e,bO,gO,ke,{collection:0})}}function Sm(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-information-line link-hint")},m(l,s){v(l,e,s),t||(i=Oe(qe.call(null,e,{text:"Superusers are required to have password auth enabled.",position:"right"})),t=!0)},d(l){l&&y(e),t=!1,i()}}}function yO(n){let e,t,i,l,s,o,r,a,u,f,c=n[3]&&Sm();return{c(){e=b("input"),i=C(),l=b("label"),s=B("Enable"),r=C(),c&&c.c(),a=ye(),p(e,"type","checkbox"),p(e,"id",t=n[9]),e.disabled=n[3],p(l,"for",o=n[9])},m(d,m){v(d,e,m),e.checked=n[0].passwordAuth.enabled,v(d,i,m),v(d,l,m),w(l,s),v(d,r,m),c&&c.m(d,m),v(d,a,m),u||(f=W(e,"change",n[6]),u=!0)},p(d,m){m&512&&t!==(t=d[9])&&p(e,"id",t),m&8&&(e.disabled=d[3]),m&1&&(e.checked=d[0].passwordAuth.enabled),m&512&&o!==(o=d[9])&&p(l,"for",o),d[3]?c||(c=Sm(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(y(e),y(i),y(l),y(r),y(a)),c&&c.d(d),u=!1,f()}}}function vO(n){let e,t,i,l,s,o,r;function a(f){n[7](f)}let u={items:n[1],multiple:!0};return n[0].passwordAuth.identityFields!==void 0&&(u.keyOfSelected=n[0].passwordAuth.identityFields),s=new zn({props:u}),ie.push(()=>be(s,"keyOfSelected",a)),{c(){e=b("label"),t=b("span"),t.textContent="Unique identity fields",l=C(),j(s.$$.fragment),p(t,"class","txt"),p(e,"for",i=n[9])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c&512&&i!==(i=f[9]))&&p(e,"for",i);const d={};c&2&&(d.items=f[1]),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].passwordAuth.identityFields,$e(()=>o=!1)),s.$set(d)},i(f){r||(M(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(y(e),y(l)),H(s,f)}}}function wO(n){let e,t,i,l;return e=new fe({props:{class:"form-field form-field-toggle",name:"passwordAuth.enabled",$$slots:{default:[yO,({uniqueId:s})=>({9:s}),({uniqueId:s})=>s?512:0]},$$scope:{ctx:n}}}),i=new fe({props:{class:"form-field required m-0",name:"passwordAuth.identityFields",$$slots:{default:[vO,({uniqueId:s})=>({9:s}),({uniqueId:s})=>s?512:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(s,o){q(e,s,o),v(s,t,o),q(i,s,o),l=!0},p(s,o){const r={};o&1545&&(r.$$scope={dirty:o,ctx:s}),e.$set(r);const a={};o&1539&&(a.$$scope={dirty:o,ctx:s}),i.$set(a)},i(s){l||(M(e.$$.fragment,s),M(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&y(t),H(e,s),H(i,s)}}}function SO(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function TO(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function Tm(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Oe(qe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,$t,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,$t,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function $O(n){let e,t,i,l,s,o;function r(c,d){return c[0].passwordAuth.enabled?TO:SO}let a=r(n),u=a(n),f=n[2]&&Tm();return{c(){e=b("div"),e.innerHTML=' Identity/Password',t=C(),i=b("div"),l=C(),u.c(),s=C(),f&&f.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){v(c,e,d),v(c,t,d),v(c,i,d),v(c,l,d),u.m(c,d),v(c,s,d),f&&f.m(c,d),v(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(s.parentNode,s))),c[2]?f?d&4&&M(f,1):(f=Tm(),f.c(),M(f,1),f.m(o.parentNode,o)):f&&(re(),D(f,1,1,()=>{f=null}),ae())},d(c){c&&(y(e),y(t),y(i),y(l),y(s),y(o)),u.d(c),f&&f.d(c)}}}function CO(n){let e,t;return e=new ji({props:{single:!0,$$slots:{header:[$O],default:[wO]},$$scope:{ctx:n}}}),e.$on("expand",n[8]),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&1039&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function OO(n,e,t){let i,l,s;Qe(n,yn,d=>t(5,s=d));let{collection:o}=e,r=[];function a(d){const m=[{value:"email"}],h=(d==null?void 0:d.fields)||[],g=(d==null?void 0:d.indexes)||[];for(let _ of g){const k=V.parseIndex(_);if(!k.unique||k.columns.length!=1||k.columns[0].name=="email")continue;const S=h.find($=>!$.hidden&&$.name.toLowerCase()==k.columns[0].name.toLowerCase());S&&m.push({value:S.name})}return m}function u(){o.passwordAuth.enabled=this.checked,t(0,o)}function f(d){n.$$.not_equal(o.passwordAuth.identityFields,d)&&(o.passwordAuth.identityFields=d,t(0,o))}const c=()=>{t(1,r=a(o))};return n.$$set=d=>{"collection"in d&&t(0,o=d.collection)},n.$$.update=()=>{n.$$.dirty&1&&V.isEmpty(o==null?void 0:o.passwordAuth)&&t(0,o.passwordAuth={enabled:!0,identityFields:["email"]},o),n.$$.dirty&1&&t(3,i=(o==null?void 0:o.system)&&(o==null?void 0:o.name)==="_superusers"),n.$$.dirty&32&&t(2,l=!V.isEmpty(s==null?void 0:s.passwordAuth))},[o,r,l,i,a,s,u,f,c]}class MO extends Se{constructor(e){super(),we(this,e,OO,CO,ke,{collection:0})}}function $m(n,e,t){const i=n.slice();return i[22]=e[t],i}function Cm(n,e){let t,i,l,s,o,r=e[22].label+"",a,u,f,c,d,m;return c=Fy(e[11][0]),{key:n,first:null,c(){t=b("div"),i=b("input"),s=C(),o=b("label"),a=B(r),f=C(),p(i,"type","radio"),p(i,"name","template"),p(i,"id",l=e[21]+e[22].value),i.__value=e[22].value,he(i,i.__value),p(o,"for",u=e[21]+e[22].value),p(t,"class","form-field-block"),c.p(i),this.first=t},m(h,g){v(h,t,g),w(t,i),i.checked=i.__value===e[2],w(t,s),w(t,o),w(o,a),w(t,f),d||(m=W(i,"change",e[10]),d=!0)},p(h,g){e=h,g&2097152&&l!==(l=e[21]+e[22].value)&&p(i,"id",l),g&4&&(i.checked=i.__value===e[2]),g&2097152&&u!==(u=e[21]+e[22].value)&&p(o,"for",u)},d(h){h&&y(t),c.r(),d=!1,m()}}}function EO(n){let e=[],t=new Map,i,l=de(n[7]);const s=o=>o[22].value;for(let o=0;o({21:a}),({uniqueId:a})=>a?2097152:0]},$$scope:{ctx:n}}}),l=new fe({props:{class:"form-field required m-0",name:"email",$$slots:{default:[DO,({uniqueId:a})=>({21:a}),({uniqueId:a})=>a?2097152:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),j(t.$$.fragment),i=C(),j(l.$$.fragment),p(e,"id",n[6]),p(e,"autocomplete","off")},m(a,u){v(a,e,u),q(t,e,null),w(e,i),q(l,e,null),s=!0,o||(r=W(e,"submit",nt(n[13])),o=!0)},p(a,u){const f={};u&35651588&&(f.$$scope={dirty:u,ctx:a}),t.$set(f);const c={};u&35651586&&(c.$$scope={dirty:u,ctx:a}),l.$set(c)},i(a){s||(M(t.$$.fragment,a),M(l.$$.fragment,a),s=!0)},o(a){D(t.$$.fragment,a),D(l.$$.fragment,a),s=!1},d(a){a&&y(e),H(t),H(l),o=!1,r()}}}function LO(n){let e;return{c(){e=b("h4"),e.textContent="Send test email",p(e,"class","center txt-break")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function AO(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("button"),t=B("Close"),i=C(),l=b("button"),s=b("i"),o=C(),r=b("span"),r.textContent="Send",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","ri-mail-send-line"),p(r,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=a=!n[5]||n[4],ee(l,"btn-loading",n[4])},m(c,d){v(c,e,d),w(e,t),v(c,i,d),v(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=W(e,"click",n[0]),u=!0)},p(c,d){d&16&&(e.disabled=c[4]),d&48&&a!==(a=!c[5]||c[4])&&(l.disabled=a),d&16&&ee(l,"btn-loading",c[4])},d(c){c&&(y(e),y(i),y(l)),u=!1,f()}}}function PO(n){let e,t,i={class:"overlay-panel-sm email-test-popup",overlayClose:!n[4],escClose:!n[4],beforeHide:n[14],popup:!0,$$slots:{footer:[AO],header:[LO],default:[IO]},$$scope:{ctx:n}};return e=new Qt({props:i}),n[15](e),e.$on("show",n[16]),e.$on("hide",n[17]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&16&&(o.beforeHide=l[14]),s&33554486&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[15](null),H(e,l)}}}const Sa="last_email_test",Om="email_test_request";function NO(n,e,t){let i;const l=kt(),s="email_test_"+V.randomString(5),o=[{label:"Verification",value:"verification"},{label:"Password reset",value:"password-reset"},{label:"Confirm email change",value:"email-change"},{label:"OTP",value:"otp"},{label:"Login alert",value:"login-alert"}];let r,a="",u=localStorage.getItem(Sa),f=o[0].value,c=!1,d=null;function m(I="",A="",P=""){a=I||"_superusers",t(1,u=A||localStorage.getItem(Sa)),t(2,f=P||o[0].value),Ut({}),r==null||r.show()}function h(){return clearTimeout(d),r==null?void 0:r.hide()}async function g(){if(!(!i||c)){t(4,c=!0),localStorage==null||localStorage.setItem(Sa,u),clearTimeout(d),d=setTimeout(()=>{_e.cancelRequest(Om),Ci("Test email send timeout.")},3e4);try{await _e.settings.testEmail(a,u,f,{$cancelKey:Om}),nn("Successfully sent test email."),l("submit"),t(4,c=!1),await dn(),h()}catch(I){t(4,c=!1),_e.error(I)}clearTimeout(d)}}const _=[[]];function k(){f=this.__value,t(2,f)}function S(){u=this.value,t(1,u)}const $=()=>g(),T=()=>!c;function O(I){ie[I?"unshift":"push"](()=>{r=I,t(3,r)})}function E(I){Pe.call(this,n,I)}function L(I){Pe.call(this,n,I)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=!!u&&!!f)},[h,u,f,r,c,i,s,o,g,m,k,_,S,$,T,O,E,L]}class gy extends Se{constructor(e){super(),we(this,e,NO,PO,ke,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function Mm(n,e,t){const i=n.slice();return i[18]=e[t],i[19]=e,i[20]=t,i}function RO(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=B("Send email alert for new logins"),p(e,"type","checkbox"),p(e,"id",t=n[21]),p(l,"for",o=n[21])},m(u,f){v(u,e,f),e.checked=n[0].authAlert.enabled,v(u,i,f),v(u,l,f),w(l,s),r||(a=W(e,"change",n[9]),r=!0)},p(u,f){f&2097152&&t!==(t=u[21])&&p(e,"id",t),f&1&&(e.checked=u[0].authAlert.enabled),f&2097152&&o!==(o=u[21])&&p(l,"for",o)},d(u){u&&(y(e),y(i),y(l)),r=!1,a()}}}function Em(n){let e,t,i;function l(o){n[11](o)}let s={};return n[0]!==void 0&&(s.collection=n[0]),e=new uO({props:s}),ie.push(()=>be(e,"collection",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};!t&&r&1&&(t=!0,a.collection=o[0],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function Dm(n,e){var a;let t,i,l,s;function o(u){e[15](u,e[18])}let r={single:!0,key:e[18].key,title:e[18].label,placeholders:(a=e[18])==null?void 0:a.placeholders};return e[18].config!==void 0&&(r.config=e[18].config),i=new G6({props:r}),ie.push(()=>be(i,"config",o)),{key:n,first:null,c(){t=ye(),j(i.$$.fragment),this.first=t},m(u,f){v(u,t,f),q(i,u,f),s=!0},p(u,f){var d;e=u;const c={};f&4&&(c.key=e[18].key),f&4&&(c.title=e[18].label),f&4&&(c.placeholders=(d=e[18])==null?void 0:d.placeholders),!l&&f&4&&(l=!0,c.config=e[18].config,$e(()=>l=!1)),i.$set(c)},i(u){s||(M(i.$$.fragment,u),s=!0)},o(u){D(i.$$.fragment,u),s=!1},d(u){u&&y(t),H(i,u)}}}function FO(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T,O,E,L,I,A,P=[],N=new Map,R,z,F,U,J,Y,Z,G,pe,ce,ue;o=new fe({props:{class:"form-field form-field-sm form-field-toggle m-0",name:"authAlert.enabled",inlineError:!0,$$slots:{default:[RO,({uniqueId:De})=>({21:De}),({uniqueId:De})=>De?2097152:0]},$$scope:{ctx:n}}});function Te(De){n[10](De)}let Ke={};n[0]!==void 0&&(Ke.collection=n[0]),u=new MO({props:Ke}),ie.push(()=>be(u,"collection",Te));let Je=!n[1]&&Em(n);function ft(De){n[12](De)}let et={};n[0]!==void 0&&(et.collection=n[0]),m=new kO({props:et}),ie.push(()=>be(m,"collection",ft));function xe(De){n[13](De)}let We={};n[0]!==void 0&&(We.collection=n[0]),_=new w5({props:We}),ie.push(()=>be(_,"collection",xe));let at=de(n[2]);const jt=De=>De[18].key;for(let De=0;Debe(J,"collection",Ve));let st={};return G=new gy({props:st}),n[17](G),{c(){e=b("h4"),t=b("div"),i=b("span"),i.textContent="Auth methods",l=C(),s=b("div"),j(o.$$.fragment),r=C(),a=b("div"),j(u.$$.fragment),c=C(),Je&&Je.c(),d=C(),j(m.$$.fragment),g=C(),j(_.$$.fragment),S=C(),$=b("h4"),T=b("span"),T.textContent="Mail templates",O=C(),E=b("button"),E.textContent="Send test email",L=C(),I=b("div"),A=b("div");for(let De=0;Def=!1)),u.$set(Ce),De[1]?Je&&(re(),D(Je,1,1,()=>{Je=null}),ae()):Je?(Je.p(De,Ye),Ye&2&&M(Je,1)):(Je=Em(De),Je.c(),M(Je,1),Je.m(a,d));const ct={};!h&&Ye&1&&(h=!0,ct.collection=De[0],$e(()=>h=!1)),m.$set(ct);const Ht={};!k&&Ye&1&&(k=!0,Ht.collection=De[0],$e(()=>k=!1)),_.$set(Ht),Ye&4&&(at=de(De[2]),re(),P=vt(P,Ye,jt,1,De,at,N,A,Bt,Dm,null,Mm),ae());const Le={};!Y&&Ye&1&&(Y=!0,Le.collection=De[0],$e(()=>Y=!1)),J.$set(Le);const ot={};G.$set(ot)},i(De){if(!pe){M(o.$$.fragment,De),M(u.$$.fragment,De),M(Je),M(m.$$.fragment,De),M(_.$$.fragment,De);for(let Ye=0;Yec==null?void 0:c.show(u.id);function S(O,E){n.$$.not_equal(E.config,O)&&(E.config=O,t(2,f),t(1,i),t(7,l),t(5,r),t(4,a),t(8,s),t(6,o),t(0,u))}function $(O){u=O,t(0,u)}function T(O){ie[O?"unshift":"push"](()=>{c=O,t(3,c)})}return n.$$set=O=>{"collection"in O&&t(0,u=O.collection)},n.$$.update=()=>{var O,E;n.$$.dirty&1&&typeof((O=u.otp)==null?void 0:O.emailTemplate)>"u"&&(t(0,u.otp=u.otp||{},u),t(0,u.otp.emailTemplate={},u)),n.$$.dirty&1&&typeof((E=u.authAlert)==null?void 0:E.emailTemplate)>"u"&&(t(0,u.authAlert=u.authAlert||{},u),t(0,u.authAlert.emailTemplate={},u)),n.$$.dirty&1&&t(1,i=u.system&&u.name==="_superusers"),n.$$.dirty&1&&t(7,l={key:"resetPasswordTemplate",label:"Default Password reset email template",placeholders:["APP_NAME","APP_URL","RECORD:*","TOKEN"],config:u.resetPasswordTemplate}),n.$$.dirty&1&&t(8,s={key:"verificationTemplate",label:"Default Verification email template",placeholders:["APP_NAME","APP_URL","RECORD:*","TOKEN"],config:u.verificationTemplate}),n.$$.dirty&1&&t(6,o={key:"confirmEmailChangeTemplate",label:"Default Confirm email change email template",placeholders:["APP_NAME","APP_URL","RECORD:*","TOKEN"],config:u.confirmEmailChangeTemplate}),n.$$.dirty&1&&t(5,r={key:"otp.emailTemplate",label:"Default OTP email template",placeholders:["APP_NAME","APP_URL","RECORD:*","OTP","OTP_ID"],config:u.otp.emailTemplate}),n.$$.dirty&1&&t(4,a={key:"authAlert.emailTemplate",label:"Default Login alert email template",placeholders:["APP_NAME","APP_URL","RECORD:*"],config:u.authAlert.emailTemplate}),n.$$.dirty&498&&t(2,f=i?[l,r,a]:[s,l,o,r,a])},[u,i,f,c,a,r,o,l,s,d,m,h,g,_,k,S,$,T]}class HO extends Se{constructor(e){super(),we(this,e,qO,FO,ke,{collection:0})}}const jO=n=>({dragging:n&4,dragover:n&8}),Im=n=>({dragging:n[2],dragover:n[3]});function zO(n){let e,t,i,l,s;const o=n[10].default,r=Lt(o,n,n[9],Im);return{c(){e=b("div"),r&&r.c(),p(e,"draggable",t=!n[1]),p(e,"class","draggable svelte-19c69j7"),ee(e,"dragging",n[2]),ee(e,"dragover",n[3])},m(a,u){v(a,e,u),r&&r.m(e,null),i=!0,l||(s=[W(e,"dragover",nt(n[11])),W(e,"dragleave",nt(n[12])),W(e,"dragend",n[13]),W(e,"dragstart",n[14]),W(e,"drop",n[15])],l=!0)},p(a,[u]){r&&r.p&&(!i||u&524)&&Pt(r,o,a,a[9],i?At(o,a[9],u,jO):Nt(a[9]),Im),(!i||u&2&&t!==(t=!a[1]))&&p(e,"draggable",t),(!i||u&4)&&ee(e,"dragging",a[2]),(!i||u&8)&&ee(e,"dragover",a[3])},i(a){i||(M(r,a),i=!0)},o(a){D(r,a),i=!1},d(a){a&&y(e),r&&r.d(a),l=!1,Ie(s)}}}function UO(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=kt();let{index:o}=e,{list:r=[]}=e,{group:a="default"}=e,{disabled:u=!1}=e,{dragHandleClass:f=""}=e,c=!1,d=!1;function m(T,O){if(!(!T||u)){if(f&&!T.target.classList.contains(f)){t(3,d=!1),t(2,c=!1),T.preventDefault();return}t(2,c=!0),T.dataTransfer.effectAllowed="move",T.dataTransfer.dropEffect="move",T.dataTransfer.setData("text/plain",JSON.stringify({index:O,group:a})),s("drag",T)}}function h(T,O){if(t(3,d=!1),t(2,c=!1),!T||u)return;T.dataTransfer.dropEffect="move";let E={};try{E=JSON.parse(T.dataTransfer.getData("text/plain"))}catch{}if(E.group!=a)return;const L=E.index<<0;L{t(3,d=!0)},_=()=>{t(3,d=!1)},k=()=>{t(3,d=!1),t(2,c=!1)},S=T=>m(T,o),$=T=>h(T,o);return n.$$set=T=>{"index"in T&&t(0,o=T.index),"list"in T&&t(6,r=T.list),"group"in T&&t(7,a=T.group),"disabled"in T&&t(1,u=T.disabled),"dragHandleClass"in T&&t(8,f=T.dragHandleClass),"$$scope"in T&&t(9,l=T.$$scope)},[o,u,c,d,m,h,r,a,f,l,i,g,_,k,S,$]}class _o extends Se{constructor(e){super(),we(this,e,UO,zO,ke,{index:0,list:6,group:7,disabled:1,dragHandleClass:8})}}function Lm(n,e,t){const i=n.slice();return i[27]=e[t],i}function VO(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("input"),l=C(),s=b("label"),o=B("Unique"),p(e,"type","checkbox"),p(e,"id",t=n[30]),e.checked=i=n[3].unique,p(s,"for",r=n[30])},m(f,c){v(f,e,c),v(f,l,c),v(f,s,c),w(s,o),a||(u=W(e,"change",n[19]),a=!0)},p(f,c){c[0]&1073741824&&t!==(t=f[30])&&p(e,"id",t),c[0]&8&&i!==(i=f[3].unique)&&(e.checked=i),c[0]&1073741824&&r!==(r=f[30])&&p(s,"for",r)},d(f){f&&(y(e),y(l),y(s)),a=!1,u()}}}function BO(n){let e,t,i,l;function s(a){n[20](a)}var o=n[7];function r(a,u){var c;let f={id:a[30],placeholder:`eg. CREATE INDEX idx_test on ${(c=a[0])==null?void 0:c.name} (created)`,language:"sql-create-index",minHeight:"85"};return a[2]!==void 0&&(f.value=a[2]),{props:f}}return o&&(e=zt(o,r(n)),ie.push(()=>be(e,"value",s))),{c(){e&&j(e.$$.fragment),i=ye()},m(a,u){e&&q(e,a,u),v(a,i,u),l=!0},p(a,u){var f;if(u[0]&128&&o!==(o=a[7])){if(e){re();const c=e;D(c.$$.fragment,1,0,()=>{H(c,1)}),ae()}o?(e=zt(o,r(a)),ie.push(()=>be(e,"value",s)),j(e.$$.fragment),M(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else if(o){const c={};u[0]&1073741824&&(c.id=a[30]),u[0]&1&&(c.placeholder=`eg. CREATE INDEX idx_test on ${(f=a[0])==null?void 0:f.name} (created)`),!t&&u[0]&4&&(t=!0,c.value=a[2],$e(()=>t=!1)),e.$set(c)}},i(a){l||(e&&M(e.$$.fragment,a),l=!0)},o(a){e&&D(e.$$.fragment,a),l=!1},d(a){a&&y(i),e&&H(e,a)}}}function WO(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function YO(n){let e,t,i,l;const s=[WO,BO],o=[];function r(a,u){return a[8]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),v(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),D(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&y(i),o[e].d(a)}}}function Am(n){let e,t,i,l=de(n[10]),s=[];for(let o=0;o({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}}),i=new fe({props:{class:"form-field required m-b-sm",name:`indexes.${n[6]||""}`,$$slots:{default:[YO,({uniqueId:a})=>({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}});let r=n[10].length>0&&Am(n);return{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment),l=C(),r&&r.c(),s=ye()},m(a,u){q(e,a,u),v(a,t,u),q(i,a,u),v(a,l,u),r&&r.m(a,u),v(a,s,u),o=!0},p(a,u){const f={};u[0]&1073741837|u[1]&1&&(f.$$scope={dirty:u,ctx:a}),e.$set(f);const c={};u[0]&64&&(c.name=`indexes.${a[6]||""}`),u[0]&1073742213|u[1]&1&&(c.$$scope={dirty:u,ctx:a}),i.$set(c),a[10].length>0?r?r.p(a,u):(r=Am(a),r.c(),r.m(s.parentNode,s)):r&&(r.d(1),r=null)},i(a){o||(M(e.$$.fragment,a),M(i.$$.fragment,a),o=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),o=!1},d(a){a&&(y(t),y(l),y(s)),H(e,a),H(i,a),r&&r.d(a)}}}function JO(n){let e,t=n[5]?"Update":"Create",i,l;return{c(){e=b("h4"),i=B(t),l=B(" index")},m(s,o){v(s,e,o),w(e,i),w(e,l)},p(s,o){o[0]&32&&t!==(t=s[5]?"Update":"Create")&&oe(i,t)},d(s){s&&y(e)}}}function Nm(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-hint btn-transparent m-r-auto")},m(l,s){v(l,e,s),t||(i=[Oe(qe.call(null,e,{text:"Delete",position:"top"})),W(e,"click",n[16])],t=!0)},p:te,d(l){l&&y(e),t=!1,Ie(i)}}}function ZO(n){let e,t,i,l,s,o,r=n[5]!=""&&Nm(n);return{c(){r&&r.c(),e=C(),t=b("button"),t.innerHTML='Cancel',i=C(),l=b("button"),l.innerHTML='Set index',p(t,"type","button"),p(t,"class","btn btn-transparent"),p(l,"type","button"),p(l,"class","btn"),ee(l,"btn-disabled",n[9].length<=0)},m(a,u){r&&r.m(a,u),v(a,e,u),v(a,t,u),v(a,i,u),v(a,l,u),s||(o=[W(t,"click",n[17]),W(l,"click",n[18])],s=!0)},p(a,u){a[5]!=""?r?r.p(a,u):(r=Nm(a),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null),u[0]&512&&ee(l,"btn-disabled",a[9].length<=0)},d(a){a&&(y(e),y(t),y(i),y(l)),r&&r.d(a),s=!1,Ie(o)}}}function GO(n){let e,t;const i=[{popup:!0},n[14]];let l={$$slots:{footer:[ZO],header:[JO],default:[KO]},$$scope:{ctx:n}};for(let s=0;sZ.name==U);Y?V.removeByValue(J.columns,Y):V.pushUnique(J.columns,{name:U}),t(2,d=V.buildIndex(J))}Xt(async()=>{t(8,g=!0);try{t(7,h=(await Tt(async()=>{const{default:U}=await import("./CodeEditor-Dl2IHbSx.js");return{default:U}},__vite__mapDeps([12,1]),import.meta.url)).default)}catch(U){console.warn(U)}t(8,g=!1)});const E=()=>$(),L=()=>k(),I=()=>T(),A=U=>{t(3,l.unique=U.target.checked,l),t(3,l.tableName=l.tableName||(u==null?void 0:u.name),l),t(2,d=V.buildIndex(l))};function P(U){d=U,t(2,d)}const N=U=>O(U);function R(U){ie[U?"unshift":"push"](()=>{f=U,t(4,f)})}function z(U){Pe.call(this,n,U)}function F(U){Pe.call(this,n,U)}return n.$$set=U=>{e=je(je({},e),Wt(U)),t(14,r=lt(e,o)),"collection"in U&&t(0,u=U.collection)},n.$$.update=()=>{var U,J,Y;n.$$.dirty[0]&1&&t(10,i=((J=(U=u==null?void 0:u.fields)==null?void 0:U.filter(Z=>!Z.toDelete&&Z.name!="id"))==null?void 0:J.map(Z=>Z.name))||[]),n.$$.dirty[0]&4&&t(3,l=V.parseIndex(d)),n.$$.dirty[0]&8&&t(9,s=((Y=l.columns)==null?void 0:Y.map(Z=>Z.name))||[])},[u,k,d,l,f,c,m,h,g,s,i,$,T,O,r,_,E,L,I,A,P,N,R,z,F]}class QO extends Se{constructor(e){super(),we(this,e,XO,GO,ke,{collection:0,show:15,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[1]}}function Rm(n,e,t){const i=n.slice();i[10]=e[t],i[13]=t;const l=V.parseIndex(i[10]);return i[11]=l,i}function Fm(n){let e,t,i,l,s,o;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){var u;v(r,e,a),l=!0,s||(o=Oe(t=qe.call(null,e,(u=n[2])==null?void 0:u.indexes.message)),s=!0)},p(r,a){var u;t&&It(t.update)&&a&4&&t.update.call(null,(u=r[2])==null?void 0:u.indexes.message)},i(r){l||(r&&tt(()=>{l&&(i||(i=He(e,$t,{duration:150},!0)),i.run(1))}),l=!0)},o(r){r&&(i||(i=He(e,$t,{duration:150},!1)),i.run(0)),l=!1},d(r){r&&y(e),r&&i&&i.end(),s=!1,o()}}}function qm(n){let e;return{c(){e=b("strong"),e.textContent="Unique:"},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function Hm(n){var d;let e,t,i,l=((d=n[11].columns)==null?void 0:d.map(jm).join(", "))+"",s,o,r,a,u,f=n[11].unique&&qm();function c(){return n[4](n[10],n[13])}return{c(){var m,h;e=b("button"),f&&f.c(),t=C(),i=b("span"),s=B(l),p(i,"class","txt"),p(e,"type","button"),p(e,"class",o="label link-primary "+((h=(m=n[2].indexes)==null?void 0:m[n[13]])!=null&&h.message?"label-danger":"")+" svelte-167lbwu")},m(m,h){var g,_;v(m,e,h),f&&f.m(e,null),w(e,t),w(e,i),w(i,s),a||(u=[Oe(r=qe.call(null,e,((_=(g=n[2].indexes)==null?void 0:g[n[13]])==null?void 0:_.message)||"")),W(e,"click",c)],a=!0)},p(m,h){var g,_,k,S,$;n=m,n[11].unique?f||(f=qm(),f.c(),f.m(e,t)):f&&(f.d(1),f=null),h&1&&l!==(l=((g=n[11].columns)==null?void 0:g.map(jm).join(", "))+"")&&oe(s,l),h&4&&o!==(o="label link-primary "+((k=(_=n[2].indexes)==null?void 0:_[n[13]])!=null&&k.message?"label-danger":"")+" svelte-167lbwu")&&p(e,"class",o),r&&It(r.update)&&h&4&&r.update.call(null,(($=(S=n[2].indexes)==null?void 0:S[n[13]])==null?void 0:$.message)||"")},d(m){m&&y(e),f&&f.d(),a=!1,Ie(u)}}}function xO(n){var O,E,L,I,A;let e,t,i=(((E=(O=n[0])==null?void 0:O.indexes)==null?void 0:E.length)||0)+"",l,s,o,r,a,u,f,c,d,m,h,g,_=((I=(L=n[2])==null?void 0:L.indexes)==null?void 0:I.message)&&Fm(n),k=de(((A=n[0])==null?void 0:A.indexes)||[]),S=[];for(let P=0;Pbe(c,"collection",$)),c.$on("remove",n[8]),c.$on("submit",n[9]),{c(){e=b("div"),t=B("Unique constraints and indexes ("),l=B(i),s=B(`) +-----END PRIVATE KEY-----`),p(a,"class","help-block")},m(c,d){v(c,e,d),w(e,t),v(c,l,d),v(c,s,d),he(s,n[5]),v(c,r,d),v(c,a,d),u||(f=W(s,"input",n[16]),u=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&p(e,"for",i),d&8388608&&o!==(o=c[23])&&p(s,"id",o),d&32&&he(s,c[5])},d(c){c&&(y(e),y(l),y(s),y(r),y(a)),u=!1,f()}}}function Q8(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S;return l=new fe({props:{class:"form-field required",name:"clientId",$$slots:{default:[K8,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field required",name:"teamId",$$slots:{default:[J8,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),f=new fe({props:{class:"form-field required",name:"keyId",$$slots:{default:[Z8,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),m=new fe({props:{class:"form-field required",name:"duration",$$slots:{default:[G8,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),g=new fe({props:{class:"form-field required",name:"privateKey",$$slots:{default:[X8,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),i=b("div"),j(l.$$.fragment),s=C(),o=b("div"),j(r.$$.fragment),a=C(),u=b("div"),j(f.$$.fragment),c=C(),d=b("div"),j(m.$$.fragment),h=C(),j(g.$$.fragment),p(i,"class","col-lg-6"),p(o,"class","col-lg-6"),p(u,"class","col-lg-6"),p(d,"class","col-lg-6"),p(t,"class","grid"),p(e,"id",n[9]),p(e,"autocomplete","off")},m($,T){v($,e,T),w(e,t),w(t,i),q(l,i,null),w(t,s),w(t,o),q(r,o,null),w(t,a),w(t,u),q(f,u,null),w(t,c),w(t,d),q(m,d,null),w(t,h),q(g,t,null),_=!0,k||(S=W(e,"submit",nt(n[17])),k=!0)},p($,T){const O={};T&25165828&&(O.$$scope={dirty:T,ctx:$}),l.$set(O);const E={};T&25165832&&(E.$$scope={dirty:T,ctx:$}),r.$set(E);const L={};T&25165840&&(L.$$scope={dirty:T,ctx:$}),f.$set(L);const I={};T&25165888&&(I.$$scope={dirty:T,ctx:$}),m.$set(I);const A={};T&25165856&&(A.$$scope={dirty:T,ctx:$}),g.$set(A)},i($){_||(M(l.$$.fragment,$),M(r.$$.fragment,$),M(f.$$.fragment,$),M(m.$$.fragment,$),M(g.$$.fragment,$),_=!0)},o($){D(l.$$.fragment,$),D(r.$$.fragment,$),D(f.$$.fragment,$),D(m.$$.fragment,$),D(g.$$.fragment,$),_=!1},d($){$&&y(e),H(l),H(r),H(f),H(m),H(g),k=!1,S()}}}function x8(n){let e;return{c(){e=b("h4"),e.textContent="Generate Apple client secret",p(e,"class","center txt-break")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function e5(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("button"),t=B("Close"),i=C(),l=b("button"),s=b("i"),o=C(),r=b("span"),r.textContent="Generate and set secret",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[7],p(s,"class","ri-key-line"),p(r,"class","txt"),p(l,"type","submit"),p(l,"form",n[9]),p(l,"class","btn btn-expanded"),l.disabled=a=!n[8]||n[7],ee(l,"btn-loading",n[7])},m(c,d){v(c,e,d),w(e,t),v(c,i,d),v(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=W(e,"click",n[0]),u=!0)},p(c,d){d&128&&(e.disabled=c[7]),d&384&&a!==(a=!c[8]||c[7])&&(l.disabled=a),d&128&&ee(l,"btn-loading",c[7])},d(c){c&&(y(e),y(i),y(l)),u=!1,f()}}}function t5(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[e5],header:[x8],default:[Q8]},$$scope:{ctx:n}};return e=new Qt({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&128&&(o.overlayClose=!l[7]),s&128&&(o.escClose=!l[7]),s&128&&(o.beforeHide=l[18]),s&16777724&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[19](null),H(e,l)}}}const ur=15777e3;function n5(n,e,t){let i;const l=kt(),s="apple_secret_"+V.randomString(5);let o,r,a,u,f,c,d=!1;function m(P={}){t(2,r=P.clientId||""),t(3,a=P.teamId||""),t(4,u=P.keyId||""),t(5,f=P.privateKey||""),t(6,c=P.duration||ur),Ut({}),o==null||o.show()}function h(){return o==null?void 0:o.hide()}async function g(){t(7,d=!0);try{const P=await _e.settings.generateAppleClientSecret(r,a,u,f.trim(),c);t(7,d=!1),nn("Successfully generated client secret."),l("submit",P),o==null||o.hide()}catch(P){_e.error(P)}t(7,d=!1)}function _(){r=this.value,t(2,r)}function k(){a=this.value,t(3,a)}function S(){u=this.value,t(4,u)}function $(){c=gt(this.value),t(6,c)}function T(){f=this.value,t(5,f)}const O=()=>g(),E=()=>!d;function L(P){ie[P?"unshift":"push"](()=>{o=P,t(1,o)})}function I(P){Pe.call(this,n,P)}function A(P){Pe.call(this,n,P)}return t(8,i=!0),[h,o,r,a,u,f,c,d,i,s,g,m,_,k,S,$,T,O,E,L,I,A]}class i5 extends Se{constructor(e){super(),we(this,e,n5,t5,ke,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function l5(n){let e,t,i,l,s,o,r,a,u,f,c={};return r=new i5({props:c}),n[4](r),r.$on("submit",n[5]),{c(){e=b("button"),t=b("i"),i=C(),l=b("span"),l.textContent="Generate secret",o=C(),j(r.$$.fragment),p(t,"class","ri-key-line"),p(l,"class","txt"),p(e,"type","button"),p(e,"class",s="btn btn-sm btn-secondary btn-provider-"+n[1])},m(d,m){v(d,e,m),w(e,t),w(e,i),w(e,l),v(d,o,m),q(r,d,m),a=!0,u||(f=W(e,"click",n[3]),u=!0)},p(d,[m]){(!a||m&2&&s!==(s="btn btn-sm btn-secondary btn-provider-"+d[1]))&&p(e,"class",s);const h={};r.$set(h)},i(d){a||(M(r.$$.fragment,d),a=!0)},o(d){D(r.$$.fragment,d),a=!1},d(d){d&&(y(e),y(o)),n[4](null),H(r,d),u=!1,f()}}}function s5(n,e,t){let{key:i=""}=e,{config:l={}}=e,s;const o=()=>s==null?void 0:s.show({clientId:l.clientId});function r(u){ie[u?"unshift":"push"](()=>{s=u,t(2,s)})}const a=u=>{var f;t(0,l.clientSecret=((f=u.detail)==null?void 0:f.secret)||"",l)};return n.$$set=u=>{"key"in u&&t(1,i=u.key),"config"in u&&t(0,l=u.config)},[l,i,s,o,r,a]}class o5 extends Se{constructor(e){super(),we(this,e,s5,l5,ke,{key:1,config:0})}}function r5(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=B("Auth URL"),l=C(),s=b("input"),r=C(),a=b("div"),a.textContent="Ex. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/authorize",p(e,"for",i=n[4]),p(s,"type","url"),p(s,"id",o=n[4]),s.required=!0,p(a,"class","help-block")},m(c,d){v(c,e,d),w(e,t),v(c,l,d),v(c,s,d),he(s,n[0].authURL),v(c,r,d),v(c,a,d),u||(f=W(s,"input",n[2]),u=!0)},p(c,d){d&16&&i!==(i=c[4])&&p(e,"for",i),d&16&&o!==(o=c[4])&&p(s,"id",o),d&1&&s.value!==c[0].authURL&&he(s,c[0].authURL)},d(c){c&&(y(e),y(l),y(s),y(r),y(a)),u=!1,f()}}}function a5(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=B("Token URL"),l=C(),s=b("input"),r=C(),a=b("div"),a.textContent="Ex. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/token",p(e,"for",i=n[4]),p(s,"type","url"),p(s,"id",o=n[4]),s.required=!0,p(a,"class","help-block")},m(c,d){v(c,e,d),w(e,t),v(c,l,d),v(c,s,d),he(s,n[0].tokenURL),v(c,r,d),v(c,a,d),u||(f=W(s,"input",n[3]),u=!0)},p(c,d){d&16&&i!==(i=c[4])&&p(e,"for",i),d&16&&o!==(o=c[4])&&p(s,"id",o),d&1&&s.value!==c[0].tokenURL&&he(s,c[0].tokenURL)},d(c){c&&(y(e),y(l),y(s),y(r),y(a)),u=!1,f()}}}function u5(n){let e,t,i,l,s,o;return i=new fe({props:{class:"form-field required",name:n[1]+".authURL",$$slots:{default:[r5,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),s=new fe({props:{class:"form-field required",name:n[1]+".tokenURL",$$slots:{default:[a5,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.textContent="Azure AD endpoints",t=C(),j(i.$$.fragment),l=C(),j(s.$$.fragment),p(e,"class","section-title")},m(r,a){v(r,e,a),v(r,t,a),q(i,r,a),v(r,l,a),q(s,r,a),o=!0},p(r,[a]){const u={};a&2&&(u.name=r[1]+".authURL"),a&49&&(u.$$scope={dirty:a,ctx:r}),i.$set(u);const f={};a&2&&(f.name=r[1]+".tokenURL"),a&49&&(f.$$scope={dirty:a,ctx:r}),s.$set(f)},i(r){o||(M(i.$$.fragment,r),M(s.$$.fragment,r),o=!0)},o(r){D(i.$$.fragment,r),D(s.$$.fragment,r),o=!1},d(r){r&&(y(e),y(t),y(l)),H(i,r),H(s,r)}}}function f5(n,e,t){let{key:i=""}=e,{config:l={}}=e;function s(){l.authURL=this.value,t(0,l)}function o(){l.tokenURL=this.value,t(0,l)}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"config"in r&&t(0,l=r.config)},[l,i,s,o]}class c5 extends Se{constructor(e){super(),we(this,e,f5,u5,ke,{key:1,config:0})}}function om(n){let e,t;return{c(){e=b("i"),p(e,"class",t="icon "+n[0].icon)},m(i,l){v(i,e,l)},p(i,l){l&1&&t!==(t="icon "+i[0].icon)&&p(e,"class",t)},d(i){i&&y(e)}}}function d5(n){let e,t,i=(n[0].label||n[0].name||n[0].title||n[0].id||n[0].value)+"",l,s=n[0].icon&&om(n);return{c(){s&&s.c(),e=C(),t=b("span"),l=B(i),p(t,"class","txt")},m(o,r){s&&s.m(o,r),v(o,e,r),v(o,t,r),w(t,l)},p(o,[r]){o[0].icon?s?s.p(o,r):(s=om(o),s.c(),s.m(e.parentNode,e)):s&&(s.d(1),s=null),r&1&&i!==(i=(o[0].label||o[0].name||o[0].title||o[0].id||o[0].value)+"")&&oe(l,i)},i:te,o:te,d(o){o&&(y(e),y(t)),s&&s.d(o)}}}function p5(n,e,t){let{item:i={}}=e;return n.$$set=l=>{"item"in l&&t(0,i=l.item)},[i]}class rm extends Se{constructor(e){super(),we(this,e,p5,d5,ke,{item:0})}}const m5=n=>({}),am=n=>({});function h5(n){let e;const t=n[8].afterOptions,i=Lt(t,n,n[13],am);return{c(){i&&i.c()},m(l,s){i&&i.m(l,s),e=!0},p(l,s){i&&i.p&&(!e||s&8192)&&Pt(i,t,l,l[13],e?At(t,l[13],s,m5):Nt(l[13]),am)},i(l){e||(M(i,l),e=!0)},o(l){D(i,l),e=!1},d(l){i&&i.d(l)}}}function _5(n){let e,t,i;const l=[{items:n[1]},{multiple:n[2]},{labelComponent:n[3]},{optionComponent:n[4]},n[5]];function s(r){n[9](r)}let o={$$slots:{afterOptions:[h5]},$$scope:{ctx:n}};for(let r=0;rbe(e,"selected",s)),e.$on("show",n[10]),e.$on("hide",n[11]),e.$on("change",n[12]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&62?wt(l,[a&2&&{items:r[1]},a&4&&{multiple:r[2]},a&8&&{labelComponent:r[3]},a&16&&{optionComponent:r[4]},a&32&&Rt(r[5])]):{};a&8192&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.selected=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function g5(n,e,t){const i=["items","multiple","selected","labelComponent","optionComponent","selectionKey","keyOfSelected"];let l=lt(e,i),{$$slots:s={},$$scope:o}=e,{items:r=[]}=e,{multiple:a=!1}=e,{selected:u=a?[]:void 0}=e,{labelComponent:f=rm}=e,{optionComponent:c=rm}=e,{selectionKey:d="value"}=e,{keyOfSelected:m=a?[]:void 0}=e;function h(T){T=V.toArray(T,!0);let O=[];for(let E of T){const L=V.findByKey(r,d,E);L&&O.push(L)}T.length&&!O.length||t(0,u=a?O:O[0])}async function g(T){let O=V.toArray(T,!0).map(E=>E[d]);r.length&&t(6,m=a?O:O[0])}function _(T){u=T,t(0,u)}function k(T){Pe.call(this,n,T)}function S(T){Pe.call(this,n,T)}function $(T){Pe.call(this,n,T)}return n.$$set=T=>{e=je(je({},e),Wt(T)),t(5,l=lt(e,i)),"items"in T&&t(1,r=T.items),"multiple"in T&&t(2,a=T.multiple),"selected"in T&&t(0,u=T.selected),"labelComponent"in T&&t(3,f=T.labelComponent),"optionComponent"in T&&t(4,c=T.optionComponent),"selectionKey"in T&&t(7,d=T.selectionKey),"keyOfSelected"in T&&t(6,m=T.keyOfSelected),"$$scope"in T&&t(13,o=T.$$scope)},n.$$.update=()=>{n.$$.dirty&66&&r&&h(m),n.$$.dirty&1&&g(u)},[u,r,a,f,c,l,m,d,s,_,k,S,$,o]}class zn extends Se{constructor(e){super(),we(this,e,g5,_5,ke,{items:1,multiple:2,selected:0,labelComponent:3,optionComponent:4,selectionKey:7,keyOfSelected:6})}}function b5(n){let e,t,i,l,s=[{type:t=n[5].type||"text"},{value:n[4]},{disabled:n[3]},{readOnly:n[2]},n[5]],o={};for(let r=0;r{t(0,o=V.splitNonEmpty(c.target.value,r))};return n.$$set=c=>{e=je(je({},e),Wt(c)),t(5,s=lt(e,l)),"value"in c&&t(0,o=c.value),"separator"in c&&t(1,r=c.separator),"readonly"in c&&t(2,a=c.readonly),"disabled"in c&&t(3,u=c.disabled)},n.$$.update=()=>{n.$$.dirty&3&&t(4,i=V.joinNonEmpty(o,r+" "))},[o,r,a,u,i,s,f]}class ms extends Se{constructor(e){super(),we(this,e,k5,b5,ke,{value:0,separator:1,readonly:2,disabled:3})}}function y5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Display name"),l=C(),s=b("input"),p(e,"for",i=n[13]),p(s,"type","text"),p(s,"id",o=n[13]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].displayName),r||(a=W(s,"input",n[4]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&p(e,"for",i),f&8192&&o!==(o=u[13])&&p(s,"id",o),f&1&&s.value!==u[0].displayName&&he(s,u[0].displayName)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function v5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Auth URL"),l=C(),s=b("input"),p(e,"for",i=n[13]),p(s,"type","url"),p(s,"id",o=n[13]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].authURL),r||(a=W(s,"input",n[5]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&p(e,"for",i),f&8192&&o!==(o=u[13])&&p(s,"id",o),f&1&&s.value!==u[0].authURL&&he(s,u[0].authURL)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function w5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Token URL"),l=C(),s=b("input"),p(e,"for",i=n[13]),p(s,"type","url"),p(s,"id",o=n[13]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].tokenURL),r||(a=W(s,"input",n[6]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&p(e,"for",i),f&8192&&o!==(o=u[13])&&p(s,"id",o),f&1&&s.value!==u[0].tokenURL&&he(s,u[0].tokenURL)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function S5(n){let e,t,i,l,s,o,r;function a(f){n[7](f)}let u={id:n[13],items:n[3]};return n[2]!==void 0&&(u.keyOfSelected=n[2]),s=new zn({props:u}),ie.push(()=>be(s,"keyOfSelected",a)),{c(){e=b("label"),t=B("Fetch user info from"),l=C(),j(s.$$.fragment),p(e,"for",i=n[13])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c&8192&&i!==(i=f[13]))&&p(e,"for",i);const d={};c&8192&&(d.id=f[13]),!o&&c&4&&(o=!0,d.keyOfSelected=f[2],$e(()=>o=!1)),s.$set(d)},i(f){r||(M(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(y(e),y(l)),H(s,f)}}}function T5(n){let e,t,i,l,s,o,r,a;return l=new fe({props:{class:"form-field m-b-xs",name:n[1]+".extra.jwksURL",$$slots:{default:[C5,({uniqueId:u})=>({13:u}),({uniqueId:u})=>u?8192:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:n[1]+".extra.issuers",$$slots:{default:[O5,({uniqueId:u})=>({13:u}),({uniqueId:u})=>u?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("p"),t.innerHTML=`Both fields are considered optional because the parsed id_token + is a direct result of the trusted server code->token exchange response.`,i=C(),j(l.$$.fragment),s=C(),j(o.$$.fragment),p(t,"class","txt-hint txt-sm m-b-xs"),p(e,"class","content")},m(u,f){v(u,e,f),w(e,t),w(e,i),q(l,e,null),w(e,s),q(o,e,null),a=!0},p(u,f){const c={};f&2&&(c.name=u[1]+".extra.jwksURL"),f&24577&&(c.$$scope={dirty:f,ctx:u}),l.$set(c);const d={};f&2&&(d.name=u[1]+".extra.issuers"),f&24577&&(d.$$scope={dirty:f,ctx:u}),o.$set(d)},i(u){a||(M(l.$$.fragment,u),M(o.$$.fragment,u),u&&tt(()=>{a&&(r||(r=He(e,mt,{delay:10,duration:150},!0)),r.run(1))}),a=!0)},o(u){D(l.$$.fragment,u),D(o.$$.fragment,u),u&&(r||(r=He(e,mt,{delay:10,duration:150},!1)),r.run(0)),a=!1},d(u){u&&y(e),H(l),H(o),u&&r&&r.end()}}}function $5(n){let e,t,i,l;return t=new fe({props:{class:"form-field required",name:n[1]+".userInfoURL",$$slots:{default:[M5,({uniqueId:s})=>({13:s}),({uniqueId:s})=>s?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","content")},m(s,o){v(s,e,o),q(t,e,null),l=!0},p(s,o){const r={};o&2&&(r.name=s[1]+".userInfoURL"),o&24577&&(r.$$scope={dirty:o,ctx:s}),t.$set(r)},i(s){l||(M(t.$$.fragment,s),s&&tt(()=>{l&&(i||(i=He(e,mt,{delay:10,duration:150},!0)),i.run(1))}),l=!0)},o(s){D(t.$$.fragment,s),s&&(i||(i=He(e,mt,{delay:10,duration:150},!1)),i.run(0)),l=!1},d(s){s&&y(e),H(t),s&&i&&i.end()}}}function C5(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=b("span"),t.textContent="JWKS verification URL",i=C(),l=b("i"),o=C(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[13]),p(r,"type","url"),p(r,"id",a=n[13])},m(c,d){v(c,e,d),w(e,t),w(e,i),w(e,l),v(c,o,d),v(c,r,d),he(r,n[0].extra.jwksURL),u||(f=[Oe(qe.call(null,l,{text:"URL to the public token verification keys.",position:"top"})),W(r,"input",n[9])],u=!0)},p(c,d){d&8192&&s!==(s=c[13])&&p(e,"for",s),d&8192&&a!==(a=c[13])&&p(r,"id",a),d&1&&r.value!==c[0].extra.jwksURL&&he(r,c[0].extra.jwksURL)},d(c){c&&(y(e),y(o),y(r)),u=!1,Ie(f)}}}function O5(n){let e,t,i,l,s,o,r,a,u,f,c;function d(h){n[10](h)}let m={id:n[13]};return n[0].extra.issuers!==void 0&&(m.value=n[0].extra.issuers),r=new ms({props:m}),ie.push(()=>be(r,"value",d)),{c(){e=b("label"),t=b("span"),t.textContent="Issuers",i=C(),l=b("i"),o=C(),j(r.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[13])},m(h,g){v(h,e,g),w(e,t),w(e,i),w(e,l),v(h,o,g),q(r,h,g),u=!0,f||(c=Oe(qe.call(null,l,{text:"Comma separated list of accepted values for the iss token claim validation.",position:"top"})),f=!0)},p(h,g){(!u||g&8192&&s!==(s=h[13]))&&p(e,"for",s);const _={};g&8192&&(_.id=h[13]),!a&&g&1&&(a=!0,_.value=h[0].extra.issuers,$e(()=>a=!1)),r.$set(_)},i(h){u||(M(r.$$.fragment,h),u=!0)},o(h){D(r.$$.fragment,h),u=!1},d(h){h&&(y(e),y(o)),H(r,h),f=!1,c()}}}function M5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("User info URL"),l=C(),s=b("input"),p(e,"for",i=n[13]),p(s,"type","url"),p(s,"id",o=n[13]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].userInfoURL),r||(a=W(s,"input",n[8]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&p(e,"for",i),f&8192&&o!==(o=u[13])&&p(s,"id",o),f&1&&s.value!==u[0].userInfoURL&&he(s,u[0].userInfoURL)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function E5(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=C(),l=b("label"),s=b("span"),s.textContent="Support PKCE",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[13])},m(c,d){v(c,e,d),e.checked=n[0].pkce,v(c,i,d),v(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=[W(e,"change",n[11]),Oe(qe.call(null,r,{text:"Usually it should be safe to be always enabled as most providers will just ignore the extra query parameters if they don't support PKCE.",position:"right"}))],u=!0)},p(c,d){d&8192&&t!==(t=c[13])&&p(e,"id",t),d&1&&(e.checked=c[0].pkce),d&8192&&a!==(a=c[13])&&p(l,"for",a)},d(c){c&&(y(e),y(i),y(l)),u=!1,Ie(f)}}}function D5(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_;e=new fe({props:{class:"form-field required",name:n[1]+".displayName",$$slots:{default:[y5,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),s=new fe({props:{class:"form-field required",name:n[1]+".authURL",$$slots:{default:[v5,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field required",name:n[1]+".tokenURL",$$slots:{default:[w5,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),u=new fe({props:{class:"form-field m-b-xs",$$slots:{default:[S5,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}});const k=[$5,T5],S=[];function $(T,O){return T[2]?0:1}return d=$(n),m=S[d]=k[d](n),g=new fe({props:{class:"form-field",name:n[1]+".pkce",$$slots:{default:[E5,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),i=b("div"),i.textContent="Endpoints",l=C(),j(s.$$.fragment),o=C(),j(r.$$.fragment),a=C(),j(u.$$.fragment),f=C(),c=b("div"),m.c(),h=C(),j(g.$$.fragment),p(i,"class","section-title"),p(c,"class","sub-panel m-b-base")},m(T,O){q(e,T,O),v(T,t,O),v(T,i,O),v(T,l,O),q(s,T,O),v(T,o,O),q(r,T,O),v(T,a,O),q(u,T,O),v(T,f,O),v(T,c,O),S[d].m(c,null),v(T,h,O),q(g,T,O),_=!0},p(T,[O]){const E={};O&2&&(E.name=T[1]+".displayName"),O&24577&&(E.$$scope={dirty:O,ctx:T}),e.$set(E);const L={};O&2&&(L.name=T[1]+".authURL"),O&24577&&(L.$$scope={dirty:O,ctx:T}),s.$set(L);const I={};O&2&&(I.name=T[1]+".tokenURL"),O&24577&&(I.$$scope={dirty:O,ctx:T}),r.$set(I);const A={};O&24580&&(A.$$scope={dirty:O,ctx:T}),u.$set(A);let P=d;d=$(T),d===P?S[d].p(T,O):(re(),D(S[P],1,1,()=>{S[P]=null}),ae(),m=S[d],m?m.p(T,O):(m=S[d]=k[d](T),m.c()),M(m,1),m.m(c,null));const N={};O&2&&(N.name=T[1]+".pkce"),O&24577&&(N.$$scope={dirty:O,ctx:T}),g.$set(N)},i(T){_||(M(e.$$.fragment,T),M(s.$$.fragment,T),M(r.$$.fragment,T),M(u.$$.fragment,T),M(m),M(g.$$.fragment,T),_=!0)},o(T){D(e.$$.fragment,T),D(s.$$.fragment,T),D(r.$$.fragment,T),D(u.$$.fragment,T),D(m),D(g.$$.fragment,T),_=!1},d(T){T&&(y(t),y(i),y(l),y(o),y(a),y(f),y(c),y(h)),H(e,T),H(s,T),H(r,T),H(u,T),S[d].d(),H(g,T)}}}function I5(n,e,t){let{key:i=""}=e,{config:l={}}=e;const s=[{label:"User info URL",value:!0},{label:"ID Token",value:!1}];let o=!!l.userInfoURL;V.isEmpty(l.pkce)&&(l.pkce=!0),l.displayName||(l.displayName="OIDC"),l.extra||(l.extra={},o=!0);function r(){o?t(0,l.extra={},l):(t(0,l.userInfoURL="",l),t(0,l.extra=l.extra||{},l))}function a(){l.displayName=this.value,t(0,l)}function u(){l.authURL=this.value,t(0,l)}function f(){l.tokenURL=this.value,t(0,l)}function c(_){o=_,t(2,o)}function d(){l.userInfoURL=this.value,t(0,l)}function m(){l.extra.jwksURL=this.value,t(0,l)}function h(_){n.$$.not_equal(l.extra.issuers,_)&&(l.extra.issuers=_,t(0,l))}function g(){l.pkce=this.checked,t(0,l)}return n.$$set=_=>{"key"in _&&t(1,i=_.key),"config"in _&&t(0,l=_.config)},n.$$.update=()=>{n.$$.dirty&4&&typeof o!==void 0&&r()},[l,i,o,s,a,u,f,c,d,m,h,g]}class va extends Se{constructor(e){super(),we(this,e,I5,D5,ke,{key:1,config:0})}}function L5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Auth URL"),l=C(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[3]},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].authURL),r||(a=W(s,"input",n[5]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(s,"id",o),f&8&&(s.required=u[3]),f&1&&s.value!==u[0].authURL&&he(s,u[0].authURL)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function A5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Token URL"),l=C(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[3]},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].tokenURL),r||(a=W(s,"input",n[6]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(s,"id",o),f&8&&(s.required=u[3]),f&1&&s.value!==u[0].tokenURL&&he(s,u[0].tokenURL)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function P5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("User info URL"),l=C(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[3]},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].userInfoURL),r||(a=W(s,"input",n[7]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(s,"id",o),f&8&&(s.required=u[3]),f&1&&s.value!==u[0].userInfoURL&&he(s,u[0].userInfoURL)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function N5(n){let e,t,i,l,s,o,r,a,u;return l=new fe({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".authURL",$$slots:{default:[L5,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".tokenURL",$$slots:{default:[A5,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),a=new fe({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".userInfoURL",$$slots:{default:[P5,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=B(n[2]),i=C(),j(l.$$.fragment),s=C(),j(o.$$.fragment),r=C(),j(a.$$.fragment),p(e,"class","section-title")},m(f,c){v(f,e,c),w(e,t),v(f,i,c),q(l,f,c),v(f,s,c),q(o,f,c),v(f,r,c),q(a,f,c),u=!0},p(f,[c]){(!u||c&4)&&oe(t,f[2]);const d={};c&8&&(d.class="form-field "+(f[3]?"required":"")),c&2&&(d.name=f[1]+".authURL"),c&777&&(d.$$scope={dirty:c,ctx:f}),l.$set(d);const m={};c&8&&(m.class="form-field "+(f[3]?"required":"")),c&2&&(m.name=f[1]+".tokenURL"),c&777&&(m.$$scope={dirty:c,ctx:f}),o.$set(m);const h={};c&8&&(h.class="form-field "+(f[3]?"required":"")),c&2&&(h.name=f[1]+".userInfoURL"),c&777&&(h.$$scope={dirty:c,ctx:f}),a.$set(h)},i(f){u||(M(l.$$.fragment,f),M(o.$$.fragment,f),M(a.$$.fragment,f),u=!0)},o(f){D(l.$$.fragment,f),D(o.$$.fragment,f),D(a.$$.fragment,f),u=!1},d(f){f&&(y(e),y(i),y(s),y(r)),H(l,f),H(o,f),H(a,f)}}}function R5(n,e,t){let i,{key:l=""}=e,{config:s={}}=e,{required:o=!1}=e,{title:r="Provider endpoints"}=e;function a(){s.authURL=this.value,t(0,s)}function u(){s.tokenURL=this.value,t(0,s)}function f(){s.userInfoURL=this.value,t(0,s)}return n.$$set=c=>{"key"in c&&t(1,l=c.key),"config"in c&&t(0,s=c.config),"required"in c&&t(4,o=c.required),"title"in c&&t(2,r=c.title)},n.$$.update=()=>{n.$$.dirty&17&&t(3,i=o&&(s==null?void 0:s.enabled))},[s,l,r,i,o,a,u,f]}class wa extends Se{constructor(e){super(),we(this,e,R5,N5,ke,{key:1,config:0,required:4,title:2})}}const tf=[{key:"apple",title:"Apple",logo:"apple.svg",optionsComponent:o5},{key:"google",title:"Google",logo:"google.svg"},{key:"microsoft",title:"Microsoft",logo:"microsoft.svg",optionsComponent:c5},{key:"yandex",title:"Yandex",logo:"yandex.svg"},{key:"facebook",title:"Facebook",logo:"facebook.svg"},{key:"instagram2",title:"Instagram",logo:"instagram.svg"},{key:"github",title:"GitHub",logo:"github.svg"},{key:"gitlab",title:"GitLab",logo:"gitlab.svg",optionsComponent:wa,optionsComponentProps:{title:"Self-hosted endpoints (optional)"}},{key:"bitbucket",title:"Bitbucket",logo:"bitbucket.svg"},{key:"gitee",title:"Gitee",logo:"gitee.svg"},{key:"gitea",title:"Gitea",logo:"gitea.svg",optionsComponent:wa,optionsComponentProps:{title:"Self-hosted endpoints (optional)"}},{key:"linear",title:"Linear",logo:"linear.svg"},{key:"discord",title:"Discord",logo:"discord.svg"},{key:"twitter",title:"Twitter",logo:"twitter.svg"},{key:"kakao",title:"Kakao",logo:"kakao.svg"},{key:"vk",title:"VK",logo:"vk.svg"},{key:"notion",title:"Notion",logo:"notion.svg"},{key:"monday",title:"monday.com",logo:"monday.svg"},{key:"spotify",title:"Spotify",logo:"spotify.svg"},{key:"twitch",title:"Twitch",logo:"twitch.svg"},{key:"patreon",title:"Patreon (v2)",logo:"patreon.svg"},{key:"strava",title:"Strava",logo:"strava.svg"},{key:"wakatime",title:"WakaTime",logo:"wakatime.svg"},{key:"livechat",title:"LiveChat",logo:"livechat.svg"},{key:"mailcow",title:"mailcow",logo:"mailcow.svg",optionsComponent:wa,optionsComponentProps:{required:!0}},{key:"planningcenter",title:"Planning Center",logo:"planningcenter.svg"},{key:"oidc",title:"OpenID Connect",logo:"oidc.svg",optionsComponent:va},{key:"oidc2",title:"(2) OpenID Connect",logo:"oidc.svg",optionsComponent:va},{key:"oidc3",title:"(3) OpenID Connect",logo:"oidc.svg",optionsComponent:va}];function um(n,e,t){const i=n.slice();return i[16]=e[t],i}function fm(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(o,r){v(o,e,r),i=!0,l||(s=W(e,"click",n[9]),l=!0)},p:te,i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,qn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,qn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function F5(n){let e,t,i,l,s,o,r,a,u,f,c=n[1]!=""&&fm(n);return{c(){e=b("label"),t=b("i"),l=C(),s=b("input"),r=C(),c&&c.c(),a=ye(),p(t,"class","ri-search-line"),p(e,"for",i=n[19]),p(e,"class","m-l-10 txt-xl"),p(s,"id",o=n[19]),p(s,"type","text"),p(s,"placeholder","Search provider")},m(d,m){v(d,e,m),w(e,t),v(d,l,m),v(d,s,m),he(s,n[1]),v(d,r,m),c&&c.m(d,m),v(d,a,m),u||(f=W(s,"input",n[8]),u=!0)},p(d,m){m&524288&&i!==(i=d[19])&&p(e,"for",i),m&524288&&o!==(o=d[19])&&p(s,"id",o),m&2&&s.value!==d[1]&&he(s,d[1]),d[1]!=""?c?(c.p(d,m),m&2&&M(c,1)):(c=fm(d),c.c(),M(c,1),c.m(a.parentNode,a)):c&&(re(),D(c,1,1,()=>{c=null}),ae())},d(d){d&&(y(e),y(l),y(s),y(r),y(a)),c&&c.d(d),u=!1,f()}}}function cm(n){let e,t,i,l,s=n[1]!=""&&dm(n);return{c(){e=b("div"),t=b("span"),t.textContent="No providers to select.",i=C(),s&&s.c(),l=C(),p(t,"class","txt-hint"),p(e,"class","flex inline-flex")},m(o,r){v(o,e,r),w(e,t),w(e,i),s&&s.m(e,null),w(e,l)},p(o,r){o[1]!=""?s?s.p(o,r):(s=dm(o),s.c(),s.m(e,l)):s&&(s.d(1),s=null)},d(o){o&&y(e),s&&s.d()}}}function dm(n){let e,t,i;return{c(){e=b("button"),e.textContent="Clear filter",p(e,"type","button"),p(e,"class","btn btn-sm btn-secondary")},m(l,s){v(l,e,s),t||(i=W(e,"click",n[5]),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function pm(n){let e,t,i;return{c(){e=b("img"),bn(e.src,t="./images/oauth2/"+n[16].logo)||p(e,"src",t),p(e,"alt",i=n[16].title+" logo")},m(l,s){v(l,e,s)},p(l,s){s&8&&!bn(e.src,t="./images/oauth2/"+l[16].logo)&&p(e,"src",t),s&8&&i!==(i=l[16].title+" logo")&&p(e,"alt",i)},d(l){l&&y(e)}}}function mm(n,e){let t,i,l,s,o,r,a=e[16].title+"",u,f,c,d=e[16].key+"",m,h,g,_,k=e[16].logo&&pm(e);function S(){return e[10](e[16])}return{key:n,first:null,c(){t=b("div"),i=b("button"),l=b("figure"),k&&k.c(),s=C(),o=b("div"),r=b("div"),u=B(a),f=C(),c=b("em"),m=B(d),h=C(),p(l,"class","provider-logo"),p(r,"class","title"),p(c,"class","txt-hint txt-sm m-r-auto"),p(o,"class","content"),p(i,"type","button"),p(i,"class","provider-card handle"),p(t,"class","col-6"),this.first=t},m($,T){v($,t,T),w(t,i),w(i,l),k&&k.m(l,null),w(i,s),w(i,o),w(o,r),w(r,u),w(o,f),w(o,c),w(c,m),w(t,h),g||(_=W(i,"click",S),g=!0)},p($,T){e=$,e[16].logo?k?k.p(e,T):(k=pm(e),k.c(),k.m(l,null)):k&&(k.d(1),k=null),T&8&&a!==(a=e[16].title+"")&&oe(u,a),T&8&&d!==(d=e[16].key+"")&&oe(m,d)},d($){$&&y(t),k&&k.d(),g=!1,_()}}}function q5(n){let e,t,i,l=[],s=new Map,o;e=new fe({props:{class:"searchbar m-b-sm",$$slots:{default:[F5,({uniqueId:f})=>({19:f}),({uniqueId:f})=>f?524288:0]},$$scope:{ctx:n}}});let r=de(n[3]);const a=f=>f[16].key;for(let f=0;f!l.includes(T.key)&&($==""||T.key.toLowerCase().includes($)||T.title.toLowerCase().includes($)))}function d(){t(1,o="")}function m(){o=this.value,t(1,o)}const h=()=>t(1,o=""),g=$=>f($);function _($){ie[$?"unshift":"push"](()=>{s=$,t(2,s)})}function k($){Pe.call(this,n,$)}function S($){Pe.call(this,n,$)}return n.$$set=$=>{"disabled"in $&&t(6,l=$.disabled)},n.$$.update=()=>{n.$$.dirty&66&&(o!==-1||l!==-1)&&t(3,r=c())},[u,o,s,r,f,d,l,a,m,h,g,_,k,S]}class V5 extends Se{constructor(e){super(),we(this,e,U5,z5,ke,{disabled:6,show:7,hide:0})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}}function hm(n,e,t){const i=n.slice();i[28]=e[t],i[31]=t;const l=i[9](i[28].name);return i[29]=l,i}function B5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=B("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[27]),p(l,"for",o=n[27])},m(u,f){v(u,e,f),e.checked=n[0].oauth2.enabled,v(u,i,f),v(u,l,f),w(l,s),r||(a=W(e,"change",n[10]),r=!0)},p(u,f){f[0]&134217728&&t!==(t=u[27])&&p(e,"id",t),f[0]&1&&(e.checked=u[0].oauth2.enabled),f[0]&134217728&&o!==(o=u[27])&&p(l,"for",o)},d(u){u&&(y(e),y(i),y(l)),r=!1,a()}}}function W5(n){let e;return{c(){e=b("i"),p(e,"class","ri-puzzle-line txt-sm txt-hint")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function Y5(n){let e,t,i;return{c(){e=b("img"),bn(e.src,t="./images/oauth2/"+n[29].logo)||p(e,"src",t),p(e,"alt",i=n[29].title+" logo")},m(l,s){v(l,e,s)},p(l,s){s[0]&1&&!bn(e.src,t="./images/oauth2/"+l[29].logo)&&p(e,"src",t),s[0]&1&&i!==(i=l[29].title+" logo")&&p(e,"alt",i)},d(l){l&&y(e)}}}function _m(n){let e,t,i;function l(){return n[11](n[29],n[28],n[31])}return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-circle btn-hint btn-transparent"),p(e,"aria-label","Provider settings")},m(s,o){v(s,e,o),t||(i=[Oe(qe.call(null,e,{text:"Edit config",position:"left"})),W(e,"click",l)],t=!0)},p(s,o){n=s},d(s){s&&y(e),t=!1,Ie(i)}}}function gm(n,e){var $;let t,i,l,s,o,r,a=(e[28].displayName||(($=e[29])==null?void 0:$.title)||"Custom")+"",u,f,c,d=e[28].name+"",m,h;function g(T,O){var E;return(E=T[29])!=null&&E.logo?Y5:W5}let _=g(e),k=_(e),S=e[29]&&_m(e);return{key:n,first:null,c(){var T,O,E;t=b("div"),i=b("div"),l=b("figure"),k.c(),s=C(),o=b("div"),r=b("div"),u=B(a),f=C(),c=b("em"),m=B(d),h=C(),S&&S.c(),p(l,"class","provider-logo"),p(r,"class","title"),p(c,"class","txt-hint txt-sm m-r-auto"),p(o,"class","content"),p(i,"class","provider-card"),ee(i,"error",!V.isEmpty((E=(O=(T=e[1])==null?void 0:T.oauth2)==null?void 0:O.providers)==null?void 0:E[e[31]])),p(t,"class","col-lg-6"),this.first=t},m(T,O){v(T,t,O),w(t,i),w(i,l),k.m(l,null),w(i,s),w(i,o),w(o,r),w(r,u),w(o,f),w(o,c),w(c,m),w(i,h),S&&S.m(i,null)},p(T,O){var E,L,I,A;e=T,_===(_=g(e))&&k?k.p(e,O):(k.d(1),k=_(e),k&&(k.c(),k.m(l,null))),O[0]&1&&a!==(a=(e[28].displayName||((E=e[29])==null?void 0:E.title)||"Custom")+"")&&oe(u,a),O[0]&1&&d!==(d=e[28].name+"")&&oe(m,d),e[29]?S?S.p(e,O):(S=_m(e),S.c(),S.m(i,null)):S&&(S.d(1),S=null),O[0]&3&&ee(i,"error",!V.isEmpty((A=(I=(L=e[1])==null?void 0:L.oauth2)==null?void 0:I.providers)==null?void 0:A[e[31]]))},d(T){T&&y(t),k.d(),S&&S.d()}}}function K5(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function J5(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function bm(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g;return l=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.name",$$slots:{default:[Z5,({uniqueId:_})=>({27:_}),({uniqueId:_})=>[_?134217728:0]]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.avatarURL",$$slots:{default:[G5,({uniqueId:_})=>({27:_}),({uniqueId:_})=>[_?134217728:0]]},$$scope:{ctx:n}}}),f=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.id",$$slots:{default:[X5,({uniqueId:_})=>({27:_}),({uniqueId:_})=>[_?134217728:0]]},$$scope:{ctx:n}}}),m=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.username",$$slots:{default:[Q5,({uniqueId:_})=>({27:_}),({uniqueId:_})=>[_?134217728:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),j(l.$$.fragment),s=C(),o=b("div"),j(r.$$.fragment),a=C(),u=b("div"),j(f.$$.fragment),c=C(),d=b("div"),j(m.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(u,"class","col-sm-6"),p(d,"class","col-sm-6"),p(t,"class","grid grid-sm p-t-xs"),p(e,"class","block")},m(_,k){v(_,e,k),w(e,t),w(t,i),q(l,i,null),w(t,s),w(t,o),q(r,o,null),w(t,a),w(t,u),q(f,u,null),w(t,c),w(t,d),q(m,d,null),g=!0},p(_,k){const S={};k[0]&134217761|k[1]&2&&(S.$$scope={dirty:k,ctx:_}),l.$set(S);const $={};k[0]&134217793|k[1]&2&&($.$$scope={dirty:k,ctx:_}),r.$set($);const T={};k[0]&134217761|k[1]&2&&(T.$$scope={dirty:k,ctx:_}),f.$set(T);const O={};k[0]&134217761|k[1]&2&&(O.$$scope={dirty:k,ctx:_}),m.$set(O)},i(_){g||(M(l.$$.fragment,_),M(r.$$.fragment,_),M(f.$$.fragment,_),M(m.$$.fragment,_),_&&tt(()=>{g&&(h||(h=He(e,mt,{duration:150},!0)),h.run(1))}),g=!0)},o(_){D(l.$$.fragment,_),D(r.$$.fragment,_),D(f.$$.fragment,_),D(m.$$.fragment,_),_&&(h||(h=He(e,mt,{duration:150},!1)),h.run(0)),g=!1},d(_){_&&y(e),H(l),H(r),H(f),H(m),_&&h&&h.end()}}}function Z5(n){let e,t,i,l,s,o,r;function a(f){n[14](f)}let u={id:n[27],items:n[5],toggle:!0,zeroFunc:lO,selectPlaceholder:"Select field"};return n[0].oauth2.mappedFields.name!==void 0&&(u.selected=n[0].oauth2.mappedFields.name),s=new ps({props:u}),ie.push(()=>be(s,"selected",a)),{c(){e=b("label"),t=B("OAuth2 full name"),l=C(),j(s.$$.fragment),p(e,"for",i=n[27])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c[0]&134217728&&i!==(i=f[27]))&&p(e,"for",i);const d={};c[0]&134217728&&(d.id=f[27]),c[0]&32&&(d.items=f[5]),!o&&c[0]&1&&(o=!0,d.selected=f[0].oauth2.mappedFields.name,$e(()=>o=!1)),s.$set(d)},i(f){r||(M(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(y(e),y(l)),H(s,f)}}}function G5(n){let e,t,i,l,s,o,r;function a(f){n[15](f)}let u={id:n[27],items:n[6],toggle:!0,zeroFunc:sO,selectPlaceholder:"Select field"};return n[0].oauth2.mappedFields.avatarURL!==void 0&&(u.selected=n[0].oauth2.mappedFields.avatarURL),s=new ps({props:u}),ie.push(()=>be(s,"selected",a)),{c(){e=b("label"),t=B("OAuth2 avatar"),l=C(),j(s.$$.fragment),p(e,"for",i=n[27])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c[0]&134217728&&i!==(i=f[27]))&&p(e,"for",i);const d={};c[0]&134217728&&(d.id=f[27]),c[0]&64&&(d.items=f[6]),!o&&c[0]&1&&(o=!0,d.selected=f[0].oauth2.mappedFields.avatarURL,$e(()=>o=!1)),s.$set(d)},i(f){r||(M(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(y(e),y(l)),H(s,f)}}}function X5(n){let e,t,i,l,s,o,r;function a(f){n[16](f)}let u={id:n[27],items:n[5],toggle:!0,zeroFunc:oO,selectPlaceholder:"Select field"};return n[0].oauth2.mappedFields.id!==void 0&&(u.selected=n[0].oauth2.mappedFields.id),s=new ps({props:u}),ie.push(()=>be(s,"selected",a)),{c(){e=b("label"),t=B("OAuth2 id"),l=C(),j(s.$$.fragment),p(e,"for",i=n[27])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c[0]&134217728&&i!==(i=f[27]))&&p(e,"for",i);const d={};c[0]&134217728&&(d.id=f[27]),c[0]&32&&(d.items=f[5]),!o&&c[0]&1&&(o=!0,d.selected=f[0].oauth2.mappedFields.id,$e(()=>o=!1)),s.$set(d)},i(f){r||(M(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(y(e),y(l)),H(s,f)}}}function Q5(n){let e,t,i,l,s,o,r;function a(f){n[17](f)}let u={id:n[27],items:n[5],toggle:!0,zeroFunc:rO,selectPlaceholder:"Select field"};return n[0].oauth2.mappedFields.username!==void 0&&(u.selected=n[0].oauth2.mappedFields.username),s=new ps({props:u}),ie.push(()=>be(s,"selected",a)),{c(){e=b("label"),t=B("OAuth2 username"),l=C(),j(s.$$.fragment),p(e,"for",i=n[27])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c[0]&134217728&&i!==(i=f[27]))&&p(e,"for",i);const d={};c[0]&134217728&&(d.id=f[27]),c[0]&32&&(d.items=f[5]),!o&&c[0]&1&&(o=!0,d.selected=f[0].oauth2.mappedFields.username,$e(()=>o=!1)),s.$set(d)},i(f){r||(M(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(y(e),y(l)),H(s,f)}}}function x5(n){let e,t,i,l=[],s=new Map,o,r,a,u,f,c,d,m=n[0].name+"",h,g,_,k,S,$,T,O,E;e=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.enabled",$$slots:{default:[B5,({uniqueId:z})=>({27:z}),({uniqueId:z})=>[z?134217728:0]]},$$scope:{ctx:n}}});let L=de(n[0].oauth2.providers);const I=z=>z[28].name;for(let z=0;z Add provider',u=C(),f=b("button"),c=b("strong"),d=B("Optional "),h=B(m),g=B(" create fields map"),_=C(),N.c(),S=C(),R&&R.c(),$=ye(),p(a,"class","btn btn-block btn-lg btn-secondary txt-base"),p(r,"class","col-lg-6"),p(i,"class","grid grid-sm"),p(c,"class","txt"),p(f,"type","button"),p(f,"class",k="m-t-25 btn btn-sm "+(n[4]?"btn-secondary":"btn-hint btn-transparent"))},m(z,F){q(e,z,F),v(z,t,F),v(z,i,F);for(let U=0;U{R=null}),ae())},i(z){T||(M(e.$$.fragment,z),M(R),T=!0)},o(z){D(e.$$.fragment,z),D(R),T=!1},d(z){z&&(y(t),y(i),y(u),y(f),y(S),y($)),H(e,z);for(let F=0;F0),p(r,"class","label label-success")},m(a,u){v(a,e,u),w(e,t),w(e,i),w(e,s),v(a,o,u),v(a,r,u)},p(a,u){u[0]&128&&oe(t,a[7]),u[0]&128&&l!==(l=a[7]==1?"provider":"providers")&&oe(s,l),u[0]&128&&ee(e,"label-warning",!a[7]),u[0]&128&&ee(e,"label-info",a[7]>0)},d(a){a&&(y(e),y(o),y(r))}}}function km(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Oe(qe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,$t,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,$t,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function nO(n){let e,t,i,l,s,o;function r(c,d){return c[0].oauth2.enabled?tO:eO}let a=r(n),u=a(n),f=n[8]&&km();return{c(){e=b("div"),e.innerHTML=' OAuth2',t=C(),i=b("div"),l=C(),u.c(),s=C(),f&&f.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){v(c,e,d),v(c,t,d),v(c,i,d),v(c,l,d),u.m(c,d),v(c,s,d),f&&f.m(c,d),v(c,o,d)},p(c,d){a===(a=r(c))&&u?u.p(c,d):(u.d(1),u=a(c),u&&(u.c(),u.m(s.parentNode,s))),c[8]?f?d[0]&256&&M(f,1):(f=km(),f.c(),M(f,1),f.m(o.parentNode,o)):f&&(re(),D(f,1,1,()=>{f=null}),ae())},d(c){c&&(y(e),y(t),y(i),y(l),y(s),y(o)),u.d(c),f&&f.d(c)}}}function iO(n){var u,f;let e,t,i,l,s,o;e=new ji({props:{single:!0,$$slots:{header:[nO],default:[x5]},$$scope:{ctx:n}}});let r={disabled:((f=(u=n[0].oauth2)==null?void 0:u.providers)==null?void 0:f.map(ym))||[]};i=new V5({props:r}),n[18](i),i.$on("select",n[19]);let a={};return s=new Y8({props:a}),n[20](s),s.$on("remove",n[21]),s.$on("submit",n[22]),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment),l=C(),j(s.$$.fragment)},m(c,d){q(e,c,d),v(c,t,d),q(i,c,d),v(c,l,d),q(s,c,d),o=!0},p(c,d){var _,k;const m={};d[0]&511|d[1]&2&&(m.$$scope={dirty:d,ctx:c}),e.$set(m);const h={};d[0]&1&&(h.disabled=((k=(_=c[0].oauth2)==null?void 0:_.providers)==null?void 0:k.map(ym))||[]),i.$set(h);const g={};s.$set(g)},i(c){o||(M(e.$$.fragment,c),M(i.$$.fragment,c),M(s.$$.fragment,c),o=!0)},o(c){D(e.$$.fragment,c),D(i.$$.fragment,c),D(s.$$.fragment,c),o=!1},d(c){c&&(y(t),y(l)),H(e,c),n[18](null),H(i,c),n[20](null),H(s,c)}}}const lO=()=>"",sO=()=>"",oO=()=>"",rO=()=>"",ym=n=>n.name;function aO(n,e,t){let i,l,s;Qe(n,yn,F=>t(1,s=F));let{collection:o}=e;const r=["id","email","emailVisibility","verified","tokenKey","password"],a=["text","editor","url","email","json"],u=a.concat("file");let f,c,d=!1,m=[],h=[];function g(F=[]){var U,J;t(5,m=((U=F==null?void 0:F.filter(Y=>a.includes(Y.type)&&!r.includes(Y.name)))==null?void 0:U.map(Y=>Y.name))||[]),t(6,h=((J=F==null?void 0:F.filter(Y=>u.includes(Y.type)&&!r.includes(Y.name)))==null?void 0:J.map(Y=>Y.name))||[])}function _(F){for(let U of tf)if(U.key==F)return U;return null}function k(){o.oauth2.enabled=this.checked,t(0,o)}const S=(F,U,J)=>{c==null||c.show(F,U,J)},$=()=>f==null?void 0:f.show(),T=()=>t(4,d=!d);function O(F){n.$$.not_equal(o.oauth2.mappedFields.name,F)&&(o.oauth2.mappedFields.name=F,t(0,o))}function E(F){n.$$.not_equal(o.oauth2.mappedFields.avatarURL,F)&&(o.oauth2.mappedFields.avatarURL=F,t(0,o))}function L(F){n.$$.not_equal(o.oauth2.mappedFields.id,F)&&(o.oauth2.mappedFields.id=F,t(0,o))}function I(F){n.$$.not_equal(o.oauth2.mappedFields.username,F)&&(o.oauth2.mappedFields.username=F,t(0,o))}function A(F){ie[F?"unshift":"push"](()=>{f=F,t(2,f)})}const P=F=>{var U,J;c.show(F.detail,{},((J=(U=o.oauth2)==null?void 0:U.providers)==null?void 0:J.length)||0)};function N(F){ie[F?"unshift":"push"](()=>{c=F,t(3,c)})}const R=F=>{const U=F.detail.uiOptions;V.removeByKey(o.oauth2.providers,"name",U.key),t(0,o)},z=F=>{const U=F.detail.uiOptions,J=F.detail.config;t(0,o.oauth2.providers=o.oauth2.providers||[],o),V.pushOrReplaceByKey(o.oauth2.providers,Object.assign({name:U.key},J),"name"),t(0,o)};return n.$$set=F=>{"collection"in F&&t(0,o=F.collection)},n.$$.update=()=>{var F,U;n.$$.dirty[0]&1&&V.isEmpty(o.oauth2)&&t(0,o.oauth2={enabled:!1,mappedFields:{},providers:[]},o),n.$$.dirty[0]&1&&g(o.fields),n.$$.dirty[0]&2&&t(8,i=!V.isEmpty(s==null?void 0:s.oauth2)),n.$$.dirty[0]&1&&t(7,l=((U=(F=o.oauth2)==null?void 0:F.providers)==null?void 0:U.length)||0)},[o,s,f,c,d,m,h,l,i,_,k,S,$,T,O,E,L,I,A,P,N,R,z]}class uO extends Se{constructor(e){super(),we(this,e,aO,iO,ke,{collection:0},null,[-1,-1])}}function vm(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-information-line link-hint")},m(l,s){v(l,e,s),t||(i=Oe(qe.call(null,e,{text:"Superusers can have OTP only as part of Two-factor authentication.",position:"right"})),t=!0)},d(l){l&&y(e),t=!1,i()}}}function fO(n){let e,t,i,l,s,o,r,a,u,f,c=n[2]&&vm();return{c(){e=b("input"),i=C(),l=b("label"),s=B("Enable"),r=C(),c&&c.c(),a=ye(),p(e,"type","checkbox"),p(e,"id",t=n[8]),p(l,"for",o=n[8])},m(d,m){v(d,e,m),e.checked=n[0].otp.enabled,v(d,i,m),v(d,l,m),w(l,s),v(d,r,m),c&&c.m(d,m),v(d,a,m),u||(f=[W(e,"change",n[4]),W(e,"change",n[5])],u=!0)},p(d,m){m&256&&t!==(t=d[8])&&p(e,"id",t),m&1&&(e.checked=d[0].otp.enabled),m&256&&o!==(o=d[8])&&p(l,"for",o),d[2]?c||(c=vm(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(y(e),y(i),y(l),y(r),y(a)),c&&c.d(d),u=!1,Ie(f)}}}function cO(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Duration (in seconds)"),l=C(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","number"),p(s,"min","0"),p(s,"step","1"),p(s,"id",o=n[8]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].otp.duration),r||(a=W(s,"input",n[6]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(s,"id",o),f&1&>(s.value)!==u[0].otp.duration&&he(s,u[0].otp.duration)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function dO(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Generated password length"),l=C(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","number"),p(s,"min","0"),p(s,"step","1"),p(s,"id",o=n[8]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].otp.length),r||(a=W(s,"input",n[7]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(s,"id",o),f&1&>(s.value)!==u[0].otp.length&&he(s,u[0].otp.length)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function pO(n){let e,t,i,l,s,o,r,a,u;return e=new fe({props:{class:"form-field form-field-toggle",name:"otp.enabled",$$slots:{default:[fO,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),s=new fe({props:{class:"form-field form-field-toggle required",name:"otp.duration",$$slots:{default:[cO,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),a=new fe({props:{class:"form-field form-field-toggle required",name:"otp.length",$$slots:{default:[dO,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),i=b("div"),l=b("div"),j(s.$$.fragment),o=C(),r=b("div"),j(a.$$.fragment),p(l,"class","col-sm-6"),p(r,"class","col-sm-6"),p(i,"class","grid grid-sm")},m(f,c){q(e,f,c),v(f,t,c),v(f,i,c),w(i,l),q(s,l,null),w(i,o),w(i,r),q(a,r,null),u=!0},p(f,c){const d={};c&773&&(d.$$scope={dirty:c,ctx:f}),e.$set(d);const m={};c&769&&(m.$$scope={dirty:c,ctx:f}),s.$set(m);const h={};c&769&&(h.$$scope={dirty:c,ctx:f}),a.$set(h)},i(f){u||(M(e.$$.fragment,f),M(s.$$.fragment,f),M(a.$$.fragment,f),u=!0)},o(f){D(e.$$.fragment,f),D(s.$$.fragment,f),D(a.$$.fragment,f),u=!1},d(f){f&&(y(t),y(i)),H(e,f),H(s),H(a)}}}function mO(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function hO(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function wm(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Oe(qe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,$t,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,$t,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function _O(n){let e,t,i,l,s,o;function r(c,d){return c[0].otp.enabled?hO:mO}let a=r(n),u=a(n),f=n[1]&&wm();return{c(){e=b("div"),e.innerHTML=' One-time password (OTP)',t=C(),i=b("div"),l=C(),u.c(),s=C(),f&&f.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){v(c,e,d),v(c,t,d),v(c,i,d),v(c,l,d),u.m(c,d),v(c,s,d),f&&f.m(c,d),v(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(s.parentNode,s))),c[1]?f?d&2&&M(f,1):(f=wm(),f.c(),M(f,1),f.m(o.parentNode,o)):f&&(re(),D(f,1,1,()=>{f=null}),ae())},d(c){c&&(y(e),y(t),y(i),y(l),y(s),y(o)),u.d(c),f&&f.d(c)}}}function gO(n){let e,t;return e=new ji({props:{single:!0,$$slots:{header:[_O],default:[pO]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&519&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function bO(n,e,t){let i,l,s;Qe(n,yn,c=>t(3,s=c));let{collection:o}=e;function r(){o.otp.enabled=this.checked,t(0,o)}const a=c=>{i&&t(0,o.mfa.enabled=c.target.checked,o)};function u(){o.otp.duration=gt(this.value),t(0,o)}function f(){o.otp.length=gt(this.value),t(0,o)}return n.$$set=c=>{"collection"in c&&t(0,o=c.collection)},n.$$.update=()=>{n.$$.dirty&1&&V.isEmpty(o.otp)&&t(0,o.otp={enabled:!0,duration:300,length:8},o),n.$$.dirty&1&&t(2,i=(o==null?void 0:o.system)&&(o==null?void 0:o.name)==="_superusers"),n.$$.dirty&8&&t(1,l=!V.isEmpty(s==null?void 0:s.otp))},[o,l,i,s,r,a,u,f]}class kO extends Se{constructor(e){super(),we(this,e,bO,gO,ke,{collection:0})}}function Sm(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-information-line link-hint")},m(l,s){v(l,e,s),t||(i=Oe(qe.call(null,e,{text:"Superusers are required to have password auth enabled.",position:"right"})),t=!0)},d(l){l&&y(e),t=!1,i()}}}function yO(n){let e,t,i,l,s,o,r,a,u,f,c=n[3]&&Sm();return{c(){e=b("input"),i=C(),l=b("label"),s=B("Enable"),r=C(),c&&c.c(),a=ye(),p(e,"type","checkbox"),p(e,"id",t=n[9]),e.disabled=n[3],p(l,"for",o=n[9])},m(d,m){v(d,e,m),e.checked=n[0].passwordAuth.enabled,v(d,i,m),v(d,l,m),w(l,s),v(d,r,m),c&&c.m(d,m),v(d,a,m),u||(f=W(e,"change",n[6]),u=!0)},p(d,m){m&512&&t!==(t=d[9])&&p(e,"id",t),m&8&&(e.disabled=d[3]),m&1&&(e.checked=d[0].passwordAuth.enabled),m&512&&o!==(o=d[9])&&p(l,"for",o),d[3]?c||(c=Sm(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(y(e),y(i),y(l),y(r),y(a)),c&&c.d(d),u=!1,f()}}}function vO(n){let e,t,i,l,s,o,r;function a(f){n[7](f)}let u={items:n[1],multiple:!0};return n[0].passwordAuth.identityFields!==void 0&&(u.keyOfSelected=n[0].passwordAuth.identityFields),s=new zn({props:u}),ie.push(()=>be(s,"keyOfSelected",a)),{c(){e=b("label"),t=b("span"),t.textContent="Unique identity fields",l=C(),j(s.$$.fragment),p(t,"class","txt"),p(e,"for",i=n[9])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c&512&&i!==(i=f[9]))&&p(e,"for",i);const d={};c&2&&(d.items=f[1]),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].passwordAuth.identityFields,$e(()=>o=!1)),s.$set(d)},i(f){r||(M(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(y(e),y(l)),H(s,f)}}}function wO(n){let e,t,i,l;return e=new fe({props:{class:"form-field form-field-toggle",name:"passwordAuth.enabled",$$slots:{default:[yO,({uniqueId:s})=>({9:s}),({uniqueId:s})=>s?512:0]},$$scope:{ctx:n}}}),i=new fe({props:{class:"form-field required m-0",name:"passwordAuth.identityFields",$$slots:{default:[vO,({uniqueId:s})=>({9:s}),({uniqueId:s})=>s?512:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(s,o){q(e,s,o),v(s,t,o),q(i,s,o),l=!0},p(s,o){const r={};o&1545&&(r.$$scope={dirty:o,ctx:s}),e.$set(r);const a={};o&1539&&(a.$$scope={dirty:o,ctx:s}),i.$set(a)},i(s){l||(M(e.$$.fragment,s),M(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&y(t),H(e,s),H(i,s)}}}function SO(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function TO(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function Tm(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Oe(qe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,$t,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,$t,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function $O(n){let e,t,i,l,s,o;function r(c,d){return c[0].passwordAuth.enabled?TO:SO}let a=r(n),u=a(n),f=n[2]&&Tm();return{c(){e=b("div"),e.innerHTML=' Identity/Password',t=C(),i=b("div"),l=C(),u.c(),s=C(),f&&f.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){v(c,e,d),v(c,t,d),v(c,i,d),v(c,l,d),u.m(c,d),v(c,s,d),f&&f.m(c,d),v(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(s.parentNode,s))),c[2]?f?d&4&&M(f,1):(f=Tm(),f.c(),M(f,1),f.m(o.parentNode,o)):f&&(re(),D(f,1,1,()=>{f=null}),ae())},d(c){c&&(y(e),y(t),y(i),y(l),y(s),y(o)),u.d(c),f&&f.d(c)}}}function CO(n){let e,t;return e=new ji({props:{single:!0,$$slots:{header:[$O],default:[wO]},$$scope:{ctx:n}}}),e.$on("expand",n[8]),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&1039&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function OO(n,e,t){let i,l,s;Qe(n,yn,d=>t(5,s=d));let{collection:o}=e,r=[];function a(d){const m=[{value:"email"}],h=(d==null?void 0:d.fields)||[],g=(d==null?void 0:d.indexes)||[];for(let _ of g){const k=V.parseIndex(_);if(!k.unique||k.columns.length!=1||k.columns[0].name=="email")continue;const S=h.find($=>!$.hidden&&$.name.toLowerCase()==k.columns[0].name.toLowerCase());S&&m.push({value:S.name})}return m}function u(){o.passwordAuth.enabled=this.checked,t(0,o)}function f(d){n.$$.not_equal(o.passwordAuth.identityFields,d)&&(o.passwordAuth.identityFields=d,t(0,o))}const c=()=>{t(1,r=a(o))};return n.$$set=d=>{"collection"in d&&t(0,o=d.collection)},n.$$.update=()=>{n.$$.dirty&1&&V.isEmpty(o==null?void 0:o.passwordAuth)&&t(0,o.passwordAuth={enabled:!0,identityFields:["email"]},o),n.$$.dirty&1&&t(3,i=(o==null?void 0:o.system)&&(o==null?void 0:o.name)==="_superusers"),n.$$.dirty&32&&t(2,l=!V.isEmpty(s==null?void 0:s.passwordAuth))},[o,r,l,i,a,s,u,f,c]}class MO extends Se{constructor(e){super(),we(this,e,OO,CO,ke,{collection:0})}}function $m(n,e,t){const i=n.slice();return i[22]=e[t],i}function Cm(n,e){let t,i,l,s,o,r=e[22].label+"",a,u,f,c,d,m;return c=Fy(e[11][0]),{key:n,first:null,c(){t=b("div"),i=b("input"),s=C(),o=b("label"),a=B(r),f=C(),p(i,"type","radio"),p(i,"name","template"),p(i,"id",l=e[21]+e[22].value),i.__value=e[22].value,he(i,i.__value),p(o,"for",u=e[21]+e[22].value),p(t,"class","form-field-block"),c.p(i),this.first=t},m(h,g){v(h,t,g),w(t,i),i.checked=i.__value===e[2],w(t,s),w(t,o),w(o,a),w(t,f),d||(m=W(i,"change",e[10]),d=!0)},p(h,g){e=h,g&2097152&&l!==(l=e[21]+e[22].value)&&p(i,"id",l),g&4&&(i.checked=i.__value===e[2]),g&2097152&&u!==(u=e[21]+e[22].value)&&p(o,"for",u)},d(h){h&&y(t),c.r(),d=!1,m()}}}function EO(n){let e=[],t=new Map,i,l=de(n[7]);const s=o=>o[22].value;for(let o=0;o({21:a}),({uniqueId:a})=>a?2097152:0]},$$scope:{ctx:n}}}),l=new fe({props:{class:"form-field required m-0",name:"email",$$slots:{default:[DO,({uniqueId:a})=>({21:a}),({uniqueId:a})=>a?2097152:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),j(t.$$.fragment),i=C(),j(l.$$.fragment),p(e,"id",n[6]),p(e,"autocomplete","off")},m(a,u){v(a,e,u),q(t,e,null),w(e,i),q(l,e,null),s=!0,o||(r=W(e,"submit",nt(n[13])),o=!0)},p(a,u){const f={};u&35651588&&(f.$$scope={dirty:u,ctx:a}),t.$set(f);const c={};u&35651586&&(c.$$scope={dirty:u,ctx:a}),l.$set(c)},i(a){s||(M(t.$$.fragment,a),M(l.$$.fragment,a),s=!0)},o(a){D(t.$$.fragment,a),D(l.$$.fragment,a),s=!1},d(a){a&&y(e),H(t),H(l),o=!1,r()}}}function LO(n){let e;return{c(){e=b("h4"),e.textContent="Send test email",p(e,"class","center txt-break")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function AO(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("button"),t=B("Close"),i=C(),l=b("button"),s=b("i"),o=C(),r=b("span"),r.textContent="Send",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","ri-mail-send-line"),p(r,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=a=!n[5]||n[4],ee(l,"btn-loading",n[4])},m(c,d){v(c,e,d),w(e,t),v(c,i,d),v(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=W(e,"click",n[0]),u=!0)},p(c,d){d&16&&(e.disabled=c[4]),d&48&&a!==(a=!c[5]||c[4])&&(l.disabled=a),d&16&&ee(l,"btn-loading",c[4])},d(c){c&&(y(e),y(i),y(l)),u=!1,f()}}}function PO(n){let e,t,i={class:"overlay-panel-sm email-test-popup",overlayClose:!n[4],escClose:!n[4],beforeHide:n[14],popup:!0,$$slots:{footer:[AO],header:[LO],default:[IO]},$$scope:{ctx:n}};return e=new Qt({props:i}),n[15](e),e.$on("show",n[16]),e.$on("hide",n[17]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&16&&(o.beforeHide=l[14]),s&33554486&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[15](null),H(e,l)}}}const Sa="last_email_test",Om="email_test_request";function NO(n,e,t){let i;const l=kt(),s="email_test_"+V.randomString(5),o=[{label:"Verification",value:"verification"},{label:"Password reset",value:"password-reset"},{label:"Confirm email change",value:"email-change"},{label:"OTP",value:"otp"},{label:"Login alert",value:"login-alert"}];let r,a="",u=localStorage.getItem(Sa),f=o[0].value,c=!1,d=null;function m(I="",A="",P=""){a=I||"_superusers",t(1,u=A||localStorage.getItem(Sa)),t(2,f=P||o[0].value),Ut({}),r==null||r.show()}function h(){return clearTimeout(d),r==null?void 0:r.hide()}async function g(){if(!(!i||c)){t(4,c=!0),localStorage==null||localStorage.setItem(Sa,u),clearTimeout(d),d=setTimeout(()=>{_e.cancelRequest(Om),Ci("Test email send timeout.")},3e4);try{await _e.settings.testEmail(a,u,f,{$cancelKey:Om}),nn("Successfully sent test email."),l("submit"),t(4,c=!1),await dn(),h()}catch(I){t(4,c=!1),_e.error(I)}clearTimeout(d)}}const _=[[]];function k(){f=this.__value,t(2,f)}function S(){u=this.value,t(1,u)}const $=()=>g(),T=()=>!c;function O(I){ie[I?"unshift":"push"](()=>{r=I,t(3,r)})}function E(I){Pe.call(this,n,I)}function L(I){Pe.call(this,n,I)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=!!u&&!!f)},[h,u,f,r,c,i,s,o,g,m,k,_,S,$,T,O,E,L]}class gy extends Se{constructor(e){super(),we(this,e,NO,PO,ke,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function Mm(n,e,t){const i=n.slice();return i[18]=e[t],i[19]=e,i[20]=t,i}function RO(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=B("Send email alert for new logins"),p(e,"type","checkbox"),p(e,"id",t=n[21]),p(l,"for",o=n[21])},m(u,f){v(u,e,f),e.checked=n[0].authAlert.enabled,v(u,i,f),v(u,l,f),w(l,s),r||(a=W(e,"change",n[9]),r=!0)},p(u,f){f&2097152&&t!==(t=u[21])&&p(e,"id",t),f&1&&(e.checked=u[0].authAlert.enabled),f&2097152&&o!==(o=u[21])&&p(l,"for",o)},d(u){u&&(y(e),y(i),y(l)),r=!1,a()}}}function Em(n){let e,t,i;function l(o){n[11](o)}let s={};return n[0]!==void 0&&(s.collection=n[0]),e=new uO({props:s}),ie.push(()=>be(e,"collection",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};!t&&r&1&&(t=!0,a.collection=o[0],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function Dm(n,e){var a;let t,i,l,s;function o(u){e[15](u,e[18])}let r={single:!0,key:e[18].key,title:e[18].label,placeholders:(a=e[18])==null?void 0:a.placeholders};return e[18].config!==void 0&&(r.config=e[18].config),i=new G6({props:r}),ie.push(()=>be(i,"config",o)),{key:n,first:null,c(){t=ye(),j(i.$$.fragment),this.first=t},m(u,f){v(u,t,f),q(i,u,f),s=!0},p(u,f){var d;e=u;const c={};f&4&&(c.key=e[18].key),f&4&&(c.title=e[18].label),f&4&&(c.placeholders=(d=e[18])==null?void 0:d.placeholders),!l&&f&4&&(l=!0,c.config=e[18].config,$e(()=>l=!1)),i.$set(c)},i(u){s||(M(i.$$.fragment,u),s=!0)},o(u){D(i.$$.fragment,u),s=!1},d(u){u&&y(t),H(i,u)}}}function FO(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T,O,E,L,I,A,P=[],N=new Map,R,z,F,U,J,Y,Z,G,pe,ce,ue;o=new fe({props:{class:"form-field form-field-sm form-field-toggle m-0",name:"authAlert.enabled",inlineError:!0,$$slots:{default:[RO,({uniqueId:De})=>({21:De}),({uniqueId:De})=>De?2097152:0]},$$scope:{ctx:n}}});function Te(De){n[10](De)}let Ke={};n[0]!==void 0&&(Ke.collection=n[0]),u=new MO({props:Ke}),ie.push(()=>be(u,"collection",Te));let Je=!n[1]&&Em(n);function ft(De){n[12](De)}let et={};n[0]!==void 0&&(et.collection=n[0]),m=new kO({props:et}),ie.push(()=>be(m,"collection",ft));function xe(De){n[13](De)}let We={};n[0]!==void 0&&(We.collection=n[0]),_=new w8({props:We}),ie.push(()=>be(_,"collection",xe));let at=de(n[2]);const jt=De=>De[18].key;for(let De=0;Debe(J,"collection",Ve));let st={};return G=new gy({props:st}),n[17](G),{c(){e=b("h4"),t=b("div"),i=b("span"),i.textContent="Auth methods",l=C(),s=b("div"),j(o.$$.fragment),r=C(),a=b("div"),j(u.$$.fragment),c=C(),Je&&Je.c(),d=C(),j(m.$$.fragment),g=C(),j(_.$$.fragment),S=C(),$=b("h4"),T=b("span"),T.textContent="Mail templates",O=C(),E=b("button"),E.textContent="Send test email",L=C(),I=b("div"),A=b("div");for(let De=0;Def=!1)),u.$set(Ce),De[1]?Je&&(re(),D(Je,1,1,()=>{Je=null}),ae()):Je?(Je.p(De,Ye),Ye&2&&M(Je,1)):(Je=Em(De),Je.c(),M(Je,1),Je.m(a,d));const ct={};!h&&Ye&1&&(h=!0,ct.collection=De[0],$e(()=>h=!1)),m.$set(ct);const Ht={};!k&&Ye&1&&(k=!0,Ht.collection=De[0],$e(()=>k=!1)),_.$set(Ht),Ye&4&&(at=de(De[2]),re(),P=vt(P,Ye,jt,1,De,at,N,A,Bt,Dm,null,Mm),ae());const Le={};!Y&&Ye&1&&(Y=!0,Le.collection=De[0],$e(()=>Y=!1)),J.$set(Le);const ot={};G.$set(ot)},i(De){if(!pe){M(o.$$.fragment,De),M(u.$$.fragment,De),M(Je),M(m.$$.fragment,De),M(_.$$.fragment,De);for(let Ye=0;Yec==null?void 0:c.show(u.id);function S(O,E){n.$$.not_equal(E.config,O)&&(E.config=O,t(2,f),t(1,i),t(7,l),t(5,r),t(4,a),t(8,s),t(6,o),t(0,u))}function $(O){u=O,t(0,u)}function T(O){ie[O?"unshift":"push"](()=>{c=O,t(3,c)})}return n.$$set=O=>{"collection"in O&&t(0,u=O.collection)},n.$$.update=()=>{var O,E;n.$$.dirty&1&&typeof((O=u.otp)==null?void 0:O.emailTemplate)>"u"&&(t(0,u.otp=u.otp||{},u),t(0,u.otp.emailTemplate={},u)),n.$$.dirty&1&&typeof((E=u.authAlert)==null?void 0:E.emailTemplate)>"u"&&(t(0,u.authAlert=u.authAlert||{},u),t(0,u.authAlert.emailTemplate={},u)),n.$$.dirty&1&&t(1,i=u.system&&u.name==="_superusers"),n.$$.dirty&1&&t(7,l={key:"resetPasswordTemplate",label:"Default Password reset email template",placeholders:["APP_NAME","APP_URL","RECORD:*","TOKEN"],config:u.resetPasswordTemplate}),n.$$.dirty&1&&t(8,s={key:"verificationTemplate",label:"Default Verification email template",placeholders:["APP_NAME","APP_URL","RECORD:*","TOKEN"],config:u.verificationTemplate}),n.$$.dirty&1&&t(6,o={key:"confirmEmailChangeTemplate",label:"Default Confirm email change email template",placeholders:["APP_NAME","APP_URL","RECORD:*","TOKEN"],config:u.confirmEmailChangeTemplate}),n.$$.dirty&1&&t(5,r={key:"otp.emailTemplate",label:"Default OTP email template",placeholders:["APP_NAME","APP_URL","RECORD:*","OTP","OTP_ID"],config:u.otp.emailTemplate}),n.$$.dirty&1&&t(4,a={key:"authAlert.emailTemplate",label:"Default Login alert email template",placeholders:["APP_NAME","APP_URL","RECORD:*"],config:u.authAlert.emailTemplate}),n.$$.dirty&498&&t(2,f=i?[l,r,a]:[s,l,o,r,a])},[u,i,f,c,a,r,o,l,s,d,m,h,g,_,k,S,$,T]}class HO extends Se{constructor(e){super(),we(this,e,qO,FO,ke,{collection:0})}}const jO=n=>({dragging:n&4,dragover:n&8}),Im=n=>({dragging:n[2],dragover:n[3]});function zO(n){let e,t,i,l,s;const o=n[10].default,r=Lt(o,n,n[9],Im);return{c(){e=b("div"),r&&r.c(),p(e,"draggable",t=!n[1]),p(e,"class","draggable svelte-19c69j7"),ee(e,"dragging",n[2]),ee(e,"dragover",n[3])},m(a,u){v(a,e,u),r&&r.m(e,null),i=!0,l||(s=[W(e,"dragover",nt(n[11])),W(e,"dragleave",nt(n[12])),W(e,"dragend",n[13]),W(e,"dragstart",n[14]),W(e,"drop",n[15])],l=!0)},p(a,[u]){r&&r.p&&(!i||u&524)&&Pt(r,o,a,a[9],i?At(o,a[9],u,jO):Nt(a[9]),Im),(!i||u&2&&t!==(t=!a[1]))&&p(e,"draggable",t),(!i||u&4)&&ee(e,"dragging",a[2]),(!i||u&8)&&ee(e,"dragover",a[3])},i(a){i||(M(r,a),i=!0)},o(a){D(r,a),i=!1},d(a){a&&y(e),r&&r.d(a),l=!1,Ie(s)}}}function UO(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=kt();let{index:o}=e,{list:r=[]}=e,{group:a="default"}=e,{disabled:u=!1}=e,{dragHandleClass:f=""}=e,c=!1,d=!1;function m(T,O){if(!(!T||u)){if(f&&!T.target.classList.contains(f)){t(3,d=!1),t(2,c=!1),T.preventDefault();return}t(2,c=!0),T.dataTransfer.effectAllowed="move",T.dataTransfer.dropEffect="move",T.dataTransfer.setData("text/plain",JSON.stringify({index:O,group:a})),s("drag",T)}}function h(T,O){if(t(3,d=!1),t(2,c=!1),!T||u)return;T.dataTransfer.dropEffect="move";let E={};try{E=JSON.parse(T.dataTransfer.getData("text/plain"))}catch{}if(E.group!=a)return;const L=E.index<<0;L{t(3,d=!0)},_=()=>{t(3,d=!1)},k=()=>{t(3,d=!1),t(2,c=!1)},S=T=>m(T,o),$=T=>h(T,o);return n.$$set=T=>{"index"in T&&t(0,o=T.index),"list"in T&&t(6,r=T.list),"group"in T&&t(7,a=T.group),"disabled"in T&&t(1,u=T.disabled),"dragHandleClass"in T&&t(8,f=T.dragHandleClass),"$$scope"in T&&t(9,l=T.$$scope)},[o,u,c,d,m,h,r,a,f,l,i,g,_,k,S,$]}class _o extends Se{constructor(e){super(),we(this,e,UO,zO,ke,{index:0,list:6,group:7,disabled:1,dragHandleClass:8})}}function Lm(n,e,t){const i=n.slice();return i[27]=e[t],i}function VO(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("input"),l=C(),s=b("label"),o=B("Unique"),p(e,"type","checkbox"),p(e,"id",t=n[30]),e.checked=i=n[3].unique,p(s,"for",r=n[30])},m(f,c){v(f,e,c),v(f,l,c),v(f,s,c),w(s,o),a||(u=W(e,"change",n[19]),a=!0)},p(f,c){c[0]&1073741824&&t!==(t=f[30])&&p(e,"id",t),c[0]&8&&i!==(i=f[3].unique)&&(e.checked=i),c[0]&1073741824&&r!==(r=f[30])&&p(s,"for",r)},d(f){f&&(y(e),y(l),y(s)),a=!1,u()}}}function BO(n){let e,t,i,l;function s(a){n[20](a)}var o=n[7];function r(a,u){var c;let f={id:a[30],placeholder:`eg. CREATE INDEX idx_test on ${(c=a[0])==null?void 0:c.name} (created)`,language:"sql-create-index",minHeight:"85"};return a[2]!==void 0&&(f.value=a[2]),{props:f}}return o&&(e=zt(o,r(n)),ie.push(()=>be(e,"value",s))),{c(){e&&j(e.$$.fragment),i=ye()},m(a,u){e&&q(e,a,u),v(a,i,u),l=!0},p(a,u){var f;if(u[0]&128&&o!==(o=a[7])){if(e){re();const c=e;D(c.$$.fragment,1,0,()=>{H(c,1)}),ae()}o?(e=zt(o,r(a)),ie.push(()=>be(e,"value",s)),j(e.$$.fragment),M(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else if(o){const c={};u[0]&1073741824&&(c.id=a[30]),u[0]&1&&(c.placeholder=`eg. CREATE INDEX idx_test on ${(f=a[0])==null?void 0:f.name} (created)`),!t&&u[0]&4&&(t=!0,c.value=a[2],$e(()=>t=!1)),e.$set(c)}},i(a){l||(e&&M(e.$$.fragment,a),l=!0)},o(a){e&&D(e.$$.fragment,a),l=!1},d(a){a&&y(i),e&&H(e,a)}}}function WO(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function YO(n){let e,t,i,l;const s=[WO,BO],o=[];function r(a,u){return a[8]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),v(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),D(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&y(i),o[e].d(a)}}}function Am(n){let e,t,i,l=de(n[10]),s=[];for(let o=0;o({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}}),i=new fe({props:{class:"form-field required m-b-sm",name:`indexes.${n[6]||""}`,$$slots:{default:[YO,({uniqueId:a})=>({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}});let r=n[10].length>0&&Am(n);return{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment),l=C(),r&&r.c(),s=ye()},m(a,u){q(e,a,u),v(a,t,u),q(i,a,u),v(a,l,u),r&&r.m(a,u),v(a,s,u),o=!0},p(a,u){const f={};u[0]&1073741837|u[1]&1&&(f.$$scope={dirty:u,ctx:a}),e.$set(f);const c={};u[0]&64&&(c.name=`indexes.${a[6]||""}`),u[0]&1073742213|u[1]&1&&(c.$$scope={dirty:u,ctx:a}),i.$set(c),a[10].length>0?r?r.p(a,u):(r=Am(a),r.c(),r.m(s.parentNode,s)):r&&(r.d(1),r=null)},i(a){o||(M(e.$$.fragment,a),M(i.$$.fragment,a),o=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),o=!1},d(a){a&&(y(t),y(l),y(s)),H(e,a),H(i,a),r&&r.d(a)}}}function JO(n){let e,t=n[5]?"Update":"Create",i,l;return{c(){e=b("h4"),i=B(t),l=B(" index")},m(s,o){v(s,e,o),w(e,i),w(e,l)},p(s,o){o[0]&32&&t!==(t=s[5]?"Update":"Create")&&oe(i,t)},d(s){s&&y(e)}}}function Nm(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-hint btn-transparent m-r-auto")},m(l,s){v(l,e,s),t||(i=[Oe(qe.call(null,e,{text:"Delete",position:"top"})),W(e,"click",n[16])],t=!0)},p:te,d(l){l&&y(e),t=!1,Ie(i)}}}function ZO(n){let e,t,i,l,s,o,r=n[5]!=""&&Nm(n);return{c(){r&&r.c(),e=C(),t=b("button"),t.innerHTML='Cancel',i=C(),l=b("button"),l.innerHTML='Set index',p(t,"type","button"),p(t,"class","btn btn-transparent"),p(l,"type","button"),p(l,"class","btn"),ee(l,"btn-disabled",n[9].length<=0)},m(a,u){r&&r.m(a,u),v(a,e,u),v(a,t,u),v(a,i,u),v(a,l,u),s||(o=[W(t,"click",n[17]),W(l,"click",n[18])],s=!0)},p(a,u){a[5]!=""?r?r.p(a,u):(r=Nm(a),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null),u[0]&512&&ee(l,"btn-disabled",a[9].length<=0)},d(a){a&&(y(e),y(t),y(i),y(l)),r&&r.d(a),s=!1,Ie(o)}}}function GO(n){let e,t;const i=[{popup:!0},n[14]];let l={$$slots:{footer:[ZO],header:[JO],default:[KO]},$$scope:{ctx:n}};for(let s=0;sZ.name==U);Y?V.removeByValue(J.columns,Y):V.pushUnique(J.columns,{name:U}),t(2,d=V.buildIndex(J))}Xt(async()=>{t(8,g=!0);try{t(7,h=(await Tt(async()=>{const{default:U}=await import("./CodeEditor-B_VWhJeL.js");return{default:U}},__vite__mapDeps([12,1]),import.meta.url)).default)}catch(U){console.warn(U)}t(8,g=!1)});const E=()=>$(),L=()=>k(),I=()=>T(),A=U=>{t(3,l.unique=U.target.checked,l),t(3,l.tableName=l.tableName||(u==null?void 0:u.name),l),t(2,d=V.buildIndex(l))};function P(U){d=U,t(2,d)}const N=U=>O(U);function R(U){ie[U?"unshift":"push"](()=>{f=U,t(4,f)})}function z(U){Pe.call(this,n,U)}function F(U){Pe.call(this,n,U)}return n.$$set=U=>{e=je(je({},e),Wt(U)),t(14,r=lt(e,o)),"collection"in U&&t(0,u=U.collection)},n.$$.update=()=>{var U,J,Y;n.$$.dirty[0]&1&&t(10,i=((J=(U=u==null?void 0:u.fields)==null?void 0:U.filter(Z=>!Z.toDelete&&Z.name!="id"))==null?void 0:J.map(Z=>Z.name))||[]),n.$$.dirty[0]&4&&t(3,l=V.parseIndex(d)),n.$$.dirty[0]&8&&t(9,s=((Y=l.columns)==null?void 0:Y.map(Z=>Z.name))||[])},[u,k,d,l,f,c,m,h,g,s,i,$,T,O,r,_,E,L,I,A,P,N,R,z,F]}class QO extends Se{constructor(e){super(),we(this,e,XO,GO,ke,{collection:0,show:15,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[1]}}function Rm(n,e,t){const i=n.slice();i[10]=e[t],i[13]=t;const l=V.parseIndex(i[10]);return i[11]=l,i}function Fm(n){let e,t,i,l,s,o;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){var u;v(r,e,a),l=!0,s||(o=Oe(t=qe.call(null,e,(u=n[2])==null?void 0:u.indexes.message)),s=!0)},p(r,a){var u;t&&It(t.update)&&a&4&&t.update.call(null,(u=r[2])==null?void 0:u.indexes.message)},i(r){l||(r&&tt(()=>{l&&(i||(i=He(e,$t,{duration:150},!0)),i.run(1))}),l=!0)},o(r){r&&(i||(i=He(e,$t,{duration:150},!1)),i.run(0)),l=!1},d(r){r&&y(e),r&&i&&i.end(),s=!1,o()}}}function qm(n){let e;return{c(){e=b("strong"),e.textContent="Unique:"},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function Hm(n){var d;let e,t,i,l=((d=n[11].columns)==null?void 0:d.map(jm).join(", "))+"",s,o,r,a,u,f=n[11].unique&&qm();function c(){return n[4](n[10],n[13])}return{c(){var m,h;e=b("button"),f&&f.c(),t=C(),i=b("span"),s=B(l),p(i,"class","txt"),p(e,"type","button"),p(e,"class",o="label link-primary "+((h=(m=n[2].indexes)==null?void 0:m[n[13]])!=null&&h.message?"label-danger":"")+" svelte-167lbwu")},m(m,h){var g,_;v(m,e,h),f&&f.m(e,null),w(e,t),w(e,i),w(i,s),a||(u=[Oe(r=qe.call(null,e,((_=(g=n[2].indexes)==null?void 0:g[n[13]])==null?void 0:_.message)||"")),W(e,"click",c)],a=!0)},p(m,h){var g,_,k,S,$;n=m,n[11].unique?f||(f=qm(),f.c(),f.m(e,t)):f&&(f.d(1),f=null),h&1&&l!==(l=((g=n[11].columns)==null?void 0:g.map(jm).join(", "))+"")&&oe(s,l),h&4&&o!==(o="label link-primary "+((k=(_=n[2].indexes)==null?void 0:_[n[13]])!=null&&k.message?"label-danger":"")+" svelte-167lbwu")&&p(e,"class",o),r&&It(r.update)&&h&4&&r.update.call(null,(($=(S=n[2].indexes)==null?void 0:S[n[13]])==null?void 0:$.message)||"")},d(m){m&&y(e),f&&f.d(),a=!1,Ie(u)}}}function xO(n){var O,E,L,I,A;let e,t,i=(((E=(O=n[0])==null?void 0:O.indexes)==null?void 0:E.length)||0)+"",l,s,o,r,a,u,f,c,d,m,h,g,_=((I=(L=n[2])==null?void 0:L.indexes)==null?void 0:I.message)&&Fm(n),k=de(((A=n[0])==null?void 0:A.indexes)||[]),S=[];for(let P=0;Pbe(c,"collection",$)),c.$on("remove",n[8]),c.$on("submit",n[9]),{c(){e=b("div"),t=B("Unique constraints and indexes ("),l=B(i),s=B(`) `),_&&_.c(),o=C(),r=b("div");for(let P=0;P+ New index',f=C(),j(c.$$.fragment),p(e,"class","section-title"),p(u,"type","button"),p(u,"class","btn btn-xs btn-transparent btn-pill btn-outline"),p(r,"class","indexes-list svelte-167lbwu")},m(P,N){v(P,e,N),w(e,t),w(e,l),w(e,s),_&&_.m(e,null),v(P,o,N),v(P,r,N);for(let R=0;R{_=null}),ae()),N&7){k=de(((Y=P[0])==null?void 0:Y.indexes)||[]);let Z;for(Z=0;Zd=!1)),c.$set(R)},i(P){m||(M(_),M(c.$$.fragment,P),m=!0)},o(P){D(_),D(c.$$.fragment,P),m=!1},d(P){P&&(y(e),y(o),y(r),y(f)),_&&_.d(),dt(S,P),n[6](null),H(c,P),h=!1,g()}}}const jm=n=>n.name;function eM(n,e,t){let i;Qe(n,yn,m=>t(2,i=m));let{collection:l}=e,s;function o(m,h){for(let g=0;gs==null?void 0:s.show(m,h),a=()=>s==null?void 0:s.show();function u(m){ie[m?"unshift":"push"](()=>{s=m,t(1,s)})}function f(m){l=m,t(0,l)}const c=m=>{for(let h=0;h{var h;(h=i.indexes)!=null&&h.message&&Yn("indexes"),o(m.detail.old,m.detail.new)};return n.$$set=m=>{"collection"in m&&t(0,l=m.collection)},[l,s,i,o,r,a,u,f,c,d]}class tM extends Se{constructor(e){super(),we(this,e,eM,xO,ke,{collection:0})}}function zm(n,e,t){const i=n.slice();return i[5]=e[t],i}function Um(n){let e,t,i,l,s,o,r;function a(){return n[3](n[5])}return{c(){e=b("button"),t=b("i"),i=C(),l=b("span"),l.textContent=`${n[5].label}`,s=C(),p(t,"class","icon "+n[5].icon+" svelte-1gz9b6p"),p(t,"aria-hidden","true"),p(l,"class","txt"),p(e,"type","button"),p(e,"role","menuitem"),p(e,"class","dropdown-item svelte-1gz9b6p")},m(u,f){v(u,e,f),w(e,t),w(e,i),w(e,l),w(e,s),o||(r=W(e,"click",a),o=!0)},p(u,f){n=u},d(u){u&&y(e),o=!1,r()}}}function nM(n){let e,t=de(n[1]),i=[];for(let l=0;lo(a.value);return n.$$set=a=>{"class"in a&&t(0,i=a.class)},[i,s,o,r]}class sM extends Se{constructor(e){super(),we(this,e,lM,iM,ke,{class:0})}}const oM=n=>({interactive:n[0]&128,hasErrors:n[0]&64}),Vm=n=>({interactive:n[7],hasErrors:n[6]}),rM=n=>({interactive:n[0]&128,hasErrors:n[0]&64}),Bm=n=>({interactive:n[7],hasErrors:n[6]}),aM=n=>({interactive:n[0]&128,hasErrors:n[0]&64}),Wm=n=>({interactive:n[7],hasErrors:n[6]});function Ym(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","drag-handle-wrapper"),p(e,"draggable",!0),p(e,"aria-label","Sort")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function Km(n){let e,t;return{c(){e=b("span"),t=B(n[5]),p(e,"class","label label-success")},m(i,l){v(i,e,l),w(e,t)},p(i,l){l[0]&32&&oe(t,i[5])},d(i){i&&y(e)}}}function Jm(n){let e;return{c(){e=b("span"),e.textContent="Hidden",p(e,"class","label label-danger")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function uM(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h=n[0].required&&Km(n),g=n[0].hidden&&Jm();return{c(){e=b("div"),h&&h.c(),t=C(),g&&g.c(),i=C(),l=b("div"),s=b("i"),a=C(),u=b("input"),p(e,"class","field-labels"),p(s,"class",o=V.getFieldTypeIcon(n[0].type)),p(l,"class","form-field-addon prefix field-type-icon"),ee(l,"txt-disabled",!n[7]||n[0].system),p(u,"type","text"),u.required=!0,u.disabled=f=!n[7]||n[0].system,p(u,"spellcheck","false"),p(u,"placeholder","Field name"),u.value=c=n[0].name,p(u,"title","System field")},m(_,k){v(_,e,k),h&&h.m(e,null),w(e,t),g&&g.m(e,null),v(_,i,k),v(_,l,k),w(l,s),v(_,a,k),v(_,u,k),n[22](u),d||(m=[Oe(r=qe.call(null,l,n[0].type+(n[0].system?" (system)":""))),W(l,"click",n[21]),W(u,"input",n[23])],d=!0)},p(_,k){_[0].required?h?h.p(_,k):(h=Km(_),h.c(),h.m(e,t)):h&&(h.d(1),h=null),_[0].hidden?g||(g=Jm(),g.c(),g.m(e,null)):g&&(g.d(1),g=null),k[0]&1&&o!==(o=V.getFieldTypeIcon(_[0].type))&&p(s,"class",o),r&&It(r.update)&&k[0]&1&&r.update.call(null,_[0].type+(_[0].system?" (system)":"")),k[0]&129&&ee(l,"txt-disabled",!_[7]||_[0].system),k[0]&129&&f!==(f=!_[7]||_[0].system)&&(u.disabled=f),k[0]&1&&c!==(c=_[0].name)&&u.value!==c&&(u.value=c)},d(_){_&&(y(e),y(i),y(l),y(a),y(u)),h&&h.d(),g&&g.d(),n[22](null),d=!1,Ie(m)}}}function fM(n){let e;return{c(){e=b("span"),p(e,"class","separator")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function cM(n){let e,t,i,l,s,o;return{c(){e=b("button"),t=b("i"),p(t,"class","ri-settings-3-line"),p(e,"type","button"),p(e,"aria-label",i="Toggle "+n[0].name+" field options"),p(e,"class",l="btn btn-sm btn-circle options-trigger "+(n[4]?"btn-secondary":"btn-transparent")),p(e,"aria-expanded",n[4]),ee(e,"btn-hint",!n[4]&&!n[6]),ee(e,"btn-danger",n[6])},m(r,a){v(r,e,a),w(e,t),s||(o=W(e,"click",n[17]),s=!0)},p(r,a){a[0]&1&&i!==(i="Toggle "+r[0].name+" field options")&&p(e,"aria-label",i),a[0]&16&&l!==(l="btn btn-sm btn-circle options-trigger "+(r[4]?"btn-secondary":"btn-transparent"))&&p(e,"class",l),a[0]&16&&p(e,"aria-expanded",r[4]),a[0]&80&&ee(e,"btn-hint",!r[4]&&!r[6]),a[0]&80&&ee(e,"btn-danger",r[6])},d(r){r&&y(e),s=!1,o()}}}function dM(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-success btn-transparent options-trigger"),p(e,"aria-label","Restore")},m(l,s){v(l,e,s),t||(i=[Oe(qe.call(null,e,"Restore")),W(e,"click",n[14])],t=!0)},p:te,d(l){l&&y(e),t=!1,Ie(i)}}}function Zm(n){let e,t,i,l,s=!n[0].primaryKey&&n[0].type!="autodate"&&(!n[8]||!n[10].includes(n[0].name)),o,r=!n[0].primaryKey&&(!n[8]||!n[11].includes(n[0].name)),a,u=!n[8]||!n[12].includes(n[0].name),f,c,d,m;const h=n[20].options,g=Lt(h,n,n[28],Bm);let _=s&&Gm(n),k=r&&Xm(n),S=u&&Qm(n);const $=n[20].optionsFooter,T=Lt($,n,n[28],Vm);let O=!n[0]._toDelete&&!n[0].primaryKey&&xm(n);return{c(){e=b("div"),t=b("div"),g&&g.c(),i=C(),l=b("div"),_&&_.c(),o=C(),k&&k.c(),a=C(),S&&S.c(),f=C(),T&&T.c(),c=C(),O&&O.c(),p(t,"class","hidden-empty m-b-sm"),p(l,"class","schema-field-options-footer"),p(e,"class","schema-field-options")},m(E,L){v(E,e,L),w(e,t),g&&g.m(t,null),w(e,i),w(e,l),_&&_.m(l,null),w(l,o),k&&k.m(l,null),w(l,a),S&&S.m(l,null),w(l,f),T&&T.m(l,null),w(l,c),O&&O.m(l,null),m=!0},p(E,L){g&&g.p&&(!m||L[0]&268435648)&&Pt(g,h,E,E[28],m?At(h,E[28],L,rM):Nt(E[28]),Bm),L[0]&257&&(s=!E[0].primaryKey&&E[0].type!="autodate"&&(!E[8]||!E[10].includes(E[0].name))),s?_?(_.p(E,L),L[0]&257&&M(_,1)):(_=Gm(E),_.c(),M(_,1),_.m(l,o)):_&&(re(),D(_,1,1,()=>{_=null}),ae()),L[0]&257&&(r=!E[0].primaryKey&&(!E[8]||!E[11].includes(E[0].name))),r?k?(k.p(E,L),L[0]&257&&M(k,1)):(k=Xm(E),k.c(),M(k,1),k.m(l,a)):k&&(re(),D(k,1,1,()=>{k=null}),ae()),L[0]&257&&(u=!E[8]||!E[12].includes(E[0].name)),u?S?(S.p(E,L),L[0]&257&&M(S,1)):(S=Qm(E),S.c(),M(S,1),S.m(l,f)):S&&(re(),D(S,1,1,()=>{S=null}),ae()),T&&T.p&&(!m||L[0]&268435648)&&Pt(T,$,E,E[28],m?At($,E[28],L,oM):Nt(E[28]),Vm),!E[0]._toDelete&&!E[0].primaryKey?O?(O.p(E,L),L[0]&1&&M(O,1)):(O=xm(E),O.c(),M(O,1),O.m(l,null)):O&&(re(),D(O,1,1,()=>{O=null}),ae())},i(E){m||(M(g,E),M(_),M(k),M(S),M(T,E),M(O),E&&tt(()=>{m&&(d||(d=He(e,mt,{delay:10,duration:150},!0)),d.run(1))}),m=!0)},o(E){D(g,E),D(_),D(k),D(S),D(T,E),D(O),E&&(d||(d=He(e,mt,{delay:10,duration:150},!1)),d.run(0)),m=!1},d(E){E&&y(e),g&&g.d(E),_&&_.d(),k&&k.d(),S&&S.d(),T&&T.d(E),O&&O.d(),E&&d&&d.end()}}}function Gm(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle",name:"requried",$$slots:{default:[pM,({uniqueId:i})=>({34:i}),({uniqueId:i})=>[0,i?8:0]]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l[0]&268435489|l[1]&8&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function pM(n){let e,t,i,l,s,o,r,a,u,f,c,d;return{c(){e=b("input"),i=C(),l=b("label"),s=b("span"),o=B(n[5]),r=C(),a=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[34]),p(s,"class","txt"),p(a,"class","ri-information-line link-hint"),p(l,"for",f=n[34])},m(m,h){v(m,e,h),e.checked=n[0].required,v(m,i,h),v(m,l,h),w(l,s),w(s,o),w(l,r),w(l,a),c||(d=[W(e,"change",n[24]),Oe(u=qe.call(null,a,{text:`Requires the field value NOT to be ${V.zeroDefaultStr(n[0])}.`}))],c=!0)},p(m,h){h[1]&8&&t!==(t=m[34])&&p(e,"id",t),h[0]&1&&(e.checked=m[0].required),h[0]&32&&oe(o,m[5]),u&&It(u.update)&&h[0]&1&&u.update.call(null,{text:`Requires the field value NOT to be ${V.zeroDefaultStr(m[0])}.`}),h[1]&8&&f!==(f=m[34])&&p(l,"for",f)},d(m){m&&(y(e),y(i),y(l)),c=!1,Ie(d)}}}function Xm(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle",name:"hidden",$$slots:{default:[mM,({uniqueId:i})=>({34:i}),({uniqueId:i})=>[0,i?8:0]]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l[0]&268435457|l[1]&8&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function mM(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=C(),l=b("label"),s=b("span"),s.textContent="Hidden",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[34]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[34])},m(c,d){v(c,e,d),e.checked=n[0].hidden,v(c,i,d),v(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=[W(e,"change",n[25]),W(e,"change",n[26]),Oe(qe.call(null,r,{text:"Hide from the JSON API response and filters."}))],u=!0)},p(c,d){d[1]&8&&t!==(t=c[34])&&p(e,"id",t),d[0]&1&&(e.checked=c[0].hidden),d[1]&8&&a!==(a=c[34])&&p(l,"for",a)},d(c){c&&(y(e),y(i),y(l)),u=!1,Ie(f)}}}function Qm(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle m-0",name:"presentable",$$slots:{default:[hM,({uniqueId:i})=>({34:i}),({uniqueId:i})=>[0,i?8:0]]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l[0]&268435457|l[1]&8&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function hM(n){let e,t,i,l,s,o,r,a,u,f,c,d;return{c(){e=b("input"),l=C(),s=b("label"),o=b("span"),o.textContent="Presentable",r=C(),a=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[34]),e.disabled=i=n[0].hidden,p(o,"class","txt"),p(a,"class",u="ri-information-line "+(n[0].hidden?"txt-disabled":"link-hint")),p(s,"for",f=n[34])},m(m,h){v(m,e,h),e.checked=n[0].presentable,v(m,l,h),v(m,s,h),w(s,o),w(s,r),w(s,a),c||(d=[W(e,"change",n[27]),Oe(qe.call(null,a,{text:"Whether the field should be preferred in the Superuser UI relation listings (default to auto)."}))],c=!0)},p(m,h){h[1]&8&&t!==(t=m[34])&&p(e,"id",t),h[0]&1&&i!==(i=m[0].hidden)&&(e.disabled=i),h[0]&1&&(e.checked=m[0].presentable),h[0]&1&&u!==(u="ri-information-line "+(m[0].hidden?"txt-disabled":"link-hint"))&&p(a,"class",u),h[1]&8&&f!==(f=m[34])&&p(s,"for",f)},d(m){m&&(y(e),y(l),y(s)),c=!1,Ie(d)}}}function xm(n){let e,t,i,l,s,o,r;return o=new jn({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[_M]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),l=b("i"),s=C(),j(o.$$.fragment),p(l,"class","ri-more-line"),p(l,"aria-hidden","true"),p(i,"tabindex","0"),p(i,"role","button"),p(i,"title","More field options"),p(i,"class","btn btn-circle btn-sm btn-transparent"),p(t,"class","inline-flex flex-gap-sm flex-nowrap"),p(e,"class","m-l-auto txt-right")},m(a,u){v(a,e,u),w(e,t),w(t,i),w(i,l),w(i,s),q(o,i,null),r=!0},p(a,u){const f={};u[0]&268435457&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(M(o.$$.fragment,a),r=!0)},o(a){D(o.$$.fragment,a),r=!1},d(a){a&&y(e),H(o)}}}function eh(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Remove',p(e,"type","button"),p(e,"class","dropdown-item"),p(e,"role","menuitem")},m(l,s){v(l,e,s),t||(i=W(e,"click",nt(n[13])),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function _M(n){let e,t,i,l,s,o=!n[0].system&&eh(n);return{c(){e=b("button"),e.innerHTML='Duplicate',t=C(),o&&o.c(),i=ye(),p(e,"type","button"),p(e,"class","dropdown-item"),p(e,"role","menuitem")},m(r,a){v(r,e,a),v(r,t,a),o&&o.m(r,a),v(r,i,a),l||(s=W(e,"click",nt(n[15])),l=!0)},p(r,a){r[0].system?o&&(o.d(1),o=null):o?o.p(r,a):(o=eh(r),o.c(),o.m(i.parentNode,i))},d(r){r&&(y(e),y(t),y(i)),o&&o.d(r),l=!1,s()}}}function gM(n){let e,t,i,l,s,o,r,a,u,f=n[7]&&n[2]&&Ym();l=new fe({props:{class:"form-field required m-0 "+(n[7]?"":"disabled"),name:"fields."+n[1]+".name",inlineError:!0,$$slots:{default:[uM]},$$scope:{ctx:n}}});const c=n[20].default,d=Lt(c,n,n[28],Wm),m=d||fM();function h(S,$){if(S[0]._toDelete)return dM;if(S[7])return cM}let g=h(n),_=g&&g(n),k=n[7]&&n[4]&&Zm(n);return{c(){e=b("div"),t=b("div"),f&&f.c(),i=C(),j(l.$$.fragment),s=C(),m&&m.c(),o=C(),_&&_.c(),r=C(),k&&k.c(),p(t,"class","schema-field-header"),p(e,"class","schema-field"),ee(e,"required",n[0].required),ee(e,"expanded",n[7]&&n[4]),ee(e,"deleted",n[0]._toDelete)},m(S,$){v(S,e,$),w(e,t),f&&f.m(t,null),w(t,i),q(l,t,null),w(t,s),m&&m.m(t,null),w(t,o),_&&_.m(t,null),w(e,r),k&&k.m(e,null),u=!0},p(S,$){S[7]&&S[2]?f||(f=Ym(),f.c(),f.m(t,i)):f&&(f.d(1),f=null);const T={};$[0]&128&&(T.class="form-field required m-0 "+(S[7]?"":"disabled")),$[0]&2&&(T.name="fields."+S[1]+".name"),$[0]&268435625&&(T.$$scope={dirty:$,ctx:S}),l.$set(T),d&&d.p&&(!u||$[0]&268435648)&&Pt(d,c,S,S[28],u?At(c,S[28],$,aM):Nt(S[28]),Wm),g===(g=h(S))&&_?_.p(S,$):(_&&_.d(1),_=g&&g(S),_&&(_.c(),_.m(t,null))),S[7]&&S[4]?k?(k.p(S,$),$[0]&144&&M(k,1)):(k=Zm(S),k.c(),M(k,1),k.m(e,null)):k&&(re(),D(k,1,1,()=>{k=null}),ae()),(!u||$[0]&1)&&ee(e,"required",S[0].required),(!u||$[0]&144)&&ee(e,"expanded",S[7]&&S[4]),(!u||$[0]&1)&&ee(e,"deleted",S[0]._toDelete)},i(S){u||(M(l.$$.fragment,S),M(m,S),M(k),S&&tt(()=>{u&&(a||(a=He(e,mt,{duration:150},!0)),a.run(1))}),u=!0)},o(S){D(l.$$.fragment,S),D(m,S),D(k),S&&(a||(a=He(e,mt,{duration:150},!1)),a.run(0)),u=!1},d(S){S&&y(e),f&&f.d(),H(l),m&&m.d(S),_&&_.d(),k&&k.d(),S&&a&&a.end()}}}let Ta=[];function bM(n,e,t){let i,l,s,o,r;Qe(n,yn,ce=>t(19,r=ce));let{$$slots:a={},$$scope:u}=e;const f="f_"+V.randomString(8),c=kt(),d={bool:"Nonfalsey",number:"Nonzero"},m=["password","tokenKey","id","autodate"],h=["password","tokenKey","id","email"],g=["password","tokenKey"];let{key:_=""}=e,{field:k=V.initSchemaField()}=e,{draggable:S=!0}=e,{collection:$={}}=e,T,O=!1;function E(){k.id?t(0,k._toDelete=!0,k):(N(),c("remove"))}function L(){t(0,k._toDelete=!1,k),Ut({})}function I(){k._toDelete||(N(),c("duplicate"))}function A(ce){return V.slugify(ce)}function P(){t(4,O=!0),z()}function N(){t(4,O=!1)}function R(){O?N():P()}function z(){for(let ce of Ta)ce.id!=f&&ce.collapse()}Xt(()=>(Ta.push({id:f,collapse:N}),k.onMountSelect&&(t(0,k.onMountSelect=!1,k),T==null||T.select()),()=>{V.removeByKey(Ta,"id",f)}));const F=()=>T==null?void 0:T.focus();function U(ce){ie[ce?"unshift":"push"](()=>{T=ce,t(3,T)})}const J=ce=>{const ue=k.name;t(0,k.name=A(ce.target.value),k),ce.target.value=k.name,c("rename",{oldName:ue,newName:k.name})};function Y(){k.required=this.checked,t(0,k)}function Z(){k.hidden=this.checked,t(0,k)}const G=ce=>{ce.target.checked&&t(0,k.presentable=!1,k)};function pe(){k.presentable=this.checked,t(0,k)}return n.$$set=ce=>{"key"in ce&&t(1,_=ce.key),"field"in ce&&t(0,k=ce.field),"draggable"in ce&&t(2,S=ce.draggable),"collection"in ce&&t(18,$=ce.collection),"$$scope"in ce&&t(28,u=ce.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&262144&&t(8,i=($==null?void 0:$.type)=="auth"),n.$$.dirty[0]&1&&k._toDelete&&k._originalName&&k.name!==k._originalName&&t(0,k.name=k._originalName,k),n.$$.dirty[0]&1&&!k._originalName&&k.name&&t(0,k._originalName=k.name,k),n.$$.dirty[0]&1&&typeof k._toDelete>"u"&&t(0,k._toDelete=!1,k),n.$$.dirty[0]&1&&k.required&&t(0,k.nullable=!1,k),n.$$.dirty[0]&1&&t(7,l=!k._toDelete),n.$$.dirty[0]&524290&&t(6,s=!V.isEmpty(V.getNestedVal(r,`fields.${_}`))),n.$$.dirty[0]&1&&t(5,o=d[k==null?void 0:k.type]||"Nonempty")},[k,_,S,T,O,o,s,l,i,c,m,h,g,E,L,I,A,R,$,r,a,F,U,J,Y,Z,G,pe,u]}class ni extends Se{constructor(e){super(),we(this,e,bM,gM,ke,{key:1,field:0,draggable:2,collection:18},null,[-1,-1])}}function kM(n){let e,t,i,l,s,o;function r(u){n[5](u)}let a={id:n[13],items:n[3],disabled:n[0].system,readonly:!n[12]};return n[2]!==void 0&&(a.keyOfSelected=n[2]),t=new zn({props:a}),ie.push(()=>be(t,"keyOfSelected",r)),{c(){e=b("div"),j(t.$$.fragment)},m(u,f){v(u,e,f),q(t,e,null),l=!0,s||(o=Oe(qe.call(null,e,{text:"Auto set on:",position:"top"})),s=!0)},p(u,f){const c={};f&8192&&(c.id=u[13]),f&1&&(c.disabled=u[0].system),f&4096&&(c.readonly=!u[12]),!i&&f&4&&(i=!0,c.keyOfSelected=u[2],$e(()=>i=!1)),t.$set(c)},i(u){l||(M(t.$$.fragment,u),l=!0)},o(u){D(t.$$.fragment,u),l=!1},d(u){u&&y(e),H(t),s=!1,o()}}}function yM(n){let e,t,i,l,s,o;return i=new fe({props:{class:"form-field form-field-single-multiple-select form-field-autodate-select "+(n[12]?"":"readonly"),inlineError:!0,$$slots:{default:[kM,({uniqueId:r})=>({13:r}),({uniqueId:r})=>r?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=C(),j(i.$$.fragment),l=C(),s=b("div"),p(e,"class","separator"),p(s,"class","separator")},m(r,a){v(r,e,a),v(r,t,a),q(i,r,a),v(r,l,a),v(r,s,a),o=!0},p(r,a){const u={};a&4096&&(u.class="form-field form-field-single-multiple-select form-field-autodate-select "+(r[12]?"":"readonly")),a&28677&&(u.$$scope={dirty:a,ctx:r}),i.$set(u)},i(r){o||(M(i.$$.fragment,r),o=!0)},o(r){D(i.$$.fragment,r),o=!1},d(r){r&&(y(e),y(t),y(l),y(s)),H(i,r)}}}function vM(n){let e,t,i;const l=[{key:n[1]},n[4]];function s(r){n[6](r)}let o={$$slots:{default:[yM,({interactive:r})=>({12:r}),({interactive:r})=>r?4096:0]},$$scope:{ctx:n}};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&18?wt(l,[a&2&&{key:r[1]},a&16&&Rt(r[4])]):{};a&20485&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}const $a=1,Ca=2,Oa=3;function wM(n,e,t){const i=["field","key"];let l=lt(e,i);const s=[{label:"Create",value:$a},{label:"Update",value:Ca},{label:"Create/Update",value:Oa}];let{field:o}=e,{key:r=""}=e,a=u();function u(){return o.onCreate&&o.onUpdate?Oa:o.onUpdate?Ca:$a}function f(_){switch(_){case $a:t(0,o.onCreate=!0,o),t(0,o.onUpdate=!1,o);break;case Ca:t(0,o.onCreate=!1,o),t(0,o.onUpdate=!0,o);break;case Oa:t(0,o.onCreate=!0,o),t(0,o.onUpdate=!0,o);break}}function c(_){a=_,t(2,a)}function d(_){o=_,t(0,o)}function m(_){Pe.call(this,n,_)}function h(_){Pe.call(this,n,_)}function g(_){Pe.call(this,n,_)}return n.$$set=_=>{e=je(je({},e),Wt(_)),t(4,l=lt(e,i)),"field"in _&&t(0,o=_.field),"key"in _&&t(1,r=_.key)},n.$$.update=()=>{n.$$.dirty&4&&f(a)},[o,r,a,s,l,c,d,m,h,g]}class SM extends Se{constructor(e){super(),we(this,e,wM,vM,ke,{field:0,key:1})}}function TM(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[3](r)}let o={};for(let r=0;rbe(e,"field",s)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("duplicate",n[6]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?wt(l,[a&2&&{key:r[1]},a&4&&Rt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function $M(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e;function r(c){s=c,t(0,s)}function a(c){Pe.call(this,n,c)}function u(c){Pe.call(this,n,c)}function f(c){Pe.call(this,n,c)}return n.$$set=c=>{e=je(je({},e),Wt(c)),t(2,l=lt(e,i)),"field"in c&&t(0,s=c.field),"key"in c&&t(1,o=c.key)},[s,o,l,r,a,u,f]}class CM extends Se{constructor(e){super(),we(this,e,$M,TM,ke,{field:0,key:1})}}var Ma=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],es={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(n){return typeof console<"u"&&console.warn(n)},getWeek:function(n){var e=new Date(n.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var t=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},to={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(n){var e=n%100;if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},Ln=function(n,e){return e===void 0&&(e=2),("000"+n).slice(e*-1)},Gn=function(n){return n===!0?1:0};function th(n,e){var t;return function(){var i=this,l=arguments;clearTimeout(t),t=setTimeout(function(){return n.apply(i,l)},e)}}var Ea=function(n){return n instanceof Array?n:[n]};function $n(n,e,t){if(t===!0)return n.classList.add(e);n.classList.remove(e)}function Ot(n,e,t){var i=window.document.createElement(n);return e=e||"",t=t||"",i.className=e,t!==void 0&&(i.textContent=t),i}function Jo(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function by(n,e){if(e(n))return n;if(n.parentNode)return by(n.parentNode,e)}function Zo(n,e){var t=Ot("div","numInputWrapper"),i=Ot("input","numInput "+n),l=Ot("span","arrowUp"),s=Ot("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?i.type="number":(i.type="text",i.pattern="\\d*"),e!==void 0)for(var o in e)i.setAttribute(o,e[o]);return t.appendChild(i),t.appendChild(l),t.appendChild(s),t}function Un(n){try{if(typeof n.composedPath=="function"){var e=n.composedPath();return e[0]}return n.target}catch{return n.target}}var Da=function(){},$r=function(n,e,t){return t.months[e?"shorthand":"longhand"][n]},OM={D:Da,F:function(n,e,t){n.setMonth(t.months.longhand.indexOf(e))},G:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},H:function(n,e){n.setHours(parseFloat(e))},J:function(n,e){n.setDate(parseFloat(e))},K:function(n,e,t){n.setHours(n.getHours()%12+12*Gn(new RegExp(t.amPM[1],"i").test(e)))},M:function(n,e,t){n.setMonth(t.months.shorthand.indexOf(e))},S:function(n,e){n.setSeconds(parseFloat(e))},U:function(n,e){return new Date(parseFloat(e)*1e3)},W:function(n,e,t){var i=parseInt(e),l=new Date(n.getFullYear(),0,2+(i-1)*7,0,0,0,0);return l.setDate(l.getDate()-l.getDay()+t.firstDayOfWeek),l},Y:function(n,e){n.setFullYear(parseFloat(e))},Z:function(n,e){return new Date(e)},d:function(n,e){n.setDate(parseFloat(e))},h:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},i:function(n,e){n.setMinutes(parseFloat(e))},j:function(n,e){n.setDate(parseFloat(e))},l:Da,m:function(n,e){n.setMonth(parseFloat(e)-1)},n:function(n,e){n.setMonth(parseFloat(e)-1)},s:function(n,e){n.setSeconds(parseFloat(e))},u:function(n,e){return new Date(parseFloat(e))},w:Da,y:function(n,e){n.setFullYear(2e3+parseFloat(e))}},wl={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},js={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[js.w(n,e,t)]},F:function(n,e,t){return $r(js.n(n,e,t)-1,!1,e)},G:function(n,e,t){return Ln(js.h(n,e,t))},H:function(n){return Ln(n.getHours())},J:function(n,e){return e.ordinal!==void 0?n.getDate()+e.ordinal(n.getDate()):n.getDate()},K:function(n,e){return e.amPM[Gn(n.getHours()>11)]},M:function(n,e){return $r(n.getMonth(),!0,e)},S:function(n){return Ln(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return Ln(n.getFullYear(),4)},d:function(n){return Ln(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return Ln(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return Ln(n.getMonth()+1)},n:function(n){return n.getMonth()+1},s:function(n){return n.getSeconds()},u:function(n){return n.getTime()},w:function(n){return n.getDay()},y:function(n){return String(n.getFullYear()).substring(2)}},ky=function(n){var e=n.config,t=e===void 0?es:e,i=n.l10n,l=i===void 0?to:i,s=n.isMobile,o=s===void 0?!1:s;return function(r,a,u){var f=u||l;return t.formatDate!==void 0&&!o?t.formatDate(r,a,f):a.split("").map(function(c,d,m){return js[c]&&m[d-1]!=="\\"?js[c](r,f,t):c!=="\\"?c:""}).join("")}},fu=function(n){var e=n.config,t=e===void 0?es:e,i=n.l10n,l=i===void 0?to:i;return function(s,o,r,a){if(!(s!==0&&!s)){var u=a||l,f,c=s;if(s instanceof Date)f=new Date(s.getTime());else if(typeof s!="string"&&s.toFixed!==void 0)f=new Date(s);else if(typeof s=="string"){var d=o||(t||es).dateFormat,m=String(s).trim();if(m==="today")f=new Date,r=!0;else if(t&&t.parseDate)f=t.parseDate(s,d);else if(/Z$/.test(m)||/GMT$/.test(m))f=new Date(s);else{for(var h=void 0,g=[],_=0,k=0,S="";_Math.min(e,t)&&n=0?new Date:new Date(t.config.minDate.getTime()),le=La(t.config);x.setHours(le.hours,le.minutes,le.seconds,x.getMilliseconds()),t.selectedDates=[x],t.latestSelectedDateObj=x}X!==void 0&&X.type!=="blur"&&cl(X);var ge=t._input.value;c(),Dn(),t._input.value!==ge&&t._debouncedChange()}function u(X,x){return X%12+12*Gn(x===t.l10n.amPM[1])}function f(X){switch(X%24){case 0:case 12:return 12;default:return X%12}}function c(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var X=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,x=(parseInt(t.minuteElement.value,10)||0)%60,le=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(X=u(X,t.amPM.textContent));var ge=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&Vn(t.latestSelectedDateObj,t.config.minDate,!0)===0,Fe=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&Vn(t.latestSelectedDateObj,t.config.maxDate,!0)===0;if(t.config.maxTime!==void 0&&t.config.minTime!==void 0&&t.config.minTime>t.config.maxTime){var Be=Ia(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),rt=Ia(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),se=Ia(X,x,le);if(se>rt&&se=12)]),t.secondElement!==void 0&&(t.secondElement.value=Ln(le)))}function h(X){var x=Un(X),le=parseInt(x.value)+(X.delta||0);(le/1e3>1||X.key==="Enter"&&!/[^\d]/.test(le.toString()))&&et(le)}function g(X,x,le,ge){if(x instanceof Array)return x.forEach(function(Fe){return g(X,Fe,le,ge)});if(X instanceof Array)return X.forEach(function(Fe){return g(Fe,x,le,ge)});X.addEventListener(x,le,ge),t._handlers.push({remove:function(){return X.removeEventListener(x,le,ge)}})}function _(){Dt("onChange")}function k(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(le){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+le+"]"),function(ge){return g(ge,"click",t[le])})}),t.isMobile){wn();return}var X=th(Ee,50);if(t._debouncedChange=th(_,IM),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&g(t.daysContainer,"mouseover",function(le){t.config.mode==="range"&&Ve(Un(le))}),g(t._input,"keydown",jt),t.calendarContainer!==void 0&&g(t.calendarContainer,"keydown",jt),!t.config.inline&&!t.config.static&&g(window,"resize",X),window.ontouchstart!==void 0?g(window.document,"touchstart",ft):g(window.document,"mousedown",ft),g(window.document,"focus",ft,{capture:!0}),t.config.clickOpens===!0&&(g(t._input,"focus",t.open),g(t._input,"click",t.open)),t.daysContainer!==void 0&&(g(t.monthNav,"click",Rl),g(t.monthNav,["keyup","increment"],h),g(t.daysContainer,"click",En)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var x=function(le){return Un(le).select()};g(t.timeContainer,["increment"],a),g(t.timeContainer,"blur",a,{capture:!0}),g(t.timeContainer,"click",$),g([t.hourElement,t.minuteElement],["focus","click"],x),t.secondElement!==void 0&&g(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&g(t.amPM,"click",function(le){a(le)})}t.config.allowInput&&g(t._input,"blur",at)}function S(X,x){var le=X!==void 0?t.parseDate(X):t.latestSelectedDateObj||(t.config.minDate&&t.config.minDate>t.now?t.config.minDate:t.config.maxDate&&t.config.maxDate1),t.calendarContainer.appendChild(X);var Fe=t.config.appendTo!==void 0&&t.config.appendTo.nodeType!==void 0;if((t.config.inline||t.config.static)&&(t.calendarContainer.classList.add(t.config.inline?"inline":"static"),t.config.inline&&(!Fe&&t.element.parentNode?t.element.parentNode.insertBefore(t.calendarContainer,t._input.nextSibling):t.config.appendTo!==void 0&&t.config.appendTo.appendChild(t.calendarContainer)),t.config.static)){var Be=Ot("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(Be,t.element),Be.appendChild(t.element),t.altInput&&Be.appendChild(t.altInput),Be.appendChild(t.calendarContainer)}!t.config.static&&!t.config.inline&&(t.config.appendTo!==void 0?t.config.appendTo:window.document.body).appendChild(t.calendarContainer)}function E(X,x,le,ge){var Fe=xe(x,!0),Be=Ot("span",X,x.getDate().toString());return Be.dateObj=x,Be.$i=ge,Be.setAttribute("aria-label",t.formatDate(x,t.config.ariaDateFormat)),X.indexOf("hidden")===-1&&Vn(x,t.now)===0&&(t.todayDateElem=Be,Be.classList.add("today"),Be.setAttribute("aria-current","date")),Fe?(Be.tabIndex=-1,ul(x)&&(Be.classList.add("selected"),t.selectedDateElem=Be,t.config.mode==="range"&&($n(Be,"startRange",t.selectedDates[0]&&Vn(x,t.selectedDates[0],!0)===0),$n(Be,"endRange",t.selectedDates[1]&&Vn(x,t.selectedDates[1],!0)===0),X==="nextMonthDay"&&Be.classList.add("inRange")))):Be.classList.add("flatpickr-disabled"),t.config.mode==="range"&&zi(x)&&!ul(x)&&Be.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&X!=="prevMonthDay"&&ge%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend",""+t.config.getWeek(x)+""),Dt("onDayCreate",Be),Be}function L(X){X.focus(),t.config.mode==="range"&&Ve(X)}function I(X){for(var x=X>0?0:t.config.showMonths-1,le=X>0?t.config.showMonths:-1,ge=x;ge!=le;ge+=X)for(var Fe=t.daysContainer.children[ge],Be=X>0?0:Fe.children.length-1,rt=X>0?Fe.children.length:-1,se=Be;se!=rt;se+=X){var Me=Fe.children[se];if(Me.className.indexOf("hidden")===-1&&xe(Me.dateObj))return Me}}function A(X,x){for(var le=X.className.indexOf("Month")===-1?X.dateObj.getMonth():t.currentMonth,ge=x>0?t.config.showMonths:-1,Fe=x>0?1:-1,Be=le-t.currentMonth;Be!=ge;Be+=Fe)for(var rt=t.daysContainer.children[Be],se=le-t.currentMonth===Be?X.$i+x:x<0?rt.children.length-1:0,Me=rt.children.length,Ne=se;Ne>=0&&Ne0?Me:-1);Ne+=Fe){var ze=rt.children[Ne];if(ze.className.indexOf("hidden")===-1&&xe(ze.dateObj)&&Math.abs(X.$i-Ne)>=Math.abs(x))return L(ze)}t.changeMonth(Fe),P(I(Fe),0)}function P(X,x){var le=s(),ge=We(le||document.body),Fe=X!==void 0?X:ge?le:t.selectedDateElem!==void 0&&We(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&We(t.todayDateElem)?t.todayDateElem:I(x>0?1:-1);Fe===void 0?t._input.focus():ge?A(Fe,x):L(Fe)}function N(X,x){for(var le=(new Date(X,x,1).getDay()-t.l10n.firstDayOfWeek+7)%7,ge=t.utils.getDaysInMonth((x-1+12)%12,X),Fe=t.utils.getDaysInMonth(x,X),Be=window.document.createDocumentFragment(),rt=t.config.showMonths>1,se=rt?"prevMonthDay hidden":"prevMonthDay",Me=rt?"nextMonthDay hidden":"nextMonthDay",Ne=ge+1-le,ze=0;Ne<=ge;Ne++,ze++)Be.appendChild(E("flatpickr-day "+se,new Date(X,x-1,Ne),Ne,ze));for(Ne=1;Ne<=Fe;Ne++,ze++)Be.appendChild(E("flatpickr-day",new Date(X,x,Ne),Ne,ze));for(var Ge=Fe+1;Ge<=42-le&&(t.config.showMonths===1||ze%7!==0);Ge++,ze++)Be.appendChild(E("flatpickr-day "+Me,new Date(X,x+1,Ge%Fe),Ge,ze));var xt=Ot("div","dayContainer");return xt.appendChild(Be),xt}function R(){if(t.daysContainer!==void 0){Jo(t.daysContainer),t.weekNumbers&&Jo(t.weekNumbers);for(var X=document.createDocumentFragment(),x=0;x1||t.config.monthSelectorType!=="dropdown")){var X=function(ge){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&get.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var x=0;x<12;x++)if(X(x)){var le=Ot("option","flatpickr-monthDropdown-month");le.value=new Date(t.currentYear,x).getMonth().toString(),le.textContent=$r(x,t.config.shorthandCurrentMonth,t.l10n),le.tabIndex=-1,t.currentMonth===x&&(le.selected=!0),t.monthsDropdownContainer.appendChild(le)}}}function F(){var X=Ot("div","flatpickr-month"),x=window.document.createDocumentFragment(),le;t.config.showMonths>1||t.config.monthSelectorType==="static"?le=Ot("span","cur-month"):(t.monthsDropdownContainer=Ot("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),g(t.monthsDropdownContainer,"change",function(rt){var se=Un(rt),Me=parseInt(se.value,10);t.changeMonth(Me-t.currentMonth),Dt("onMonthChange")}),z(),le=t.monthsDropdownContainer);var ge=Zo("cur-year",{tabindex:"-1"}),Fe=ge.getElementsByTagName("input")[0];Fe.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&Fe.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&(Fe.setAttribute("max",t.config.maxDate.getFullYear().toString()),Fe.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var Be=Ot("div","flatpickr-current-month");return Be.appendChild(le),Be.appendChild(ge),x.appendChild(Be),X.appendChild(x),{container:X,yearElement:Fe,monthElement:le}}function U(){Jo(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var X=t.config.showMonths;X--;){var x=F();t.yearElements.push(x.yearElement),t.monthElements.push(x.monthElement),t.monthNav.appendChild(x.container)}t.monthNav.appendChild(t.nextMonthNav)}function J(){return t.monthNav=Ot("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=Ot("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=Ot("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,U(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(X){t.__hidePrevMonthArrow!==X&&($n(t.prevMonthNav,"flatpickr-disabled",X),t.__hidePrevMonthArrow=X)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(X){t.__hideNextMonthArrow!==X&&($n(t.nextMonthNav,"flatpickr-disabled",X),t.__hideNextMonthArrow=X)}}),t.currentYearElement=t.yearElements[0],Ui(),t.monthNav}function Y(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var X=La(t.config);t.timeContainer=Ot("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var x=Ot("span","flatpickr-time-separator",":"),le=Zo("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=le.getElementsByTagName("input")[0];var ge=Zo("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=ge.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=Ln(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?X.hours:f(X.hours)),t.minuteElement.value=Ln(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():X.minutes),t.hourElement.setAttribute("step",t.config.hourIncrement.toString()),t.minuteElement.setAttribute("step",t.config.minuteIncrement.toString()),t.hourElement.setAttribute("min",t.config.time_24hr?"0":"1"),t.hourElement.setAttribute("max",t.config.time_24hr?"23":"12"),t.hourElement.setAttribute("maxlength","2"),t.minuteElement.setAttribute("min","0"),t.minuteElement.setAttribute("max","59"),t.minuteElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(le),t.timeContainer.appendChild(x),t.timeContainer.appendChild(ge),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var Fe=Zo("flatpickr-second");t.secondElement=Fe.getElementsByTagName("input")[0],t.secondElement.value=Ln(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():X.seconds),t.secondElement.setAttribute("step",t.minuteElement.getAttribute("step")),t.secondElement.setAttribute("min","0"),t.secondElement.setAttribute("max","59"),t.secondElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(Ot("span","flatpickr-time-separator",":")),t.timeContainer.appendChild(Fe)}return t.config.time_24hr||(t.amPM=Ot("span","flatpickr-am-pm",t.l10n.amPM[Gn((t.latestSelectedDateObj?t.hourElement.value:t.config.defaultHour)>11)]),t.amPM.title=t.l10n.toggleTitle,t.amPM.tabIndex=-1,t.timeContainer.appendChild(t.amPM)),t.timeContainer}function Z(){t.weekdayContainer?Jo(t.weekdayContainer):t.weekdayContainer=Ot("div","flatpickr-weekdays");for(var X=t.config.showMonths;X--;){var x=Ot("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(x)}return G(),t.weekdayContainer}function G(){if(t.weekdayContainer){var X=t.l10n.firstDayOfWeek,x=nh(t.l10n.weekdays.shorthand);X>0&&X `+x.join("")+` @@ -85,7 +85,7 @@ var Dy=Object.defineProperty;var Iy=(n,e,t)=>e in n?Dy(n,e,{enumerable:!0,config If your query doesn't have a suitable one, you can use the universal (ROW_NUMBER() OVER()) as id.
  • Expressions must be aliased with a valid formatted field name, e.g. MAX(balance) as maxBalance.
  • Combined/multi-spaced expressions must be wrapped in parenthesis, e.g. - (MAX(balance) + 1) as maxBalance.
  • `,u=C(),g&&g.c(),f=ye(),p(t,"class","txt"),p(e,"for",i=n[8]),p(a,"class","help-block")},m(_,k){v(_,e,k),w(e,t),v(_,l,k),m[s].m(_,k),v(_,r,k),v(_,a,k),v(_,u,k),g&&g.m(_,k),v(_,f,k),c=!0},p(_,k){(!c||k&256&&i!==(i=_[8]))&&p(e,"for",i);let S=s;s=h(_),s===S?m[s].p(_,k):(re(),D(m[S],1,1,()=>{m[S]=null}),ae(),o=m[s],o?o.p(_,k):(o=m[s]=d[s](_),o.c()),M(o,1),o.m(r.parentNode,r)),_[3].length?g?g.p(_,k):(g=ph(_),g.c(),g.m(f.parentNode,f)):g&&(g.d(1),g=null)},i(_){c||(M(o),c=!0)},o(_){D(o),c=!1},d(_){_&&(y(e),y(l),y(r),y(a),y(u),y(f)),m[s].d(_),g&&g.d(_)}}}function wD(n){let e,t;return e=new fe({props:{class:"form-field required "+(n[3].length?"error":""),name:"viewQuery",$$slots:{default:[vD,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&8&&(s.class="form-field required "+(i[3].length?"error":"")),l&4367&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function SD(n,e,t){let i;Qe(n,yn,c=>t(4,i=c));let{collection:l}=e,s,o=!1,r=[];function a(c){t(3,r=[]);const d=V.getNestedVal(c,"fields",null);if(V.isEmpty(d))return;if(d!=null&&d.message){r.push(d==null?void 0:d.message);return}const m=V.extractColumnsFromQuery(l==null?void 0:l.viewQuery);V.removeByValue(m,"id"),V.removeByValue(m,"created"),V.removeByValue(m,"updated");for(let h in d)for(let g in d[h]){const _=d[h][g].message,k=m[h]||h;r.push(V.sentenize(k+": "+_))}}Xt(async()=>{t(2,o=!0);try{t(1,s=(await Tt(async()=>{const{default:c}=await import("./CodeEditor-Dl2IHbSx.js");return{default:c}},__vite__mapDeps([12,1]),import.meta.url)).default)}catch(c){console.warn(c)}t(2,o=!1)});function u(c){n.$$.not_equal(l.viewQuery,c)&&(l.viewQuery=c,t(0,l))}const f=()=>{r.length&&Yn("fields")};return n.$$set=c=>{"collection"in c&&t(0,l=c.collection)},n.$$.update=()=>{n.$$.dirty&16&&a(i)},[l,s,o,r,i,u,f]}class TD extends Se{constructor(e){super(),we(this,e,SD,wD,ke,{collection:0})}}function hh(n,e,t){const i=n.slice();return i[15]=e[t],i}function _h(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T,O,E,L,I,A=de(n[4]),P=[];for(let N=0;N@request
    filter:",c=C(),d=b("div"),d.innerHTML="@request.headers.* @request.query.* @request.body.* @request.auth.*",m=C(),h=b("hr"),g=C(),_=b("p"),_.innerHTML=`You could also add constraints and query other collections using the + (MAX(balance) + 1) as maxBalance.`,u=C(),g&&g.c(),f=ye(),p(t,"class","txt"),p(e,"for",i=n[8]),p(a,"class","help-block")},m(_,k){v(_,e,k),w(e,t),v(_,l,k),m[s].m(_,k),v(_,r,k),v(_,a,k),v(_,u,k),g&&g.m(_,k),v(_,f,k),c=!0},p(_,k){(!c||k&256&&i!==(i=_[8]))&&p(e,"for",i);let S=s;s=h(_),s===S?m[s].p(_,k):(re(),D(m[S],1,1,()=>{m[S]=null}),ae(),o=m[s],o?o.p(_,k):(o=m[s]=d[s](_),o.c()),M(o,1),o.m(r.parentNode,r)),_[3].length?g?g.p(_,k):(g=ph(_),g.c(),g.m(f.parentNode,f)):g&&(g.d(1),g=null)},i(_){c||(M(o),c=!0)},o(_){D(o),c=!1},d(_){_&&(y(e),y(l),y(r),y(a),y(u),y(f)),m[s].d(_),g&&g.d(_)}}}function wD(n){let e,t;return e=new fe({props:{class:"form-field required "+(n[3].length?"error":""),name:"viewQuery",$$slots:{default:[vD,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&8&&(s.class="form-field required "+(i[3].length?"error":"")),l&4367&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function SD(n,e,t){let i;Qe(n,yn,c=>t(4,i=c));let{collection:l}=e,s,o=!1,r=[];function a(c){t(3,r=[]);const d=V.getNestedVal(c,"fields",null);if(V.isEmpty(d))return;if(d!=null&&d.message){r.push(d==null?void 0:d.message);return}const m=V.extractColumnsFromQuery(l==null?void 0:l.viewQuery);V.removeByValue(m,"id"),V.removeByValue(m,"created"),V.removeByValue(m,"updated");for(let h in d)for(let g in d[h]){const _=d[h][g].message,k=m[h]||h;r.push(V.sentenize(k+": "+_))}}Xt(async()=>{t(2,o=!0);try{t(1,s=(await Tt(async()=>{const{default:c}=await import("./CodeEditor-B_VWhJeL.js");return{default:c}},__vite__mapDeps([12,1]),import.meta.url)).default)}catch(c){console.warn(c)}t(2,o=!1)});function u(c){n.$$.not_equal(l.viewQuery,c)&&(l.viewQuery=c,t(0,l))}const f=()=>{r.length&&Yn("fields")};return n.$$set=c=>{"collection"in c&&t(0,l=c.collection)},n.$$.update=()=>{n.$$.dirty&16&&a(i)},[l,s,o,r,i,u,f]}class TD extends Se{constructor(e){super(),we(this,e,SD,wD,ke,{collection:0})}}function hh(n,e,t){const i=n.slice();return i[15]=e[t],i}function _h(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T,O,E,L,I,A=de(n[4]),P=[];for(let N=0;N@request filter:",c=C(),d=b("div"),d.innerHTML="@request.headers.* @request.query.* @request.body.* @request.auth.*",m=C(),h=b("hr"),g=C(),_=b("p"),_.innerHTML=`You could also add constraints and query other collections using the @collection filter:`,k=C(),S=b("div"),S.innerHTML="@collection.ANY_COLLECTION_NAME.*",$=C(),T=b("hr"),O=C(),E=b("p"),E.innerHTML=`Example rule:
    @request.auth.id != "" && created > "2022-01-01 00:00:00"`,p(l,"class","m-b-0"),p(o,"class","inline-flex flex-gap-5"),p(a,"class","m-t-10 m-b-5"),p(f,"class","m-b-0"),p(d,"class","inline-flex flex-gap-5"),p(h,"class","m-t-10 m-b-5"),p(_,"class","m-b-0"),p(S,"class","inline-flex flex-gap-5"),p(T,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(N,R){v(N,e,R),w(e,t),w(t,i),w(i,l),w(i,s),w(i,o);for(let z=0;z{I&&(L||(L=He(e,mt,{duration:150},!0)),L.run(1))}),I=!0)},o(N){N&&(L||(L=He(e,mt,{duration:150},!1)),L.run(0)),I=!1},d(N){N&&y(e),dt(P,N),N&&L&&L.end()}}}function gh(n){let e,t=n[15]+"",i;return{c(){e=b("code"),i=B(t)},m(l,s){v(l,e,s),w(e,i)},p(l,s){s&16&&t!==(t=l[15]+"")&&oe(i,t)},d(l){l&&y(e)}}}function bh(n){let e=!n[3].includes(n[15]),t,i=e&&gh(n);return{c(){i&&i.c(),t=ye()},m(l,s){i&&i.m(l,s),v(l,t,s)},p(l,s){s&24&&(e=!l[3].includes(l[15])),e?i?i.p(l,s):(i=gh(l),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(l){l&&y(t),i&&i.d(l)}}}function kh(n){let e,t,i,l,s,o,r,a,u;function f(_){n[8](_)}let c={label:"Create rule",formKey:"createRule",collection:n[0],$$slots:{afterLabel:[$D,({isSuperuserOnly:_})=>({14:_}),({isSuperuserOnly:_})=>_?16384:0]},$$scope:{ctx:n}};n[0].createRule!==void 0&&(c.rule=n[0].createRule),e=new il({props:c}),ie.push(()=>be(e,"rule",f));function d(_){n[9](_)}let m={label:"Update rule",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&(m.rule=n[0].updateRule),l=new il({props:m}),ie.push(()=>be(l,"rule",d));function h(_){n[10](_)}let g={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(g.rule=n[0].deleteRule),r=new il({props:g}),ie.push(()=>be(r,"rule",h)),{c(){j(e.$$.fragment),i=C(),j(l.$$.fragment),o=C(),j(r.$$.fragment)},m(_,k){q(e,_,k),v(_,i,k),q(l,_,k),v(_,o,k),q(r,_,k),u=!0},p(_,k){const S={};k&1&&(S.collection=_[0]),k&278528&&(S.$$scope={dirty:k,ctx:_}),!t&&k&1&&(t=!0,S.rule=_[0].createRule,$e(()=>t=!1)),e.$set(S);const $={};k&1&&($.collection=_[0]),!s&&k&1&&(s=!0,$.rule=_[0].updateRule,$e(()=>s=!1)),l.$set($);const T={};k&1&&(T.collection=_[0]),!a&&k&1&&(a=!0,T.rule=_[0].deleteRule,$e(()=>a=!1)),r.$set(T)},i(_){u||(M(e.$$.fragment,_),M(l.$$.fragment,_),M(r.$$.fragment,_),u=!0)},o(_){D(e.$$.fragment,_),D(l.$$.fragment,_),D(r.$$.fragment,_),u=!1},d(_){_&&(y(i),y(o)),H(e,_),H(l,_),H(r,_)}}}function yh(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-information-line link-hint")},m(l,s){v(l,e,s),t||(i=Oe(qe.call(null,e,{text:'The Create rule is executed after a "dry save" of the submitted data, giving you access to the main record fields as in every other rule.',position:"top"})),t=!0)},d(l){l&&y(e),t=!1,i()}}}function $D(n){let e,t=!n[14]&&yh();return{c(){t&&t.c(),e=ye()},m(i,l){t&&t.m(i,l),v(i,e,l)},p(i,l){i[14]?t&&(t.d(1),t=null):t||(t=yh(),t.c(),t.m(e.parentNode,e))},d(i){i&&y(e),t&&t.d(i)}}}function vh(n){let e,t,i,l,s,o,r,a,u,f,c;function d(_,k){return _[2]?OD:CD}let m=d(n),h=m(n),g=n[2]&&wh(n);return{c(){e=b("hr"),t=C(),i=b("button"),l=b("strong"),l.textContent="Additional auth collection rules",s=C(),h.c(),r=C(),g&&g.c(),a=ye(),p(l,"class","txt"),p(i,"type","button"),p(i,"class",o="btn btn-sm m-b-sm "+(n[2]?"btn-secondary":"btn-hint btn-transparent"))},m(_,k){v(_,e,k),v(_,t,k),v(_,i,k),w(i,l),w(i,s),h.m(i,null),v(_,r,k),g&&g.m(_,k),v(_,a,k),u=!0,f||(c=W(i,"click",n[11]),f=!0)},p(_,k){m!==(m=d(_))&&(h.d(1),h=m(_),h&&(h.c(),h.m(i,null))),(!u||k&4&&o!==(o="btn btn-sm m-b-sm "+(_[2]?"btn-secondary":"btn-hint btn-transparent")))&&p(i,"class",o),_[2]?g?(g.p(_,k),k&4&&M(g,1)):(g=wh(_),g.c(),M(g,1),g.m(a.parentNode,a)):g&&(re(),D(g,1,1,()=>{g=null}),ae())},i(_){u||(M(g),u=!0)},o(_){D(g),u=!1},d(_){_&&(y(e),y(t),y(i),y(r),y(a)),h.d(),g&&g.d(_),f=!1,c()}}}function CD(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function OD(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function wh(n){let e,t,i,l,s,o,r,a;function u(m){n[12](m)}let f={label:"Authentication rule",formKey:"authRule",placeholder:"",collection:n[0],$$slots:{default:[MD]},$$scope:{ctx:n}};n[0].authRule!==void 0&&(f.rule=n[0].authRule),t=new il({props:f}),ie.push(()=>be(t,"rule",u));function c(m){n[13](m)}let d={label:"Manage rule",formKey:"manageRule",placeholder:"",required:n[0].manageRule!==null,collection:n[0],$$slots:{default:[ED]},$$scope:{ctx:n}};return n[0].manageRule!==void 0&&(d.rule=n[0].manageRule),s=new il({props:d}),ie.push(()=>be(s,"rule",c)),{c(){e=b("div"),j(t.$$.fragment),l=C(),j(s.$$.fragment),p(e,"class","block")},m(m,h){v(m,e,h),q(t,e,null),w(e,l),q(s,e,null),a=!0},p(m,h){const g={};h&1&&(g.collection=m[0]),h&262144&&(g.$$scope={dirty:h,ctx:m}),!i&&h&1&&(i=!0,g.rule=m[0].authRule,$e(()=>i=!1)),t.$set(g);const _={};h&1&&(_.required=m[0].manageRule!==null),h&1&&(_.collection=m[0]),h&262144&&(_.$$scope={dirty:h,ctx:m}),!o&&h&1&&(o=!0,_.rule=m[0].manageRule,$e(()=>o=!1)),s.$set(_)},i(m){a||(M(t.$$.fragment,m),M(s.$$.fragment,m),m&&tt(()=>{a&&(r||(r=He(e,mt,{duration:150},!0)),r.run(1))}),a=!0)},o(m){D(t.$$.fragment,m),D(s.$$.fragment,m),m&&(r||(r=He(e,mt,{duration:150},!1)),r.run(0)),a=!1},d(m){m&&y(e),H(t),H(s),m&&r&&r.end()}}}function MD(n){let e,t,i,l,s,o,r;return{c(){e=b("p"),e.textContent=`This rule is executed every time before authentication allowing you to restrict who can authenticate.`,t=C(),i=b("p"),i.innerHTML=`For example, to allow only verified users you can set it to @@ -120,7 +120,7 @@ var Dy=Object.defineProperty;var Iy=(n,e,t)=>e in n?Dy(n,e,{enumerable:!0,config form-field form-field-list form-field-file `+(o[4].required?"required":"")+` `+(o[9]?"dragover":"")+` - `),r[0]&16&&(a.name=o[4].name),r[0]&268439039|r[1]&64&&(a.$$scope={dirty:r,ctx:o}),t.$set(a)},i(o){i||(M(t.$$.fragment,o),i=!0)},o(o){D(t.$$.fragment,o),i=!1},d(o){o&&y(e),H(t),l=!1,Ie(s)}}}function EA(n,e,t){let i,l,s,{record:o}=e,{field:r}=e,{value:a=""}=e,{uploadedFiles:u=[]}=e,{deletedFileNames:f=[]}=e,c,d,m=!1,h="";function g(U){V.removeByValue(f,U),t(2,f)}function _(U){V.pushUnique(f,U),t(2,f)}function k(U){V.isEmpty(u[U])||u.splice(U,1),t(1,u)}function S(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:a,uploadedFiles:u,deletedFileNames:f},bubbles:!0}))}function $(U){var Y;U.preventDefault(),t(9,m=!1);const J=((Y=U.dataTransfer)==null?void 0:Y.files)||[];if(!(s||!J.length)){for(const Z of J){const G=l.length+u.length-f.length;if(r.maxSelect<=G)break;u.push(Z)}t(1,u)}}Xt(async()=>{t(10,h=await _e.getSuperuserFileToken(o.collectionId))});const T=U=>g(U),O=U=>_(U);function E(U){a=U,t(0,a),t(6,i),t(4,r)}const L=U=>k(U);function I(U){u=U,t(1,u)}function A(U){ie[U?"unshift":"push"](()=>{c=U,t(7,c)})}const P=()=>{for(let U of c.files)u.push(U);t(1,u),t(7,c.value=null,c)},N=()=>c==null?void 0:c.click();function R(U){ie[U?"unshift":"push"](()=>{d=U,t(8,d)})}const z=()=>{t(9,m=!0)},F=()=>{t(9,m=!1)};return n.$$set=U=>{"record"in U&&t(3,o=U.record),"field"in U&&t(4,r=U.field),"value"in U&&t(0,a=U.value),"uploadedFiles"in U&&t(1,u=U.uploadedFiles),"deletedFileNames"in U&&t(2,f=U.deletedFileNames)},n.$$.update=()=>{n.$$.dirty[0]&2&&(Array.isArray(u)||t(1,u=V.toArray(u))),n.$$.dirty[0]&4&&(Array.isArray(f)||t(2,f=V.toArray(f))),n.$$.dirty[0]&16&&t(6,i=r.maxSelect>1),n.$$.dirty[0]&65&&V.isEmpty(a)&&t(0,a=i?[]:""),n.$$.dirty[0]&1&&t(5,l=V.toArray(a)),n.$$.dirty[0]&54&&t(11,s=(l.length||u.length)&&r.maxSelect<=l.length+u.length-f.length),n.$$.dirty[0]&6&&(u!==-1||f!==-1)&&S()},[a,u,f,o,r,l,i,c,d,m,h,s,g,_,k,$,T,O,E,L,I,A,P,N,R,z,F]}class DA extends Se{constructor(e){super(),we(this,e,EA,MA,ke,{record:3,field:4,value:0,uploadedFiles:1,deletedFileNames:2},null,[-1,-1])}}function IA(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function LA(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function AA(n){let e,t,i,l;function s(a,u){return a[4]?LA:IA}let o=s(n),r=o(n);return{c(){e=b("span"),r.c(),p(e,"class","json-state svelte-p6ecb8")},m(a,u){v(a,e,u),r.m(e,null),i||(l=Oe(t=qe.call(null,e,{position:"left",text:n[4]?"Valid JSON":"Invalid JSON"})),i=!0)},p(a,u){o!==(o=s(a))&&(r.d(1),r=o(a),r&&(r.c(),r.m(e,null))),t&&It(t.update)&&u&16&&t.update.call(null,{position:"left",text:a[4]?"Valid JSON":"Invalid JSON"})},d(a){a&&y(e),r.d(),i=!1,l()}}}function PA(n){let e;return{c(){e=b("input"),p(e,"type","text"),p(e,"class","txt-mono"),e.value="Loading...",e.disabled=!0},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function NA(n){let e,t,i;var l=n[3];function s(o,r){return{props:{id:o[6],maxHeight:"500",language:"json",value:o[2]}}}return l&&(e=zt(l,s(n)),e.$on("change",n[5])),{c(){e&&j(e.$$.fragment),t=ye()},m(o,r){e&&q(e,o,r),v(o,t,r),i=!0},p(o,r){if(r&8&&l!==(l=o[3])){if(e){re();const a=e;D(a.$$.fragment,1,0,()=>{H(a,1)}),ae()}l?(e=zt(l,s(o)),e.$on("change",o[5]),j(e.$$.fragment),M(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(l){const a={};r&64&&(a.id=o[6]),r&4&&(a.value=o[2]),e.$set(a)}},i(o){i||(e&&M(e.$$.fragment,o),i=!0)},o(o){e&&D(e.$$.fragment,o),i=!1},d(o){o&&y(t),e&&H(e,o)}}}function RA(n){let e,t,i,l,s,o;e=new ii({props:{uniqueId:n[6],field:n[1],$$slots:{default:[AA]},$$scope:{ctx:n}}});const r=[NA,PA],a=[];function u(f,c){return f[3]?0:1}return i=u(n),l=a[i]=r[i](n),{c(){j(e.$$.fragment),t=C(),l.c(),s=ye()},m(f,c){q(e,f,c),v(f,t,c),a[i].m(f,c),v(f,s,c),o=!0},p(f,c){const d={};c&64&&(d.uniqueId=f[6]),c&2&&(d.field=f[1]),c&144&&(d.$$scope={dirty:c,ctx:f}),e.$set(d);let m=i;i=u(f),i===m?a[i].p(f,c):(re(),D(a[m],1,1,()=>{a[m]=null}),ae(),l=a[i],l?l.p(f,c):(l=a[i]=r[i](f),l.c()),M(l,1),l.m(s.parentNode,s))},i(f){o||(M(e.$$.fragment,f),M(l),o=!0)},o(f){D(e.$$.fragment,f),D(l),o=!1},d(f){f&&(y(t),y(s)),H(e,f),a[i].d(f)}}}function FA(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[RA,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&223&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function pg(n){return typeof n=="string"&&Ty(n)?n:JSON.stringify(typeof n>"u"?null:n,null,2)}function Ty(n){try{return JSON.parse(n===""?null:n),!0}catch{}return!1}function qA(n,e,t){let i,{field:l}=e,{value:s=void 0}=e,o,r=pg(s);Xt(async()=>{try{t(3,o=(await Tt(async()=>{const{default:u}=await import("./CodeEditor-Dl2IHbSx.js");return{default:u}},__vite__mapDeps([12,1]),import.meta.url)).default)}catch(u){console.warn(u)}});const a=u=>{t(2,r=u.detail),t(0,s=r.trim())};return n.$$set=u=>{"field"in u&&t(1,l=u.field),"value"in u&&t(0,s=u.value)},n.$$.update=()=>{n.$$.dirty&5&&s!==(r==null?void 0:r.trim())&&(t(2,r=pg(s)),t(0,s=r)),n.$$.dirty&4&&t(4,i=Ty(r))},[s,l,r,o,i,a]}class HA extends Se{constructor(e){super(),we(this,e,qA,FA,ke,{field:1,value:0})}}function jA(n){let e,t,i,l,s,o,r,a,u,f;return e=new ii({props:{uniqueId:n[3],field:n[1]}}),{c(){j(e.$$.fragment),t=C(),i=b("input"),p(i,"type","number"),p(i,"id",l=n[3]),i.required=s=n[1].required,p(i,"min",o=n[1].min),p(i,"max",r=n[1].max),p(i,"step","any")},m(c,d){q(e,c,d),v(c,t,d),v(c,i,d),he(i,n[0]),a=!0,u||(f=W(i,"input",n[2]),u=!0)},p(c,d){const m={};d&8&&(m.uniqueId=c[3]),d&2&&(m.field=c[1]),e.$set(m),(!a||d&8&&l!==(l=c[3]))&&p(i,"id",l),(!a||d&2&&s!==(s=c[1].required))&&(i.required=s),(!a||d&2&&o!==(o=c[1].min))&&p(i,"min",o),(!a||d&2&&r!==(r=c[1].max))&&p(i,"max",r),d&1&>(i.value)!==c[0]&&he(i,c[0])},i(c){a||(M(e.$$.fragment,c),a=!0)},o(c){D(e.$$.fragment,c),a=!1},d(c){c&&(y(t),y(i)),H(e,c),u=!1,f()}}}function zA(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[jA,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function UA(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=gt(this.value),t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class VA extends Se{constructor(e){super(),we(this,e,UA,zA,ke,{field:1,value:0})}}function BA(n){let e,t,i,l,s,o,r,a;return e=new ii({props:{uniqueId:n[3],field:n[1]}}),{c(){j(e.$$.fragment),t=C(),i=b("input"),p(i,"type","password"),p(i,"id",l=n[3]),p(i,"autocomplete","new-password"),i.required=s=n[1].required},m(u,f){q(e,u,f),v(u,t,f),v(u,i,f),he(i,n[0]),o=!0,r||(a=W(i,"input",n[2]),r=!0)},p(u,f){const c={};f&8&&(c.uniqueId=u[3]),f&2&&(c.field=u[1]),e.$set(c),(!o||f&8&&l!==(l=u[3]))&&p(i,"id",l),(!o||f&2&&s!==(s=u[1].required))&&(i.required=s),f&1&&i.value!==u[0]&&he(i,u[0])},i(u){o||(M(e.$$.fragment,u),o=!0)},o(u){D(e.$$.fragment,u),o=!1},d(u){u&&(y(t),y(i)),H(e,u),r=!1,a()}}}function WA(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[BA,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function YA(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=this.value,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class KA extends Se{constructor(e){super(),we(this,e,YA,WA,ke,{field:1,value:0})}}function mg(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function JA(n,e){e=mg(e),e!=null&&e.callback&&e.callback();function t(i){if(!(e!=null&&e.callback))return;i.target.scrollHeight-i.target.clientHeight-i.target.scrollTop<=e.threshold&&e.callback()}return n.addEventListener("scroll",t),n.addEventListener("resize",t),{update(i){e=mg(i)},destroy(){n.removeEventListener("scroll",t),n.removeEventListener("resize",t)}}}function hg(n,e,t){const i=n.slice();return i[50]=e[t],i[52]=t,i}function _g(n,e,t){const i=n.slice();i[50]=e[t];const l=i[9](i[50]);return i[6]=l,i}function gg(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='
    New record
    ',p(e,"type","button"),p(e,"class","btn btn-pill btn-transparent btn-hint p-l-xs p-r-xs")},m(l,s){v(l,e,s),t||(i=W(e,"click",n[31]),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function bg(n){let e,t=!n[13]&&kg(n);return{c(){t&&t.c(),e=ye()},m(i,l){t&&t.m(i,l),v(i,e,l)},p(i,l){i[13]?t&&(t.d(1),t=null):t?t.p(i,l):(t=kg(i),t.c(),t.m(e.parentNode,e))},d(i){i&&y(e),t&&t.d(i)}}}function kg(n){var s;let e,t,i,l=((s=n[2])==null?void 0:s.length)&&yg(n);return{c(){e=b("div"),t=b("span"),t.textContent="No records found.",i=C(),l&&l.c(),p(t,"class","txt txt-hint"),p(e,"class","list-item")},m(o,r){v(o,e,r),w(e,t),w(e,i),l&&l.m(e,null)},p(o,r){var a;(a=o[2])!=null&&a.length?l?l.p(o,r):(l=yg(o),l.c(),l.m(e,null)):l&&(l.d(1),l=null)},d(o){o&&y(e),l&&l.d()}}}function yg(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(l,s){v(l,e,s),t||(i=W(e,"click",n[35]),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function ZA(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-blank-circle-line txt-disabled")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function GA(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function vg(n){let e,t,i,l;function s(){return n[32](n[50])}return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-transparent btn-hint m-l-auto"),p(e,"class","actions nonintrusive")},m(o,r){v(o,e,r),w(e,t),i||(l=[Oe(qe.call(null,t,"Edit")),W(t,"keydown",On(n[27])),W(t,"click",On(s))],i=!0)},p(o,r){n=o},d(o){o&&y(e),i=!1,Ie(l)}}}function wg(n,e){let t,i,l,s,o,r,a,u;function f(_,k){return _[6]?GA:ZA}let c=f(e),d=c(e);s=new Ur({props:{record:e[50]}});let m=!e[11]&&vg(e);function h(){return e[33](e[50])}function g(..._){return e[34](e[50],..._)}return{key:n,first:null,c(){t=b("div"),d.c(),i=C(),l=b("div"),j(s.$$.fragment),o=C(),m&&m.c(),p(l,"class","content"),p(t,"tabindex","0"),p(t,"class","list-item handle"),ee(t,"selected",e[6]),ee(t,"disabled",!e[6]&&e[4]>1&&!e[10]),this.first=t},m(_,k){v(_,t,k),d.m(t,null),w(t,i),w(t,l),q(s,l,null),w(t,o),m&&m.m(t,null),r=!0,a||(u=[W(t,"click",h),W(t,"keydown",g)],a=!0)},p(_,k){e=_,c!==(c=f(e))&&(d.d(1),d=c(e),d&&(d.c(),d.m(t,i)));const S={};k[0]&256&&(S.record=e[50]),s.$set(S),e[11]?m&&(m.d(1),m=null):m?m.p(e,k):(m=vg(e),m.c(),m.m(t,null)),(!r||k[0]&768)&&ee(t,"selected",e[6]),(!r||k[0]&1808)&&ee(t,"disabled",!e[6]&&e[4]>1&&!e[10])},i(_){r||(M(s.$$.fragment,_),r=!0)},o(_){D(s.$$.fragment,_),r=!1},d(_){_&&y(t),d.d(),H(s),m&&m.d(),a=!1,Ie(u)}}}function Sg(n){let e;return{c(){e=b("div"),e.innerHTML='
    ',p(e,"class","list-item")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function Tg(n){let e,t=n[6].length+"",i,l,s,o;return{c(){e=B("("),i=B(t),l=B(" of MAX "),s=B(n[4]),o=B(")")},m(r,a){v(r,e,a),v(r,i,a),v(r,l,a),v(r,s,a),v(r,o,a)},p(r,a){a[0]&64&&t!==(t=r[6].length+"")&&oe(i,t),a[0]&16&&oe(s,r[4])},d(r){r&&(y(e),y(i),y(l),y(s),y(o))}}}function XA(n){let e;return{c(){e=b("p"),e.textContent="No selected records.",p(e,"class","txt-hint")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function QA(n){let e,t,i=de(n[6]),l=[];for(let o=0;oD(l[o],1,1,()=>{l[o]=null});return{c(){e=b("div");for(let o=0;o',s=C(),p(l,"type","button"),p(l,"title","Remove"),p(l,"class","btn btn-circle btn-transparent btn-hint btn-xs"),p(e,"class","label"),ee(e,"label-danger",n[53]),ee(e,"label-warning",n[54])},m(f,c){v(f,e,c),q(t,e,null),w(e,i),w(e,l),v(f,s,c),o=!0,r||(a=W(l,"click",u),r=!0)},p(f,c){n=f;const d={};c[0]&64&&(d.record=n[50]),t.$set(d),(!o||c[1]&4194304)&&ee(e,"label-danger",n[53]),(!o||c[1]&8388608)&&ee(e,"label-warning",n[54])},i(f){o||(M(t.$$.fragment,f),o=!0)},o(f){D(t.$$.fragment,f),o=!1},d(f){f&&(y(e),y(s)),H(t),r=!1,a()}}}function $g(n){let e,t,i;function l(o){n[38](o)}let s={index:n[52],$$slots:{default:[xA,({dragging:o,dragover:r})=>({53:o,54:r}),({dragging:o,dragover:r})=>[0,(o?4194304:0)|(r?8388608:0)]]},$$scope:{ctx:n}};return n[6]!==void 0&&(s.list=n[6]),e=new _o({props:s}),ie.push(()=>be(e,"list",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&64|r[1]&79691776&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&64&&(t=!0,a.list=o[6],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function eP(n){let e,t,i,l,s,o=[],r=new Map,a,u,f,c,d,m,h,g,_,k,S,$;t=new Hr({props:{value:n[2],autocompleteCollection:n[5]}}),t.$on("submit",n[30]);let T=!n[11]&&gg(n),O=de(n[8]);const E=z=>z[50].id;for(let z=0;z1&&Tg(n);const P=[QA,XA],N=[];function R(z,F){return z[6].length?0:1}return h=R(n),g=N[h]=P[h](n),{c(){e=b("div"),j(t.$$.fragment),i=C(),T&&T.c(),l=C(),s=b("div");for(let z=0;z{t(10,h=await _e.getSuperuserFileToken(o.collectionId))});const T=U=>g(U),O=U=>_(U);function E(U){a=U,t(0,a),t(6,i),t(4,r)}const L=U=>k(U);function I(U){u=U,t(1,u)}function A(U){ie[U?"unshift":"push"](()=>{c=U,t(7,c)})}const P=()=>{for(let U of c.files)u.push(U);t(1,u),t(7,c.value=null,c)},N=()=>c==null?void 0:c.click();function R(U){ie[U?"unshift":"push"](()=>{d=U,t(8,d)})}const z=()=>{t(9,m=!0)},F=()=>{t(9,m=!1)};return n.$$set=U=>{"record"in U&&t(3,o=U.record),"field"in U&&t(4,r=U.field),"value"in U&&t(0,a=U.value),"uploadedFiles"in U&&t(1,u=U.uploadedFiles),"deletedFileNames"in U&&t(2,f=U.deletedFileNames)},n.$$.update=()=>{n.$$.dirty[0]&2&&(Array.isArray(u)||t(1,u=V.toArray(u))),n.$$.dirty[0]&4&&(Array.isArray(f)||t(2,f=V.toArray(f))),n.$$.dirty[0]&16&&t(6,i=r.maxSelect>1),n.$$.dirty[0]&65&&V.isEmpty(a)&&t(0,a=i?[]:""),n.$$.dirty[0]&1&&t(5,l=V.toArray(a)),n.$$.dirty[0]&54&&t(11,s=(l.length||u.length)&&r.maxSelect<=l.length+u.length-f.length),n.$$.dirty[0]&6&&(u!==-1||f!==-1)&&S()},[a,u,f,o,r,l,i,c,d,m,h,s,g,_,k,$,T,O,E,L,I,A,P,N,R,z,F]}class DA extends Se{constructor(e){super(),we(this,e,EA,MA,ke,{record:3,field:4,value:0,uploadedFiles:1,deletedFileNames:2},null,[-1,-1])}}function IA(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function LA(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function AA(n){let e,t,i,l;function s(a,u){return a[4]?LA:IA}let o=s(n),r=o(n);return{c(){e=b("span"),r.c(),p(e,"class","json-state svelte-p6ecb8")},m(a,u){v(a,e,u),r.m(e,null),i||(l=Oe(t=qe.call(null,e,{position:"left",text:n[4]?"Valid JSON":"Invalid JSON"})),i=!0)},p(a,u){o!==(o=s(a))&&(r.d(1),r=o(a),r&&(r.c(),r.m(e,null))),t&&It(t.update)&&u&16&&t.update.call(null,{position:"left",text:a[4]?"Valid JSON":"Invalid JSON"})},d(a){a&&y(e),r.d(),i=!1,l()}}}function PA(n){let e;return{c(){e=b("input"),p(e,"type","text"),p(e,"class","txt-mono"),e.value="Loading...",e.disabled=!0},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function NA(n){let e,t,i;var l=n[3];function s(o,r){return{props:{id:o[6],maxHeight:"500",language:"json",value:o[2]}}}return l&&(e=zt(l,s(n)),e.$on("change",n[5])),{c(){e&&j(e.$$.fragment),t=ye()},m(o,r){e&&q(e,o,r),v(o,t,r),i=!0},p(o,r){if(r&8&&l!==(l=o[3])){if(e){re();const a=e;D(a.$$.fragment,1,0,()=>{H(a,1)}),ae()}l?(e=zt(l,s(o)),e.$on("change",o[5]),j(e.$$.fragment),M(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(l){const a={};r&64&&(a.id=o[6]),r&4&&(a.value=o[2]),e.$set(a)}},i(o){i||(e&&M(e.$$.fragment,o),i=!0)},o(o){e&&D(e.$$.fragment,o),i=!1},d(o){o&&y(t),e&&H(e,o)}}}function RA(n){let e,t,i,l,s,o;e=new ii({props:{uniqueId:n[6],field:n[1],$$slots:{default:[AA]},$$scope:{ctx:n}}});const r=[NA,PA],a=[];function u(f,c){return f[3]?0:1}return i=u(n),l=a[i]=r[i](n),{c(){j(e.$$.fragment),t=C(),l.c(),s=ye()},m(f,c){q(e,f,c),v(f,t,c),a[i].m(f,c),v(f,s,c),o=!0},p(f,c){const d={};c&64&&(d.uniqueId=f[6]),c&2&&(d.field=f[1]),c&144&&(d.$$scope={dirty:c,ctx:f}),e.$set(d);let m=i;i=u(f),i===m?a[i].p(f,c):(re(),D(a[m],1,1,()=>{a[m]=null}),ae(),l=a[i],l?l.p(f,c):(l=a[i]=r[i](f),l.c()),M(l,1),l.m(s.parentNode,s))},i(f){o||(M(e.$$.fragment,f),M(l),o=!0)},o(f){D(e.$$.fragment,f),D(l),o=!1},d(f){f&&(y(t),y(s)),H(e,f),a[i].d(f)}}}function FA(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[RA,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&223&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function pg(n){return typeof n=="string"&&Ty(n)?n:JSON.stringify(typeof n>"u"?null:n,null,2)}function Ty(n){try{return JSON.parse(n===""?null:n),!0}catch{}return!1}function qA(n,e,t){let i,{field:l}=e,{value:s=void 0}=e,o,r=pg(s);Xt(async()=>{try{t(3,o=(await Tt(async()=>{const{default:u}=await import("./CodeEditor-B_VWhJeL.js");return{default:u}},__vite__mapDeps([12,1]),import.meta.url)).default)}catch(u){console.warn(u)}});const a=u=>{t(2,r=u.detail),t(0,s=r.trim())};return n.$$set=u=>{"field"in u&&t(1,l=u.field),"value"in u&&t(0,s=u.value)},n.$$.update=()=>{n.$$.dirty&5&&s!==(r==null?void 0:r.trim())&&(t(2,r=pg(s)),t(0,s=r)),n.$$.dirty&4&&t(4,i=Ty(r))},[s,l,r,o,i,a]}class HA extends Se{constructor(e){super(),we(this,e,qA,FA,ke,{field:1,value:0})}}function jA(n){let e,t,i,l,s,o,r,a,u,f;return e=new ii({props:{uniqueId:n[3],field:n[1]}}),{c(){j(e.$$.fragment),t=C(),i=b("input"),p(i,"type","number"),p(i,"id",l=n[3]),i.required=s=n[1].required,p(i,"min",o=n[1].min),p(i,"max",r=n[1].max),p(i,"step","any")},m(c,d){q(e,c,d),v(c,t,d),v(c,i,d),he(i,n[0]),a=!0,u||(f=W(i,"input",n[2]),u=!0)},p(c,d){const m={};d&8&&(m.uniqueId=c[3]),d&2&&(m.field=c[1]),e.$set(m),(!a||d&8&&l!==(l=c[3]))&&p(i,"id",l),(!a||d&2&&s!==(s=c[1].required))&&(i.required=s),(!a||d&2&&o!==(o=c[1].min))&&p(i,"min",o),(!a||d&2&&r!==(r=c[1].max))&&p(i,"max",r),d&1&>(i.value)!==c[0]&&he(i,c[0])},i(c){a||(M(e.$$.fragment,c),a=!0)},o(c){D(e.$$.fragment,c),a=!1},d(c){c&&(y(t),y(i)),H(e,c),u=!1,f()}}}function zA(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[jA,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function UA(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=gt(this.value),t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class VA extends Se{constructor(e){super(),we(this,e,UA,zA,ke,{field:1,value:0})}}function BA(n){let e,t,i,l,s,o,r,a;return e=new ii({props:{uniqueId:n[3],field:n[1]}}),{c(){j(e.$$.fragment),t=C(),i=b("input"),p(i,"type","password"),p(i,"id",l=n[3]),p(i,"autocomplete","new-password"),i.required=s=n[1].required},m(u,f){q(e,u,f),v(u,t,f),v(u,i,f),he(i,n[0]),o=!0,r||(a=W(i,"input",n[2]),r=!0)},p(u,f){const c={};f&8&&(c.uniqueId=u[3]),f&2&&(c.field=u[1]),e.$set(c),(!o||f&8&&l!==(l=u[3]))&&p(i,"id",l),(!o||f&2&&s!==(s=u[1].required))&&(i.required=s),f&1&&i.value!==u[0]&&he(i,u[0])},i(u){o||(M(e.$$.fragment,u),o=!0)},o(u){D(e.$$.fragment,u),o=!1},d(u){u&&(y(t),y(i)),H(e,u),r=!1,a()}}}function WA(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[BA,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function YA(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=this.value,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class KA extends Se{constructor(e){super(),we(this,e,YA,WA,ke,{field:1,value:0})}}function mg(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function JA(n,e){e=mg(e),e!=null&&e.callback&&e.callback();function t(i){if(!(e!=null&&e.callback))return;i.target.scrollHeight-i.target.clientHeight-i.target.scrollTop<=e.threshold&&e.callback()}return n.addEventListener("scroll",t),n.addEventListener("resize",t),{update(i){e=mg(i)},destroy(){n.removeEventListener("scroll",t),n.removeEventListener("resize",t)}}}function hg(n,e,t){const i=n.slice();return i[50]=e[t],i[52]=t,i}function _g(n,e,t){const i=n.slice();i[50]=e[t];const l=i[9](i[50]);return i[6]=l,i}function gg(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='
    New record
    ',p(e,"type","button"),p(e,"class","btn btn-pill btn-transparent btn-hint p-l-xs p-r-xs")},m(l,s){v(l,e,s),t||(i=W(e,"click",n[31]),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function bg(n){let e,t=!n[13]&&kg(n);return{c(){t&&t.c(),e=ye()},m(i,l){t&&t.m(i,l),v(i,e,l)},p(i,l){i[13]?t&&(t.d(1),t=null):t?t.p(i,l):(t=kg(i),t.c(),t.m(e.parentNode,e))},d(i){i&&y(e),t&&t.d(i)}}}function kg(n){var s;let e,t,i,l=((s=n[2])==null?void 0:s.length)&&yg(n);return{c(){e=b("div"),t=b("span"),t.textContent="No records found.",i=C(),l&&l.c(),p(t,"class","txt txt-hint"),p(e,"class","list-item")},m(o,r){v(o,e,r),w(e,t),w(e,i),l&&l.m(e,null)},p(o,r){var a;(a=o[2])!=null&&a.length?l?l.p(o,r):(l=yg(o),l.c(),l.m(e,null)):l&&(l.d(1),l=null)},d(o){o&&y(e),l&&l.d()}}}function yg(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(l,s){v(l,e,s),t||(i=W(e,"click",n[35]),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function ZA(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-blank-circle-line txt-disabled")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function GA(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function vg(n){let e,t,i,l;function s(){return n[32](n[50])}return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-transparent btn-hint m-l-auto"),p(e,"class","actions nonintrusive")},m(o,r){v(o,e,r),w(e,t),i||(l=[Oe(qe.call(null,t,"Edit")),W(t,"keydown",On(n[27])),W(t,"click",On(s))],i=!0)},p(o,r){n=o},d(o){o&&y(e),i=!1,Ie(l)}}}function wg(n,e){let t,i,l,s,o,r,a,u;function f(_,k){return _[6]?GA:ZA}let c=f(e),d=c(e);s=new Ur({props:{record:e[50]}});let m=!e[11]&&vg(e);function h(){return e[33](e[50])}function g(..._){return e[34](e[50],..._)}return{key:n,first:null,c(){t=b("div"),d.c(),i=C(),l=b("div"),j(s.$$.fragment),o=C(),m&&m.c(),p(l,"class","content"),p(t,"tabindex","0"),p(t,"class","list-item handle"),ee(t,"selected",e[6]),ee(t,"disabled",!e[6]&&e[4]>1&&!e[10]),this.first=t},m(_,k){v(_,t,k),d.m(t,null),w(t,i),w(t,l),q(s,l,null),w(t,o),m&&m.m(t,null),r=!0,a||(u=[W(t,"click",h),W(t,"keydown",g)],a=!0)},p(_,k){e=_,c!==(c=f(e))&&(d.d(1),d=c(e),d&&(d.c(),d.m(t,i)));const S={};k[0]&256&&(S.record=e[50]),s.$set(S),e[11]?m&&(m.d(1),m=null):m?m.p(e,k):(m=vg(e),m.c(),m.m(t,null)),(!r||k[0]&768)&&ee(t,"selected",e[6]),(!r||k[0]&1808)&&ee(t,"disabled",!e[6]&&e[4]>1&&!e[10])},i(_){r||(M(s.$$.fragment,_),r=!0)},o(_){D(s.$$.fragment,_),r=!1},d(_){_&&y(t),d.d(),H(s),m&&m.d(),a=!1,Ie(u)}}}function Sg(n){let e;return{c(){e=b("div"),e.innerHTML='
    ',p(e,"class","list-item")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function Tg(n){let e,t=n[6].length+"",i,l,s,o;return{c(){e=B("("),i=B(t),l=B(" of MAX "),s=B(n[4]),o=B(")")},m(r,a){v(r,e,a),v(r,i,a),v(r,l,a),v(r,s,a),v(r,o,a)},p(r,a){a[0]&64&&t!==(t=r[6].length+"")&&oe(i,t),a[0]&16&&oe(s,r[4])},d(r){r&&(y(e),y(i),y(l),y(s),y(o))}}}function XA(n){let e;return{c(){e=b("p"),e.textContent="No selected records.",p(e,"class","txt-hint")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function QA(n){let e,t,i=de(n[6]),l=[];for(let o=0;oD(l[o],1,1,()=>{l[o]=null});return{c(){e=b("div");for(let o=0;o',s=C(),p(l,"type","button"),p(l,"title","Remove"),p(l,"class","btn btn-circle btn-transparent btn-hint btn-xs"),p(e,"class","label"),ee(e,"label-danger",n[53]),ee(e,"label-warning",n[54])},m(f,c){v(f,e,c),q(t,e,null),w(e,i),w(e,l),v(f,s,c),o=!0,r||(a=W(l,"click",u),r=!0)},p(f,c){n=f;const d={};c[0]&64&&(d.record=n[50]),t.$set(d),(!o||c[1]&4194304)&&ee(e,"label-danger",n[53]),(!o||c[1]&8388608)&&ee(e,"label-warning",n[54])},i(f){o||(M(t.$$.fragment,f),o=!0)},o(f){D(t.$$.fragment,f),o=!1},d(f){f&&(y(e),y(s)),H(t),r=!1,a()}}}function $g(n){let e,t,i;function l(o){n[38](o)}let s={index:n[52],$$slots:{default:[xA,({dragging:o,dragover:r})=>({53:o,54:r}),({dragging:o,dragover:r})=>[0,(o?4194304:0)|(r?8388608:0)]]},$$scope:{ctx:n}};return n[6]!==void 0&&(s.list=n[6]),e=new _o({props:s}),ie.push(()=>be(e,"list",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&64|r[1]&79691776&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&64&&(t=!0,a.list=o[6],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function eP(n){let e,t,i,l,s,o=[],r=new Map,a,u,f,c,d,m,h,g,_,k,S,$;t=new Hr({props:{value:n[2],autocompleteCollection:n[5]}}),t.$on("submit",n[30]);let T=!n[11]&&gg(n),O=de(n[8]);const E=z=>z[50].id;for(let z=0;z1&&Tg(n);const P=[QA,XA],N=[];function R(z,F){return z[6].length?0:1}return h=R(n),g=N[h]=P[h](n),{c(){e=b("div"),j(t.$$.fragment),i=C(),T&&T.c(),l=C(),s=b("div");for(let z=0;z1?A?A.p(z,F):(A=Tg(z),A.c(),A.m(c,null)):A&&(A.d(1),A=null);let J=h;h=R(z),h===J?N[h].p(z,F):(re(),D(N[J],1,1,()=>{N[J]=null}),ae(),g=N[h],g?g.p(z,F):(g=N[h]=P[h](z),g.c()),M(g,1),g.m(_.parentNode,_))},i(z){if(!k){M(t.$$.fragment,z);for(let F=0;FCancel',t=C(),i=b("button"),i.innerHTML='Set selection',p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn")},m(o,r){v(o,e,r),v(o,t,r),v(o,i,r),l||(s=[W(e,"click",n[28]),W(i,"click",n[29])],l=!0)},p:te,d(o){o&&(y(e),y(t),y(i)),l=!1,Ie(s)}}}function iP(n){let e,t,i,l;const s=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[nP],header:[tP],default:[eP]},$$scope:{ctx:n}};for(let a=0;at(26,m=Ce));const h=kt(),g="picker_"+V.randomString(5);let{value:_}=e,{field:k}=e,S,$,T="",O=[],E=[],L=1,I=0,A=!1,P=!1;function N(){return t(2,T=""),t(8,O=[]),t(6,E=[]),F(),U(!0),S==null?void 0:S.show()}function R(){return S==null?void 0:S.hide()}function z(){var Ht;let Ce="";const ct=(Ht=s==null?void 0:s.fields)==null?void 0:Ht.filter(Le=>!Le.hidden&&Le.presentable&&Le.type=="relation");for(const Le of ct){const ot=V.getExpandPresentableRelField(Le,m,2);ot&&(Ce!=""&&(Ce+=","),Ce+=ot)}return Ce}async function F(){const Ce=V.toArray(_);if(!l||!Ce.length)return;t(24,P=!0);let ct=[];const Ht=Ce.slice(),Le=[];for(;Ht.length>0;){const ot=[];for(const on of Ht.splice(0,Go))ot.push(`id="${on}"`);Le.push(_e.collection(l).getFullList({batch:Go,filter:ot.join("||"),fields:"*:excerpt(200)",expand:z(),requestKey:null}))}try{await Promise.all(Le).then(ot=>{ct=ct.concat(...ot)}),t(6,E=[]);for(const ot of Ce){const on=V.findByKey(ct,"id",ot);on&&E.push(on)}T.trim()||t(8,O=V.filterDuplicatesByKey(E.concat(O))),t(24,P=!1)}catch(ot){ot.isAbort||(_e.error(ot),t(24,P=!1))}}async function U(Ce=!1){if(l){t(3,A=!0),Ce&&(T.trim()?t(8,O=[]):t(8,O=V.toArray(E).slice()));try{const ct=Ce?1:L+1,Ht=V.getAllCollectionIdentifiers(s);let Le="";o||(Le="-@rowid");const ot=await _e.collection(l).getList(ct,Go,{filter:V.normalizeSearchFilter(T,Ht),sort:Le,fields:"*:excerpt(200)",skipTotal:1,expand:z(),requestKey:g+"loadList"});t(8,O=V.filterDuplicatesByKey(O.concat(ot.items))),L=ot.page,t(23,I=ot.items.length),t(3,A=!1)}catch(ct){ct.isAbort||(_e.error(ct),t(3,A=!1))}}}function J(Ce){i==1?t(6,E=[Ce]):u&&(V.pushOrReplaceByKey(E,Ce),t(6,E))}function Y(Ce){V.removeByKey(E,"id",Ce.id),t(6,E)}function Z(Ce){f(Ce)?Y(Ce):J(Ce)}function G(){var Ce;i!=1?t(20,_=E.map(ct=>ct.id)):t(20,_=((Ce=E==null?void 0:E[0])==null?void 0:Ce.id)||""),h("save",E),R()}function pe(Ce){Pe.call(this,n,Ce)}const ce=()=>R(),ue=()=>G(),Te=Ce=>t(2,T=Ce.detail),Ke=()=>$==null?void 0:$.show(),Je=Ce=>$==null?void 0:$.show(Ce.id),ft=Ce=>Z(Ce),et=(Ce,ct)=>{(ct.code==="Enter"||ct.code==="Space")&&(ct.preventDefault(),ct.stopPropagation(),Z(Ce))},xe=()=>t(2,T=""),We=()=>{a&&!A&&U()},at=Ce=>Y(Ce);function jt(Ce){E=Ce,t(6,E)}function Ve(Ce){ie[Ce?"unshift":"push"](()=>{S=Ce,t(1,S)})}function Ee(Ce){Pe.call(this,n,Ce)}function st(Ce){Pe.call(this,n,Ce)}function De(Ce){ie[Ce?"unshift":"push"](()=>{$=Ce,t(7,$)})}const Ye=Ce=>{V.removeByKey(O,"id",Ce.detail.record.id),O.unshift(Ce.detail.record),t(8,O),J(Ce.detail.record)},ve=Ce=>{V.removeByKey(O,"id",Ce.detail.id),t(8,O),Y(Ce.detail)};return n.$$set=Ce=>{e=je(je({},e),Wt(Ce)),t(19,d=lt(e,c)),"value"in Ce&&t(20,_=Ce.value),"field"in Ce&&t(21,k=Ce.field)},n.$$.update=()=>{n.$$.dirty[0]&2097152&&t(4,i=(k==null?void 0:k.maxSelect)||null),n.$$.dirty[0]&2097152&&t(25,l=k==null?void 0:k.collectionId),n.$$.dirty[0]&100663296&&t(5,s=m.find(Ce=>Ce.id==l)||null),n.$$.dirty[0]&6&&typeof T<"u"&&S!=null&&S.isActive()&&U(!0),n.$$.dirty[0]&32&&t(11,o=(s==null?void 0:s.type)==="view"),n.$$.dirty[0]&16777224&&t(13,r=A||P),n.$$.dirty[0]&8388608&&t(12,a=I==Go),n.$$.dirty[0]&80&&t(10,u=i<=0||i>E.length),n.$$.dirty[0]&64&&t(9,f=function(Ce){return V.findByKey(E,"id",Ce.id)})},[R,S,T,A,i,s,E,$,O,f,u,o,a,r,U,J,Y,Z,G,d,_,k,N,I,P,l,m,pe,ce,ue,Te,Ke,Je,ft,et,xe,We,at,jt,Ve,Ee,st,De,Ye,ve]}class sP extends Se{constructor(e){super(),we(this,e,lP,iP,ke,{value:20,field:21,show:22,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[22]}get hide(){return this.$$.ctx[0]}}function Cg(n,e,t){const i=n.slice();return i[22]=e[t],i[24]=t,i}function Og(n,e,t){const i=n.slice();return i[27]=e[t],i}function Mg(n){let e,t,i,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-line link-hint m-l-auto flex-order-10")},m(s,o){v(s,e,o),i||(l=Oe(t=qe.call(null,e,{position:"left",text:"The following relation ids were removed from the list because they are missing or invalid: "+n[6].join(", ")})),i=!0)},p(s,o){t&&It(t.update)&&o&64&&t.update.call(null,{position:"left",text:"The following relation ids were removed from the list because they are missing or invalid: "+s[6].join(", ")})},d(s){s&&y(e),i=!1,l()}}}function oP(n){let e,t=n[6].length&&Mg(n);return{c(){t&&t.c(),e=ye()},m(i,l){t&&t.m(i,l),v(i,e,l)},p(i,l){i[6].length?t?t.p(i,l):(t=Mg(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&y(e),t&&t.d(i)}}}function Eg(n){let e,t=n[5]&&Dg(n);return{c(){t&&t.c(),e=ye()},m(i,l){t&&t.m(i,l),v(i,e,l)},p(i,l){i[5]?t?t.p(i,l):(t=Dg(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&y(e),t&&t.d(i)}}}function Dg(n){let e,t=de(V.toArray(n[0]).slice(0,10)),i=[];for(let l=0;l ',p(e,"class","list-item")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function rP(n){let e,t,i,l,s,o,r,a,u,f;i=new Ur({props:{record:n[22]}});function c(){return n[11](n[22])}return{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),o=b("button"),o.innerHTML='',r=C(),p(t,"class","content"),p(o,"type","button"),p(o,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(s,"class","actions"),p(e,"class","list-item"),ee(e,"dragging",n[25]),ee(e,"dragover",n[26])},m(d,m){v(d,e,m),w(e,t),q(i,t,null),w(e,l),w(e,s),w(s,o),v(d,r,m),a=!0,u||(f=[Oe(qe.call(null,o,"Remove")),W(o,"click",c)],u=!0)},p(d,m){n=d;const h={};m&16&&(h.record=n[22]),i.$set(h),(!a||m&33554432)&&ee(e,"dragging",n[25]),(!a||m&67108864)&&ee(e,"dragover",n[26])},i(d){a||(M(i.$$.fragment,d),a=!0)},o(d){D(i.$$.fragment,d),a=!1},d(d){d&&(y(e),y(r)),H(i),u=!1,Ie(f)}}}function Lg(n,e){let t,i,l,s;function o(a){e[12](a)}let r={group:e[2].name+"_relation",index:e[24],disabled:!e[7],$$slots:{default:[rP,({dragging:a,dragover:u})=>({25:a,26:u}),({dragging:a,dragover:u})=>(a?33554432:0)|(u?67108864:0)]},$$scope:{ctx:e}};return e[4]!==void 0&&(r.list=e[4]),i=new _o({props:r}),ie.push(()=>be(i,"list",o)),i.$on("sort",e[13]),{key:n,first:null,c(){t=ye(),j(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),q(i,a,u),s=!0},p(a,u){e=a;const f={};u&4&&(f.group=e[2].name+"_relation"),u&16&&(f.index=e[24]),u&128&&(f.disabled=!e[7]),u&1174405136&&(f.$$scope={dirty:u,ctx:e}),!l&&u&16&&(l=!0,f.list=e[4],$e(()=>l=!1)),i.$set(f)},i(a){s||(M(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&y(t),H(i,a)}}}function aP(n){let e,t,i,l,s=[],o=new Map,r,a,u,f,c,d;e=new ii({props:{uniqueId:n[21],field:n[2],$$slots:{default:[oP]},$$scope:{ctx:n}}});let m=de(n[4]);const h=_=>_[22].id;for(let _=0;_ Open picker',p(l,"class","relations-list svelte-1ynw0pc"),p(u,"type","button"),p(u,"class","btn btn-transparent btn-sm btn-block"),p(a,"class","list-item list-item-btn"),p(i,"class","list")},m(_,k){q(e,_,k),v(_,t,k),v(_,i,k),w(i,l);for(let S=0;S({21:r}),({uniqueId:r})=>r?2097152:0]},$$scope:{ctx:n}};e=new fe({props:s}),n[15](e);let o={value:n[0],field:n[2]};return i=new sP({props:o}),n[16](i),i.$on("save",n[17]),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(r,a){q(e,r,a),v(r,t,a),q(i,r,a),l=!0},p(r,[a]){const u={};a&4&&(u.class="form-field form-field-list "+(r[2].required?"required":"")),a&4&&(u.name=r[2].name),a&1075839223&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a&1&&(f.value=r[0]),a&4&&(f.field=r[2]),i.$set(f)},i(r){l||(M(e.$$.fragment,r),M(i.$$.fragment,r),l=!0)},o(r){D(e.$$.fragment,r),D(i.$$.fragment,r),l=!1},d(r){r&&y(t),n[15](null),H(e,r),n[16](null),H(i,r)}}}const Ag=100;function fP(n,e,t){let i,l;Qe(n,Mn,I=>t(18,l=I));let{field:s}=e,{value:o}=e,{picker:r}=e,a,u=[],f=!1,c,d=[];function m(){if(f)return!1;const I=V.toArray(o);return t(4,u=u.filter(A=>I.includes(A.id))),I.length!=u.length}async function h(){var z,F;const I=V.toArray(o);if(t(4,u=[]),t(6,d=[]),!(s!=null&&s.collectionId)||!I.length){t(5,f=!1);return}t(5,f=!0);let A="";const P=(F=(z=l.find(U=>U.id==s.collectionId))==null?void 0:z.fields)==null?void 0:F.filter(U=>!U.hidden&&U.presentable&&U.type=="relation");for(const U of P){const J=V.getExpandPresentableRelField(U,l,2);J&&(A!=""&&(A+=","),A+=J)}const N=I.slice(),R=[];for(;N.length>0;){const U=[];for(const J of N.splice(0,Ag))U.push(`id="${J}"`);R.push(_e.collection(s.collectionId).getFullList(Ag,{filter:U.join("||"),fields:"*:excerpt(200)",expand:A,requestKey:null}))}try{let U=[];await Promise.all(R).then(J=>{U=U.concat(...J)});for(const J of I){const Y=V.findByKey(U,"id",J);Y?u.push(Y):d.push(J)}t(4,u),_()}catch(U){_e.error(U)}t(5,f=!1)}function g(I){V.removeByKey(u,"id",I.id),t(4,u),_()}function _(){var I;i?t(0,o=u.map(A=>A.id)):t(0,o=((I=u[0])==null?void 0:I.id)||"")}oo(()=>{clearTimeout(c)});const k=I=>g(I);function S(I){u=I,t(4,u)}const $=()=>{_()},T=()=>r==null?void 0:r.show();function O(I){ie[I?"unshift":"push"](()=>{a=I,t(3,a)})}function E(I){ie[I?"unshift":"push"](()=>{r=I,t(1,r)})}const L=I=>{var A;t(4,u=I.detail||[]),t(0,o=i?u.map(P=>P.id):((A=u[0])==null?void 0:A.id)||"")};return n.$$set=I=>{"field"in I&&t(2,s=I.field),"value"in I&&t(0,o=I.value),"picker"in I&&t(1,r=I.picker)},n.$$.update=()=>{n.$$.dirty&4&&t(7,i=s.maxSelect>1),n.$$.dirty&9&&typeof o<"u"&&(a==null||a.changed()),n.$$.dirty&1041&&m()&&(t(5,f=!0),clearTimeout(c),t(10,c=setTimeout(h,0)))},[o,r,s,a,u,f,d,i,g,_,c,k,S,$,T,O,E,L]}class cP extends Se{constructor(e){super(),we(this,e,fP,uP,ke,{field:2,value:0,picker:1})}}function Pg(n){let e,t,i,l;return{c(){e=b("div"),t=B("Select up to "),i=B(n[2]),l=B(" items."),p(e,"class","help-block")},m(s,o){v(s,e,o),w(e,t),w(e,i),w(e,l)},p(s,o){o&4&&oe(i,s[2])},d(s){s&&y(e)}}}function dP(n){var c,d;let e,t,i,l,s,o,r;e=new ii({props:{uniqueId:n[5],field:n[1]}});function a(m){n[4](m)}let u={id:n[5],toggle:!n[1].required||n[3],multiple:n[3],closable:!n[3]||((c=n[0])==null?void 0:c.length)>=n[1].maxSelect,items:n[1].values,searchable:((d=n[1].values)==null?void 0:d.length)>5};n[0]!==void 0&&(u.selected=n[0]),i=new ps({props:u}),ie.push(()=>be(i,"selected",a));let f=n[3]&&Pg(n);return{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment),s=C(),f&&f.c(),o=ye()},m(m,h){q(e,m,h),v(m,t,h),q(i,m,h),v(m,s,h),f&&f.m(m,h),v(m,o,h),r=!0},p(m,h){var k,S;const g={};h&32&&(g.uniqueId=m[5]),h&2&&(g.field=m[1]),e.$set(g);const _={};h&32&&(_.id=m[5]),h&10&&(_.toggle=!m[1].required||m[3]),h&8&&(_.multiple=m[3]),h&11&&(_.closable=!m[3]||((k=m[0])==null?void 0:k.length)>=m[1].maxSelect),h&2&&(_.items=m[1].values),h&2&&(_.searchable=((S=m[1].values)==null?void 0:S.length)>5),!l&&h&1&&(l=!0,_.selected=m[0],$e(()=>l=!1)),i.$set(_),m[3]?f?f.p(m,h):(f=Pg(m),f.c(),f.m(o.parentNode,o)):f&&(f.d(1),f=null)},i(m){r||(M(e.$$.fragment,m),M(i.$$.fragment,m),r=!0)},o(m){D(e.$$.fragment,m),D(i.$$.fragment,m),r=!1},d(m){m&&(y(t),y(s),y(o)),H(e,m),H(i,m),f&&f.d(m)}}}function pP(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[dP,({uniqueId:i})=>({5:i}),({uniqueId:i})=>i?32:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&111&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function mP(n,e,t){let i,l,{field:s}=e,{value:o=void 0}=e;function r(a){o=a,t(0,o),t(3,i),t(1,s),t(2,l)}return n.$$set=a=>{"field"in a&&t(1,s=a.field),"value"in a&&t(0,o=a.value)},n.$$.update=()=>{n.$$.dirty&2&&t(3,i=s.maxSelect>1),n.$$.dirty&9&&typeof o>"u"&&t(0,o=i?[]:""),n.$$.dirty&2&&t(2,l=s.maxSelect||s.values.length),n.$$.dirty&15&&i&&Array.isArray(o)&&(t(0,o=o.filter(a=>s.values.includes(a))),o.length>l&&t(0,o=o.slice(o.length-l)))},[o,s,l,i,r]}class hP extends Se{constructor(e){super(),we(this,e,mP,pP,ke,{field:1,value:0})}}function _P(n){let e,t,i,l=[n[3]],s={};for(let o=0;o{r&&(t(1,r.style.height="",r),t(1,r.style.height=Math.min(r.scrollHeight,o)+"px",r))},0)}function f(m){if((m==null?void 0:m.code)==="Enter"&&!(m!=null&&m.shiftKey)&&!(m!=null&&m.isComposing)){m.preventDefault();const h=r.closest("form");h!=null&&h.requestSubmit&&h.requestSubmit()}}Xt(()=>(u(),()=>clearTimeout(a)));function c(m){ie[m?"unshift":"push"](()=>{r=m,t(1,r)})}function d(){s=this.value,t(0,s)}return n.$$set=m=>{e=je(je({},e),Wt(m)),t(3,l=lt(e,i)),"value"in m&&t(0,s=m.value),"maxHeight"in m&&t(4,o=m.maxHeight)},n.$$.update=()=>{n.$$.dirty&1&&typeof s!==void 0&&u()},[s,r,f,l,o,c,d]}class bP extends Se{constructor(e){super(),we(this,e,gP,_P,ke,{value:0,maxHeight:4})}}function kP(n){let e,t,i,l,s;e=new ii({props:{uniqueId:n[6],field:n[1]}});function o(a){n[5](a)}let r={id:n[6],required:n[3],placeholder:n[2]?"Leave empty to autogenerate...":""};return n[0]!==void 0&&(r.value=n[0]),i=new bP({props:r}),ie.push(()=>be(i,"value",o)),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(a,u){q(e,a,u),v(a,t,u),q(i,a,u),s=!0},p(a,u){const f={};u&64&&(f.uniqueId=a[6]),u&2&&(f.field=a[1]),e.$set(f);const c={};u&64&&(c.id=a[6]),u&8&&(c.required=a[3]),u&4&&(c.placeholder=a[2]?"Leave empty to autogenerate...":""),!l&&u&1&&(l=!0,c.value=a[0],$e(()=>l=!1)),i.$set(c)},i(a){s||(M(e.$$.fragment,a),M(i.$$.fragment,a),s=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),s=!1},d(a){a&&y(t),H(e,a),H(i,a)}}}function yP(n){let e,t;return e=new fe({props:{class:"form-field "+(n[3]?"required":""),name:n[1].name,$$slots:{default:[kP,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&8&&(s.class="form-field "+(i[3]?"required":"")),l&2&&(s.name=i[1].name),l&207&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function vP(n,e,t){let i,l,{original:s}=e,{field:o}=e,{value:r=void 0}=e;function a(u){r=u,t(0,r)}return n.$$set=u=>{"original"in u&&t(4,s=u.original),"field"in u&&t(1,o=u.field),"value"in u&&t(0,r=u.value)},n.$$.update=()=>{n.$$.dirty&18&&t(2,i=!V.isEmpty(o.autogeneratePattern)&&!(s!=null&&s.id)),n.$$.dirty&6&&t(3,l=o.required&&!i)},[r,o,i,l,s,a]}class wP extends Se{constructor(e){super(),we(this,e,vP,yP,ke,{original:4,field:1,value:0})}}function SP(n){let e,t,i,l,s,o,r,a;return e=new ii({props:{uniqueId:n[3],field:n[1]}}),{c(){j(e.$$.fragment),t=C(),i=b("input"),p(i,"type","url"),p(i,"id",l=n[3]),i.required=s=n[1].required},m(u,f){q(e,u,f),v(u,t,f),v(u,i,f),he(i,n[0]),o=!0,r||(a=W(i,"input",n[2]),r=!0)},p(u,f){const c={};f&8&&(c.uniqueId=u[3]),f&2&&(c.field=u[1]),e.$set(c),(!o||f&8&&l!==(l=u[3]))&&p(i,"id",l),(!o||f&2&&s!==(s=u[1].required))&&(i.required=s),f&1&&i.value!==u[0]&&he(i,u[0])},i(u){o||(M(e.$$.fragment,u),o=!0)},o(u){D(e.$$.fragment,u),o=!1},d(u){u&&(y(t),y(i)),H(e,u),r=!1,a()}}}function TP(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[SP,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function $P(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=this.value,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class CP extends Se{constructor(e){super(),we(this,e,$P,TP,ke,{field:1,value:0})}}function Ng(n,e,t){const i=n.slice();return i[6]=e[t],i}function Rg(n,e,t){const i=n.slice();return i[6]=e[t],i}function Fg(n,e){let t,i,l=e[6].title+"",s,o,r,a;function u(){return e[5](e[6])}return{key:n,first:null,c(){t=b("button"),i=b("div"),s=B(l),o=C(),p(i,"class","txt"),p(t,"class","tab-item svelte-1maocj6"),ee(t,"active",e[1]===e[6].language),this.first=t},m(f,c){v(f,t,c),w(t,i),w(i,s),w(t,o),r||(a=W(t,"click",u),r=!0)},p(f,c){e=f,c&4&&l!==(l=e[6].title+"")&&oe(s,l),c&6&&ee(t,"active",e[1]===e[6].language)},d(f){f&&y(t),r=!1,a()}}}function qg(n,e){let t,i,l,s,o,r,a=e[6].title+"",u,f,c,d,m;return i=new xu({props:{language:e[6].language,content:e[6].content}}),{key:n,first:null,c(){t=b("div"),j(i.$$.fragment),l=C(),s=b("div"),o=b("em"),r=b("a"),u=B(a),f=B(" SDK"),d=C(),p(r,"href",c=e[6].url),p(r,"target","_blank"),p(r,"rel","noopener noreferrer"),p(o,"class","txt-sm txt-hint"),p(s,"class","txt-right"),p(t,"class","tab-item svelte-1maocj6"),ee(t,"active",e[1]===e[6].language),this.first=t},m(h,g){v(h,t,g),q(i,t,null),w(t,l),w(t,s),w(s,o),w(o,r),w(r,u),w(r,f),w(t,d),m=!0},p(h,g){e=h;const _={};g&4&&(_.language=e[6].language),g&4&&(_.content=e[6].content),i.$set(_),(!m||g&4)&&a!==(a=e[6].title+"")&&oe(u,a),(!m||g&4&&c!==(c=e[6].url))&&p(r,"href",c),(!m||g&6)&&ee(t,"active",e[1]===e[6].language)},i(h){m||(M(i.$$.fragment,h),m=!0)},o(h){D(i.$$.fragment,h),m=!1},d(h){h&&y(t),H(i)}}}function OP(n){let e,t,i=[],l=new Map,s,o,r=[],a=new Map,u,f,c=de(n[2]);const d=g=>g[6].language;for(let g=0;gg[6].language;for(let g=0;gt(1,r=u.language);return n.$$set=u=>{"class"in u&&t(0,l=u.class),"js"in u&&t(3,s=u.js),"dart"in u&&t(4,o=u.dart)},n.$$.update=()=>{n.$$.dirty&2&&r&&localStorage.setItem(Hg,r),n.$$.dirty&24&&t(2,i=[{title:"JavaScript",language:"javascript",content:s,url:"https://github.com/pocketbase/js-sdk"},{title:"Dart",language:"dart",content:o,url:"https://github.com/pocketbase/dart-sdk"}])},[l,r,i,s,o,a]}class EP extends Se{constructor(e){super(),we(this,e,MP,OP,ke,{class:0,js:3,dart:4})}}function DP(n){let e,t,i,l,s,o=V.displayValue(n[1])+"",r,a,u,f,c,d,m;return f=new fe({props:{class:"form-field m-b-xs m-t-sm",name:"duration",$$slots:{default:[LP,({uniqueId:h})=>({20:h}),({uniqueId:h})=>h?1048576:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),i=b("p"),l=B(`Generate a non-refreshable auth token for `),s=b("strong"),r=B(o),a=B(":"),u=C(),j(f.$$.fragment),p(t,"class","content"),p(e,"id",n[8])},m(h,g){v(h,e,g),w(e,t),w(t,i),w(i,l),w(i,s),w(s,r),w(s,a),w(e,u),q(f,e,null),c=!0,d||(m=W(e,"submit",nt(n[9])),d=!0)},p(h,g){(!c||g&2)&&o!==(o=V.displayValue(h[1])+"")&&oe(r,o);const _={};g&3145761&&(_.$$scope={dirty:g,ctx:h}),f.$set(_)},i(h){c||(M(f.$$.fragment,h),c=!0)},o(h){D(f.$$.fragment,h),c=!1},d(h){h&&y(e),H(f),d=!1,m()}}}function IP(n){let e,t,i,l=n[3].authStore.token+"",s,o,r,a,u,f;return r=new $i({props:{value:n[3].authStore.token}}),u=new EP({props:{class:"m-b-0",js:` import PocketBase from 'pocketbase'; @@ -220,4 +220,4 @@ Do you really want to upload "${m.name}"?`,()=>{u(m)},()=>{r()})}async function `),$=b("a"),$.textContent=`s5cmd `,T=B(", etc."),O=C(),E=b("div"),p(i,"class","icon"),p(k,"href","https://github.com/rclone/rclone"),p(k,"target","_blank"),p(k,"rel","noopener noreferrer"),p(k,"class","txt-bold"),p($,"href","https://github.com/peak/s5cmd"),p($,"target","_blank"),p($,"rel","noopener noreferrer"),p($,"class","txt-bold"),p(s,"class","content"),p(t,"class","alert alert-warning m-0"),p(E,"class","clearfix m-t-base")},m(P,N){v(P,e,N),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),w(s,r),w(r,u),w(s,f),w(s,c),w(c,m),w(s,h),w(s,g),w(s,_),w(s,k),w(s,S),w(s,$),w(s,T),w(e,O),w(e,E),I=!0},p(P,N){var R;(!I||N&1)&&a!==(a=(R=P[0].s3)!=null&&R.enabled?"S3 storage":"local file system")&&oe(u,a),(!I||N&2)&&d!==(d=P[1].s3.enabled?"S3 storage":"local file system")&&oe(m,d)},i(P){I||(P&&tt(()=>{I&&(L||(L=He(e,mt,{duration:150},!0)),L.run(1))}),I=!0)},o(P){P&&(L||(L=He(e,mt,{duration:150},!1)),L.run(0)),I=!1},d(P){P&&y(e),P&&L&&L.end()}}}function EF(n){var i;let e,t=((i=n[0].s3)==null?void 0:i.enabled)!=n[1].s3.enabled&&Pb(n);return{c(){t&&t.c(),e=ye()},m(l,s){t&&t.m(l,s),v(l,e,s)},p(l,s){var o;((o=l[0].s3)==null?void 0:o.enabled)!=l[1].s3.enabled?t?(t.p(l,s),s&3&&M(t,1)):(t=Pb(l),t.c(),M(t,1),t.m(e.parentNode,e)):t&&(re(),D(t,1,1,()=>{t=null}),ae())},d(l){l&&y(e),t&&t.d(l)}}}function Nb(n){let e;function t(s,o){return s[4]?LF:s[5]?IF:DF}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),v(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&y(e),l.d(s)}}}function DF(n){let e;return{c(){e=b("div"),e.innerHTML=' S3 connected successfully',p(e,"class","label label-sm label-success entrance-right")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function IF(n){let e,t,i,l;return{c(){e=b("div"),e.innerHTML=' Failed to establish S3 connection',p(e,"class","label label-sm label-warning entrance-right")},m(s,o){var r;v(s,e,o),i||(l=Oe(t=qe.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&It(t.update)&&o&32&&t.update.call(null,(r=s[5].data)==null?void 0:r.message)},d(s){s&&y(e),i=!1,l()}}}function LF(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function Rb(n){let e,t,i,l;return{c(){e=b("button"),t=b("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(s,o){v(s,e,o),w(e,t),i||(l=W(e,"click",n[14]),i=!0)},p(s,o){o&8&&(e.disabled=s[3])},d(s){s&&y(e),i=!1,l()}}}function AF(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_;const k=[MF,OF],S=[];function $(T,O){return T[2]?0:1}return d=$(n),m=S[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=C(),s=b("div"),o=B(n[7]),r=C(),a=b("div"),u=b("form"),f=b("div"),f.innerHTML="

    By default PocketBase uses the local file system to store uploaded files.

    If you have limited disk space, you could optionally connect to an S3 compatible storage.

    ",c=C(),m.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(T,O){v(T,e,O),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),v(T,r,O),v(T,a,O),w(a,u),w(u,f),w(u,c),S[d].m(u,null),h=!0,g||(_=W(u,"submit",nt(n[16])),g=!0)},p(T,O){(!h||O&128)&&oe(o,T[7]);let E=d;d=$(T),d===E?S[d].p(T,O):(re(),D(S[E],1,1,()=>{S[E]=null}),ae(),m=S[d],m?m.p(T,O):(m=S[d]=k[d](T),m.c()),M(m,1),m.m(u,null))},i(T){h||(M(m),h=!0)},o(T){D(m),h=!1},d(T){T&&(y(e),y(r),y(a)),S[d].d(),g=!1,_()}}}function PF(n){let e,t,i,l;return e=new hs({}),i=new pi({props:{$$slots:{default:[AF]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=C(),j(i.$$.fragment)},m(s,o){q(e,s,o),v(s,t,o),q(i,s,o),l=!0},p(s,[o]){const r={};o&524543&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(M(e.$$.fragment,s),M(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&y(t),H(e,s),H(i,s)}}}const NF="s3_test_request";function RF(n,e,t){let i,l,s;Qe(n,un,E=>t(7,s=E)),Rn(un,s="Files storage",s);let o={},r={},a=!1,u=!1,f=!1,c=null;d();async function d(){t(2,a=!0);try{const E=await _e.settings.getAll()||{};h(E)}catch(E){_e.error(E)}t(2,a=!1)}async function m(){if(!(u||!l)){t(3,u=!0);try{_e.cancelRequest(NF);const E=await _e.settings.update(V.filterRedactedProps(r));Ut({}),await h(E),Ls(),c?yw("Successfully saved but failed to establish S3 connection."):nn("Successfully saved files storage settings.")}catch(E){_e.error(E)}t(3,u=!1)}}async function h(E={}){t(1,r={s3:(E==null?void 0:E.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r)))}async function g(){t(1,r=JSON.parse(JSON.stringify(o||{})))}function _(E){n.$$.not_equal(r.s3,E)&&(r.s3=E,t(1,r))}function k(E){f=E,t(4,f)}function S(E){c=E,t(5,c)}const $=()=>g(),T=()=>m(),O=()=>m();return n.$$.update=()=>{n.$$.dirty&1&&t(10,i=JSON.stringify(o)),n.$$.dirty&1026&&t(6,l=i!=JSON.stringify(r))},[o,r,a,u,f,c,l,s,m,g,i,_,k,S,$,T,O]}class FF extends Se{constructor(e){super(),we(this,e,RF,PF,ke,{})}}function Fb(n){let e,t,i;return{c(){e=b("div"),e.innerHTML='',t=C(),i=b("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(l,s){v(l,e,s),v(l,t,s),v(l,i,s)},d(l){l&&(y(e),y(t),y(i))}}}function qF(n){let e,t,i,l=!n[0]&&Fb();const s=n[1].default,o=Lt(s,n,n[2],null);return{c(){e=b("div"),l&&l.c(),t=C(),o&&o.c(),p(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){v(r,e,a),l&&l.m(e,null),w(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?l&&(l.d(1),l=null):l||(l=Fb(),l.c(),l.m(e,t)),o&&o.p&&(!i||a&4)&&Pt(o,s,r,r[2],i?At(s,r[2],a,null):Nt(r[2]),null)},i(r){i||(M(o,r),i=!0)},o(r){D(o,r),i=!1},d(r){r&&y(e),l&&l.d(),o&&o.d(r)}}}function HF(n){let e,t;return e=new pi({props:{class:"full-page",center:!0,$$slots:{default:[qF]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&5&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function jF(n,e,t){let{$$slots:i={},$$scope:l}=e,{nobranding:s=!1}=e;return n.$$set=o=>{"nobranding"in o&&t(0,s=o.nobranding),"$$scope"in o&&t(2,l=o.$$scope)},[s,i,l]}class zF extends Se{constructor(e){super(),we(this,e,jF,HF,ke,{nobranding:0})}}function qb(n){let e,t,i,l,s;return{c(){e=B("("),t=B(n[1]),i=B("/"),l=B(n[2]),s=B(")")},m(o,r){v(o,e,r),v(o,t,r),v(o,i,r),v(o,l,r),v(o,s,r)},p(o,r){r&2&&oe(t,o[1]),r&4&&oe(l,o[2])},d(o){o&&(y(e),y(t),y(i),y(l),y(s))}}}function UF(n){let e,t,i,l;const s=[YF,WF],o=[];function r(a,u){return a[4]?1:0}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),v(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),D(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&y(i),o[e].d(a)}}}function VF(n){let e,t,i,l,s,o,r,a=n[2]>1?"Next":"Login",u,f,c,d,m,h;return t=new fe({props:{class:"form-field required",name:"identity",$$slots:{default:[GF,({uniqueId:g})=>({26:g}),({uniqueId:g})=>g?67108864:0]},$$scope:{ctx:n}}}),l=new fe({props:{class:"form-field required",name:"password",$$slots:{default:[XF,({uniqueId:g})=>({26:g}),({uniqueId:g})=>g?67108864:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),j(t.$$.fragment),i=C(),j(l.$$.fragment),s=C(),o=b("button"),r=b("span"),u=B(a),f=C(),c=b("i"),p(r,"class","txt"),p(c,"class","ri-arrow-right-line"),p(o,"type","submit"),p(o,"class","btn btn-lg btn-block btn-next"),ee(o,"btn-disabled",n[7]),ee(o,"btn-loading",n[7]),p(e,"class","block")},m(g,_){v(g,e,_),q(t,e,null),w(e,i),q(l,e,null),w(e,s),w(e,o),w(o,r),w(r,u),w(o,f),w(o,c),d=!0,m||(h=W(e,"submit",nt(n[14])),m=!0)},p(g,_){const k={};_&201326625&&(k.$$scope={dirty:_,ctx:g}),t.$set(k);const S={};_&201326656&&(S.$$scope={dirty:_,ctx:g}),l.$set(S),(!d||_&4)&&a!==(a=g[2]>1?"Next":"Login")&&oe(u,a),(!d||_&128)&&ee(o,"btn-disabled",g[7]),(!d||_&128)&&ee(o,"btn-loading",g[7])},i(g){d||(M(t.$$.fragment,g),M(l.$$.fragment,g),d=!0)},o(g){D(t.$$.fragment,g),D(l.$$.fragment,g),d=!1},d(g){g&&y(e),H(t),H(l),m=!1,h()}}}function BF(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","block txt-center")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function WF(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g=n[12]&&Hb(n);return i=new fe({props:{class:"form-field required",name:"otpId",$$slots:{default:[KF,({uniqueId:_})=>({26:_}),({uniqueId:_})=>_?67108864:0]},$$scope:{ctx:n}}}),s=new fe({props:{class:"form-field required",name:"password",$$slots:{default:[JF,({uniqueId:_})=>({26:_}),({uniqueId:_})=>_?67108864:0]},$$scope:{ctx:n}}}),{c(){g&&g.c(),e=C(),t=b("form"),j(i.$$.fragment),l=C(),j(s.$$.fragment),o=C(),r=b("button"),r.innerHTML='Login ',a=C(),u=b("div"),f=b("button"),c=B("Request another OTP"),p(r,"type","submit"),p(r,"class","btn btn-lg btn-block btn-next"),ee(r,"btn-disabled",n[9]),ee(r,"btn-loading",n[9]),p(t,"class","block"),p(f,"type","button"),p(f,"class","link-hint"),f.disabled=n[9],p(u,"class","content txt-center m-t-sm")},m(_,k){g&&g.m(_,k),v(_,e,k),v(_,t,k),q(i,t,null),w(t,l),q(s,t,null),w(t,o),w(t,r),v(_,a,k),v(_,u,k),w(u,f),w(f,c),d=!0,m||(h=[W(t,"submit",nt(n[16])),W(f,"click",n[22])],m=!0)},p(_,k){_[12]?g?g.p(_,k):(g=Hb(_),g.c(),g.m(e.parentNode,e)):g&&(g.d(1),g=null);const S={};k&201328656&&(S.$$scope={dirty:k,ctx:_}),i.$set(S);const $={};k&201334784&&($.$$scope={dirty:k,ctx:_}),s.$set($),(!d||k&512)&&ee(r,"btn-disabled",_[9]),(!d||k&512)&&ee(r,"btn-loading",_[9]),(!d||k&512)&&(f.disabled=_[9])},i(_){d||(M(i.$$.fragment,_),M(s.$$.fragment,_),d=!0)},o(_){D(i.$$.fragment,_),D(s.$$.fragment,_),d=!1},d(_){_&&(y(e),y(t),y(a),y(u)),g&&g.d(_),H(i),H(s),m=!1,Ie(h)}}}function YF(n){let e,t,i,l,s,o,r;return t=new fe({props:{class:"form-field required",name:"email",$$slots:{default:[ZF,({uniqueId:a})=>({26:a}),({uniqueId:a})=>a?67108864:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),j(t.$$.fragment),i=C(),l=b("button"),l.innerHTML=' Send OTP',p(l,"type","submit"),p(l,"class","btn btn-lg btn-block btn-next"),ee(l,"btn-disabled",n[8]),ee(l,"btn-loading",n[8]),p(e,"class","block")},m(a,u){v(a,e,u),q(t,e,null),w(e,i),w(e,l),s=!0,o||(r=W(e,"submit",nt(n[15])),o=!0)},p(a,u){const f={};u&201330688&&(f.$$scope={dirty:u,ctx:a}),t.$set(f),(!s||u&256)&&ee(l,"btn-disabled",a[8]),(!s||u&256)&&ee(l,"btn-loading",a[8])},i(a){s||(M(t.$$.fragment,a),s=!0)},o(a){D(t.$$.fragment,a),s=!1},d(a){a&&y(e),H(t),o=!1,r()}}}function Hb(n){let e,t,i,l,s,o;return{c(){e=b("div"),t=b("p"),i=B("Check your "),l=b("strong"),s=B(n[12]),o=B(` inbox and enter in the input below the received One-time password (OTP).`),p(e,"class","content txt-center m-b-sm")},m(r,a){v(r,e,a),w(e,t),w(t,i),w(t,l),w(l,s),w(t,o)},p(r,a){a&4096&&oe(s,r[12])},d(r){r&&y(e)}}}function KF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Id"),l=C(),s=b("input"),p(e,"for",i=n[26]),p(s,"type","text"),p(s,"id",o=n[26]),s.value=n[4],p(s,"placeholder",n[11]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),r||(a=W(s,"change",n[20]),r=!0)},p(u,f){f&67108864&&i!==(i=u[26])&&p(e,"for",i),f&67108864&&o!==(o=u[26])&&p(s,"id",o),f&16&&s.value!==u[4]&&(s.value=u[4]),f&2048&&p(s,"placeholder",u[11])},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function JF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("One-time password"),l=C(),s=b("input"),p(e,"for",i=n[26]),p(s,"type","password"),p(s,"id",o=n[26]),s.required=!0,s.autofocus=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[13]),s.focus(),r||(a=W(s,"input",n[21]),r=!0)},p(u,f){f&67108864&&i!==(i=u[26])&&p(e,"for",i),f&67108864&&o!==(o=u[26])&&p(s,"id",o),f&8192&&s.value!==u[13]&&he(s,u[13])},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function ZF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=B("Email"),l=C(),s=b("input"),p(e,"for",i=n[26]),p(s,"type","email"),p(s,"id",o=n[26]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[12]),r||(a=W(s,"input",n[19]),r=!0)},p(u,f){f&67108864&&i!==(i=u[26])&&p(e,"for",i),f&67108864&&o!==(o=u[26])&&p(s,"id",o),f&4096&&s.value!==u[12]&&he(s,u[12])},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function GF(n){let e,t=V.sentenize(n[0].password.identityFields.join(" or "),!1)+"",i,l,s,o,r,a,u,f;return{c(){e=b("label"),i=B(t),s=C(),o=b("input"),p(e,"for",l=n[26]),p(o,"id",r=n[26]),p(o,"type",a=n[0].password.identityFields.length==1&&n[0].password.identityFields[0]=="email"?"email":"text"),o.value=n[5],o.required=!0,o.autofocus=!0},m(c,d){v(c,e,d),w(e,i),v(c,s,d),v(c,o,d),o.focus(),u||(f=W(o,"input",n[17]),u=!0)},p(c,d){d&1&&t!==(t=V.sentenize(c[0].password.identityFields.join(" or "),!1)+"")&&oe(i,t),d&67108864&&l!==(l=c[26])&&p(e,"for",l),d&67108864&&r!==(r=c[26])&&p(o,"id",r),d&1&&a!==(a=c[0].password.identityFields.length==1&&c[0].password.identityFields[0]=="email"?"email":"text")&&p(o,"type",a),d&32&&o.value!==c[5]&&(o.value=c[5])},d(c){c&&(y(e),y(s),y(o)),u=!1,f()}}}function XF(n){let e,t,i,l,s,o,r,a,u,f,c;return{c(){e=b("label"),t=B("Password"),l=C(),s=b("input"),r=C(),a=b("div"),u=b("a"),u.textContent="Forgotten password?",p(e,"for",i=n[26]),p(s,"type","password"),p(s,"id",o=n[26]),s.required=!0,p(u,"href","/request-password-reset"),p(u,"class","link-hint"),p(a,"class","help-block")},m(d,m){v(d,e,m),w(e,t),v(d,l,m),v(d,s,m),he(s,n[6]),v(d,r,m),v(d,a,m),w(a,u),f||(c=[W(s,"input",n[18]),Oe(Bn.call(null,u))],f=!0)},p(d,m){m&67108864&&i!==(i=d[26])&&p(e,"for",i),m&67108864&&o!==(o=d[26])&&p(s,"id",o),m&64&&s.value!==d[6]&&he(s,d[6])},d(d){d&&(y(e),y(l),y(s),y(r),y(a)),f=!1,Ie(c)}}}function QF(n){let e,t,i,l,s,o,r,a,u=n[2]>1&&qb(n);const f=[BF,VF,UF],c=[];function d(m,h){return m[10]?0:m[0].password.enabled&&!m[3]?1:m[0].otp.enabled?2:-1}return~(s=d(n))&&(o=c[s]=f[s](n)),{c(){e=b("div"),t=b("h4"),i=B(`Superuser login - `),u&&u.c(),l=C(),o&&o.c(),r=ye(),p(e,"class","content txt-center m-b-base")},m(m,h){v(m,e,h),w(e,t),w(t,i),u&&u.m(t,null),v(m,l,h),~s&&c[s].m(m,h),v(m,r,h),a=!0},p(m,h){m[2]>1?u?u.p(m,h):(u=qb(m),u.c(),u.m(t,null)):u&&(u.d(1),u=null);let g=s;s=d(m),s===g?~s&&c[s].p(m,h):(o&&(re(),D(c[g],1,1,()=>{c[g]=null}),ae()),~s?(o=c[s],o?o.p(m,h):(o=c[s]=f[s](m),o.c()),M(o,1),o.m(r.parentNode,r)):o=null)},i(m){a||(M(o),a=!0)},o(m){D(o),a=!1},d(m){m&&(y(e),y(l),y(r)),u&&u.d(),~s&&c[s].d(m)}}}function xF(n){let e,t;return e=new zF({props:{$$slots:{default:[QF]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&134234111&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function eq(n,e,t){let i;Qe(n,Au,z=>t(23,i=z));const l=new URLSearchParams(i);let s=l.get("demoEmail")||"",o=l.get("demoPassword")||"",r={},a=1,u=1,f=!1,c=!1,d=!1,m=!1,h="",g="",_="",k="",S="";$();async function $(){if(!m){t(10,m=!0);try{t(0,r=await _e.collection("_superusers").listAuthMethods())}catch(z){_e.error(z)}t(10,m=!1)}}async function T(){var z,F;if(!f){t(7,f=!0);try{await _e.collection("_superusers").authWithPassword(s,o),Ls(),Ut({}),is("/")}catch(U){U.status==401?(t(3,h=U.response.mfaId),((F=(z=r==null?void 0:r.password)==null?void 0:z.identityFields)==null?void 0:F.length)==1&&r.password.identityFields[0]=="email"?(t(12,k=s),await O()):/^[^@\s]+@[^@\s]+$/.test(s)&&t(12,k=s)):U.status!=400?_e.error(U):Ci("Invalid login credentials.")}t(7,f=!1)}}async function O(){if(!c){t(8,c=!0);try{const z=await _e.collection("_superusers").requestOTP(k);t(4,g=z.otpId),t(11,_=g),Ls(),Ut({})}catch(z){z.status==429&&t(4,g=_),_e.error(z)}t(8,c=!1)}}async function E(){if(!d){t(9,d=!0);try{await _e.collection("_superusers").authWithOTP(g||_,S,{mfaId:h}),Ls(),Ut({}),is("/")}catch(z){_e.error(z)}t(9,d=!1)}}const L=z=>{t(5,s=z.target.value)};function I(){o=this.value,t(6,o)}function A(){k=this.value,t(12,k)}const P=z=>{t(4,g=z.target.value||_),z.target.value=g};function N(){S=this.value,t(13,S)}const R=()=>{t(4,g="")};return n.$$.update=()=>{var z,F;n.$$.dirty&31&&(t(2,u=1),t(1,a=1),(z=r==null?void 0:r.mfa)!=null&&z.enabled&&t(2,u++,u),(F=r==null?void 0:r.otp)!=null&&F.enabled&&t(2,u++,u),h!=""&&t(1,a++,a),g!=""&&t(1,a++,a))},[r,a,u,h,g,s,o,f,c,d,m,_,k,S,T,O,E,L,I,A,P,N,R]}class tq extends Se{constructor(e){super(),we(this,e,eq,xF,ke,{})}}function Zt(n){if(!n)throw Error("Parameter args is required");if(!n.component==!n.asyncComponent)throw Error("One and only one of component and asyncComponent is required");if(n.component&&(n.asyncComponent=()=>Promise.resolve(n.component)),typeof n.asyncComponent!="function")throw Error("Parameter asyncComponent must be a function");if(n.conditions){Array.isArray(n.conditions)||(n.conditions=[n.conditions]);for(let t=0;tTt(()=>import("./PageInstaller-5hIJ_v1g.js"),[],import.meta.url),conditions:[n=>n.params.token&&!Fr(n.params.token)],userData:{showAppSidebar:!1}}),"/login":Zt({component:tq,conditions:[n=>!_e.authStore.isValid],userData:{showAppSidebar:!1}}),"/request-password-reset":Zt({asyncComponent:()=>Tt(()=>import("./PageSuperuserRequestPasswordReset-BFv8SpZS.js"),[],import.meta.url),conditions:[n=>!_e.authStore.isValid],userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageSuperuserConfirmPasswordReset-BB-PhJrO.js"),[],import.meta.url),conditions:[n=>!_e.authStore.isValid],userData:{showAppSidebar:!1}}),"/collections":Zt({component:jN,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/logs":Zt({component:M6,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings":Zt({component:H7,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/mail":Zt({component:CF,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/storage":Zt({component:FF,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/export-collections":Zt({component:jR,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/import-collections":Zt({component:oF,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/backups":Zt({component:LR,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageRecordConfirmPasswordReset-CIhbgoQZ.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/confirm-password-reset/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageRecordConfirmPasswordReset-CIhbgoQZ.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageRecordConfirmVerification-DQmD9Mr0.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/confirm-verification/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageRecordConfirmVerification-DQmD9Mr0.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageRecordConfirmEmailChange-DRKGFrr7.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/confirm-email-change/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageRecordConfirmEmailChange-DRKGFrr7.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-success":Zt({asyncComponent:()=>Tt(()=>import("./PageOAuth2RedirectSuccess-CwN4_gyA.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-failure":Zt({asyncComponent:()=>Tt(()=>import("./PageOAuth2RedirectFailure-toDQLSNo.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"*":Zt({component:l3,userData:{showAppSidebar:!1}})};function iq(n){let e;return{c(){e=b("link"),p(e,"rel","shortcut icon"),p(e,"type","image/png"),p(e,"href","./images/favicon/favicon_prod.png")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function jb(n){let e,t,i,l,s,o,r,a,u,f,c,d,m=V.getInitials(n[0].email)+"",h,g,_,k,S,$,T;return _=new jn({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[lq]},$$scope:{ctx:n}}}),{c(){e=b("aside"),t=b("a"),t.innerHTML='PocketBase logo',i=C(),l=b("nav"),s=b("a"),s.innerHTML='',o=C(),r=b("a"),r.innerHTML='',a=C(),u=b("a"),u.innerHTML='',f=C(),c=b("div"),d=b("span"),h=B(m),g=C(),j(_.$$.fragment),p(t,"href","/"),p(t,"class","logo logo-sm"),p(s,"href","/collections"),p(s,"class","menu-item"),p(s,"aria-label","Collections"),p(r,"href","/logs"),p(r,"class","menu-item"),p(r,"aria-label","Logs"),p(u,"href","/settings"),p(u,"class","menu-item"),p(u,"aria-label","Settings"),p(l,"class","main-menu"),p(d,"class","initials"),p(c,"tabindex","0"),p(c,"role","button"),p(c,"aria-label","Logged superuser menu"),p(c,"class","thumb thumb-circle link-hint"),p(c,"title",k=n[0].email),p(e,"class","app-sidebar")},m(O,E){v(O,e,E),w(e,t),w(e,i),w(e,l),w(l,s),w(l,o),w(l,r),w(l,a),w(l,u),w(e,f),w(e,c),w(c,d),w(d,h),w(c,g),q(_,c,null),S=!0,$||(T=[Oe(Bn.call(null,t)),Oe(Bn.call(null,s)),Oe(qi.call(null,s,{path:"/collections/?.*",className:"current-route"})),Oe(qe.call(null,s,{text:"Collections",position:"right"})),Oe(Bn.call(null,r)),Oe(qi.call(null,r,{path:"/logs/?.*",className:"current-route"})),Oe(qe.call(null,r,{text:"Logs",position:"right"})),Oe(Bn.call(null,u)),Oe(qi.call(null,u,{path:"/settings/?.*",className:"current-route"})),Oe(qe.call(null,u,{text:"Settings",position:"right"}))],$=!0)},p(O,E){(!S||E&1)&&m!==(m=V.getInitials(O[0].email)+"")&&oe(h,m);const L={};E&4097&&(L.$$scope={dirty:E,ctx:O}),_.$set(L),(!S||E&1&&k!==(k=O[0].email))&&p(c,"title",k)},i(O){S||(M(_.$$.fragment,O),S=!0)},o(O){D(_.$$.fragment,O),S=!1},d(O){O&&y(e),H(_),$=!1,Ie(T)}}}function lq(n){let e,t=n[0].email+"",i,l,s,o,r,a,u,f,c,d;return{c(){e=b("div"),i=B(t),s=C(),o=b("hr"),r=C(),a=b("a"),a.innerHTML=' Manage superusers',u=C(),f=b("button"),f.innerHTML=' Logout',p(e,"class","txt-ellipsis current-superuser svelte-1ahgi3o"),p(e,"title",l=n[0].email),p(a,"href","/collections?collection=_superusers"),p(a,"class","dropdown-item closable"),p(a,"role","menuitem"),p(f,"type","button"),p(f,"class","dropdown-item closable"),p(f,"role","menuitem")},m(m,h){v(m,e,h),w(e,i),v(m,s,h),v(m,o,h),v(m,r,h),v(m,a,h),v(m,u,h),v(m,f,h),c||(d=[Oe(Bn.call(null,a)),W(f,"click",n[7])],c=!0)},p(m,h){h&1&&t!==(t=m[0].email+"")&&oe(i,t),h&1&&l!==(l=m[0].email)&&p(e,"title",l)},d(m){m&&(y(e),y(s),y(o),y(r),y(a),y(u),y(f)),c=!1,Ie(d)}}}function zb(n){let e,t,i;return t=new Cu({props:{conf:V.defaultEditorOptions()}}),t.$on("init",n[8]),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","tinymce-preloader hidden")},m(l,s){v(l,e,s),q(t,e,null),i=!0},p:te,i(l){i||(M(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&y(e),H(t)}}}function sq(n){var S;let e,t,i,l,s,o,r,a,u,f,c,d,m,h;document.title=e=V.joinNonEmpty([n[4],n[3],"PocketBase"]," - ");let g=window.location.protocol=="https:"&&iq(),_=((S=n[0])==null?void 0:S.id)&&n[1]&&jb(n);r=new xw({props:{routes:nq}}),r.$on("routeLoading",n[5]),r.$on("conditionsFailed",n[6]),u=new Ow({}),c=new dw({});let k=n[1]&&!n[2]&&zb(n);return{c(){g&&g.c(),t=ye(),i=C(),l=b("div"),_&&_.c(),s=C(),o=b("div"),j(r.$$.fragment),a=C(),j(u.$$.fragment),f=C(),j(c.$$.fragment),d=C(),k&&k.c(),m=ye(),p(o,"class","app-body"),p(l,"class","app-layout")},m($,T){g&&g.m(document.head,null),w(document.head,t),v($,i,T),v($,l,T),_&&_.m(l,null),w(l,s),w(l,o),q(r,o,null),w(o,a),q(u,o,null),v($,f,T),q(c,$,T),v($,d,T),k&&k.m($,T),v($,m,T),h=!0},p($,[T]){var O;(!h||T&24)&&e!==(e=V.joinNonEmpty([$[4],$[3],"PocketBase"]," - "))&&(document.title=e),(O=$[0])!=null&&O.id&&$[1]?_?(_.p($,T),T&3&&M(_,1)):(_=jb($),_.c(),M(_,1),_.m(l,s)):_&&(re(),D(_,1,1,()=>{_=null}),ae()),$[1]&&!$[2]?k?(k.p($,T),T&6&&M(k,1)):(k=zb($),k.c(),M(k,1),k.m(m.parentNode,m)):k&&(re(),D(k,1,1,()=>{k=null}),ae())},i($){h||(M(_),M(r.$$.fragment,$),M(u.$$.fragment,$),M(c.$$.fragment,$),M(k),h=!0)},o($){D(_),D(r.$$.fragment,$),D(u.$$.fragment,$),D(c.$$.fragment,$),D(k),h=!1},d($){$&&(y(i),y(l),y(f),y(d),y(m)),g&&g.d($),y(t),_&&_.d(),H(r),H(u),H(c,$),k&&k.d($)}}}function oq(n,e,t){let i,l,s,o;Qe(n,Dl,g=>t(10,i=g)),Qe(n,_r,g=>t(3,l=g)),Qe(n,Rr,g=>t(0,s=g)),Qe(n,un,g=>t(4,o=g));let r,a=!1,u=!1;function f(g){var _,k,S,$;((_=g==null?void 0:g.detail)==null?void 0:_.location)!==r&&(t(1,a=!!((S=(k=g==null?void 0:g.detail)==null?void 0:k.userData)!=null&&S.showAppSidebar)),r=($=g==null?void 0:g.detail)==null?void 0:$.location,Rn(un,o="",o),Ut({}),lk())}function c(){is("/")}async function d(){var g,_;if(s!=null&&s.id)try{const k=await _e.settings.getAll({$cancelKey:"initialAppSettings"});Rn(_r,l=((g=k==null?void 0:k.meta)==null?void 0:g.appName)||"",l),Rn(Dl,i=!!((_=k==null?void 0:k.meta)!=null&&_.hideControls),i)}catch(k){k!=null&&k.isAbort||console.warn("Failed to load app settings.",k)}}function m(){_e.logout()}const h=()=>{t(2,u=!0)};return n.$$.update=()=>{n.$$.dirty&1&&s!=null&&s.id&&d()},[s,a,u,l,o,f,c,m,h]}class rq extends Se{constructor(e){super(),we(this,e,oq,sq,ke,{})}}new rq({target:document.getElementById("app")});export{dt as $,he as A,Ks as B,Oe as C,Bn as D,re as E,zF as F,ae as G,oe as H,te as I,V as J,nn as K,ye as L,co as M,Fr as N,Qe as O,Rn as P,Xt as Q,un as R,Se as S,Mn as T,kt as U,EP as V,xu as W,de as X,vt as Y,di as Z,Bt as _,D as a,zt as a0,Hy as a1,Ci as b,j as c,H as d,dn as e,fe as f,xl as g,b as h,we as i,C as j,p as k,ee as l,q as m,v as n,w as o,_e as p,W as q,is as r,ke as s,M as t,nt as u,y as v,Ie as w,_n as x,ie as y,B as z}; + `),u&&u.c(),l=C(),o&&o.c(),r=ye(),p(e,"class","content txt-center m-b-base")},m(m,h){v(m,e,h),w(e,t),w(t,i),u&&u.m(t,null),v(m,l,h),~s&&c[s].m(m,h),v(m,r,h),a=!0},p(m,h){m[2]>1?u?u.p(m,h):(u=qb(m),u.c(),u.m(t,null)):u&&(u.d(1),u=null);let g=s;s=d(m),s===g?~s&&c[s].p(m,h):(o&&(re(),D(c[g],1,1,()=>{c[g]=null}),ae()),~s?(o=c[s],o?o.p(m,h):(o=c[s]=f[s](m),o.c()),M(o,1),o.m(r.parentNode,r)):o=null)},i(m){a||(M(o),a=!0)},o(m){D(o),a=!1},d(m){m&&(y(e),y(l),y(r)),u&&u.d(),~s&&c[s].d(m)}}}function xF(n){let e,t;return e=new zF({props:{$$slots:{default:[QF]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&134234111&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function eq(n,e,t){let i;Qe(n,Au,z=>t(23,i=z));const l=new URLSearchParams(i);let s=l.get("demoEmail")||"",o=l.get("demoPassword")||"",r={},a=1,u=1,f=!1,c=!1,d=!1,m=!1,h="",g="",_="",k="",S="";$();async function $(){if(!m){t(10,m=!0);try{t(0,r=await _e.collection("_superusers").listAuthMethods())}catch(z){_e.error(z)}t(10,m=!1)}}async function T(){var z,F;if(!f){t(7,f=!0);try{await _e.collection("_superusers").authWithPassword(s,o),Ls(),Ut({}),is("/")}catch(U){U.status==401?(t(3,h=U.response.mfaId),((F=(z=r==null?void 0:r.password)==null?void 0:z.identityFields)==null?void 0:F.length)==1&&r.password.identityFields[0]=="email"?(t(12,k=s),await O()):/^[^@\s]+@[^@\s]+$/.test(s)&&t(12,k=s)):U.status!=400?_e.error(U):Ci("Invalid login credentials.")}t(7,f=!1)}}async function O(){if(!c){t(8,c=!0);try{const z=await _e.collection("_superusers").requestOTP(k);t(4,g=z.otpId),t(11,_=g),Ls(),Ut({})}catch(z){z.status==429&&t(4,g=_),_e.error(z)}t(8,c=!1)}}async function E(){if(!d){t(9,d=!0);try{await _e.collection("_superusers").authWithOTP(g||_,S,{mfaId:h}),Ls(),Ut({}),is("/")}catch(z){_e.error(z)}t(9,d=!1)}}const L=z=>{t(5,s=z.target.value)};function I(){o=this.value,t(6,o)}function A(){k=this.value,t(12,k)}const P=z=>{t(4,g=z.target.value||_),z.target.value=g};function N(){S=this.value,t(13,S)}const R=()=>{t(4,g="")};return n.$$.update=()=>{var z,F;n.$$.dirty&31&&(t(2,u=1),t(1,a=1),(z=r==null?void 0:r.mfa)!=null&&z.enabled&&t(2,u++,u),(F=r==null?void 0:r.otp)!=null&&F.enabled&&t(2,u++,u),h!=""&&t(1,a++,a),g!=""&&t(1,a++,a))},[r,a,u,h,g,s,o,f,c,d,m,_,k,S,T,O,E,L,I,A,P,N,R]}class tq extends Se{constructor(e){super(),we(this,e,eq,xF,ke,{})}}function Zt(n){if(!n)throw Error("Parameter args is required");if(!n.component==!n.asyncComponent)throw Error("One and only one of component and asyncComponent is required");if(n.component&&(n.asyncComponent=()=>Promise.resolve(n.component)),typeof n.asyncComponent!="function")throw Error("Parameter asyncComponent must be a function");if(n.conditions){Array.isArray(n.conditions)||(n.conditions=[n.conditions]);for(let t=0;tTt(()=>import("./PageInstaller-DJzBwXdp.js"),[],import.meta.url),conditions:[n=>n.params.token&&!Fr(n.params.token)],userData:{showAppSidebar:!1}}),"/login":Zt({component:tq,conditions:[n=>!_e.authStore.isValid],userData:{showAppSidebar:!1}}),"/request-password-reset":Zt({asyncComponent:()=>Tt(()=>import("./PageSuperuserRequestPasswordReset-CCVoTQW5.js"),[],import.meta.url),conditions:[n=>!_e.authStore.isValid],userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageSuperuserConfirmPasswordReset-BAZ7jH5f.js"),[],import.meta.url),conditions:[n=>!_e.authStore.isValid],userData:{showAppSidebar:!1}}),"/collections":Zt({component:jN,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/logs":Zt({component:M6,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings":Zt({component:H7,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/mail":Zt({component:CF,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/storage":Zt({component:FF,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/export-collections":Zt({component:jR,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/import-collections":Zt({component:oF,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/backups":Zt({component:LR,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageRecordConfirmPasswordReset-vozypaOJ.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/confirm-password-reset/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageRecordConfirmPasswordReset-vozypaOJ.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageRecordConfirmVerification-BZMgKOu2.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/confirm-verification/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageRecordConfirmVerification-BZMgKOu2.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageRecordConfirmEmailChange-DfPs5Q3f.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/confirm-email-change/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageRecordConfirmEmailChange-DfPs5Q3f.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-success":Zt({asyncComponent:()=>Tt(()=>import("./PageOAuth2RedirectSuccess-8NzihWC_.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-failure":Zt({asyncComponent:()=>Tt(()=>import("./PageOAuth2RedirectFailure-CXP-KtJg.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"*":Zt({component:l3,userData:{showAppSidebar:!1}})};function iq(n){let e;return{c(){e=b("link"),p(e,"rel","shortcut icon"),p(e,"type","image/png"),p(e,"href","./images/favicon/favicon_prod.png")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function jb(n){let e,t,i,l,s,o,r,a,u,f,c,d,m=V.getInitials(n[0].email)+"",h,g,_,k,S,$,T;return _=new jn({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[lq]},$$scope:{ctx:n}}}),{c(){e=b("aside"),t=b("a"),t.innerHTML='PocketBase logo',i=C(),l=b("nav"),s=b("a"),s.innerHTML='',o=C(),r=b("a"),r.innerHTML='',a=C(),u=b("a"),u.innerHTML='',f=C(),c=b("div"),d=b("span"),h=B(m),g=C(),j(_.$$.fragment),p(t,"href","/"),p(t,"class","logo logo-sm"),p(s,"href","/collections"),p(s,"class","menu-item"),p(s,"aria-label","Collections"),p(r,"href","/logs"),p(r,"class","menu-item"),p(r,"aria-label","Logs"),p(u,"href","/settings"),p(u,"class","menu-item"),p(u,"aria-label","Settings"),p(l,"class","main-menu"),p(d,"class","initials"),p(c,"tabindex","0"),p(c,"role","button"),p(c,"aria-label","Logged superuser menu"),p(c,"class","thumb thumb-circle link-hint"),p(c,"title",k=n[0].email),p(e,"class","app-sidebar")},m(O,E){v(O,e,E),w(e,t),w(e,i),w(e,l),w(l,s),w(l,o),w(l,r),w(l,a),w(l,u),w(e,f),w(e,c),w(c,d),w(d,h),w(c,g),q(_,c,null),S=!0,$||(T=[Oe(Bn.call(null,t)),Oe(Bn.call(null,s)),Oe(qi.call(null,s,{path:"/collections/?.*",className:"current-route"})),Oe(qe.call(null,s,{text:"Collections",position:"right"})),Oe(Bn.call(null,r)),Oe(qi.call(null,r,{path:"/logs/?.*",className:"current-route"})),Oe(qe.call(null,r,{text:"Logs",position:"right"})),Oe(Bn.call(null,u)),Oe(qi.call(null,u,{path:"/settings/?.*",className:"current-route"})),Oe(qe.call(null,u,{text:"Settings",position:"right"}))],$=!0)},p(O,E){(!S||E&1)&&m!==(m=V.getInitials(O[0].email)+"")&&oe(h,m);const L={};E&4097&&(L.$$scope={dirty:E,ctx:O}),_.$set(L),(!S||E&1&&k!==(k=O[0].email))&&p(c,"title",k)},i(O){S||(M(_.$$.fragment,O),S=!0)},o(O){D(_.$$.fragment,O),S=!1},d(O){O&&y(e),H(_),$=!1,Ie(T)}}}function lq(n){let e,t=n[0].email+"",i,l,s,o,r,a,u,f,c,d;return{c(){e=b("div"),i=B(t),s=C(),o=b("hr"),r=C(),a=b("a"),a.innerHTML=' Manage superusers',u=C(),f=b("button"),f.innerHTML=' Logout',p(e,"class","txt-ellipsis current-superuser svelte-1ahgi3o"),p(e,"title",l=n[0].email),p(a,"href","/collections?collection=_superusers"),p(a,"class","dropdown-item closable"),p(a,"role","menuitem"),p(f,"type","button"),p(f,"class","dropdown-item closable"),p(f,"role","menuitem")},m(m,h){v(m,e,h),w(e,i),v(m,s,h),v(m,o,h),v(m,r,h),v(m,a,h),v(m,u,h),v(m,f,h),c||(d=[Oe(Bn.call(null,a)),W(f,"click",n[7])],c=!0)},p(m,h){h&1&&t!==(t=m[0].email+"")&&oe(i,t),h&1&&l!==(l=m[0].email)&&p(e,"title",l)},d(m){m&&(y(e),y(s),y(o),y(r),y(a),y(u),y(f)),c=!1,Ie(d)}}}function zb(n){let e,t,i;return t=new Cu({props:{conf:V.defaultEditorOptions()}}),t.$on("init",n[8]),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","tinymce-preloader hidden")},m(l,s){v(l,e,s),q(t,e,null),i=!0},p:te,i(l){i||(M(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&y(e),H(t)}}}function sq(n){var S;let e,t,i,l,s,o,r,a,u,f,c,d,m,h;document.title=e=V.joinNonEmpty([n[4],n[3],"PocketBase"]," - ");let g=window.location.protocol=="https:"&&iq(),_=((S=n[0])==null?void 0:S.id)&&n[1]&&jb(n);r=new xw({props:{routes:nq}}),r.$on("routeLoading",n[5]),r.$on("conditionsFailed",n[6]),u=new Ow({}),c=new dw({});let k=n[1]&&!n[2]&&zb(n);return{c(){g&&g.c(),t=ye(),i=C(),l=b("div"),_&&_.c(),s=C(),o=b("div"),j(r.$$.fragment),a=C(),j(u.$$.fragment),f=C(),j(c.$$.fragment),d=C(),k&&k.c(),m=ye(),p(o,"class","app-body"),p(l,"class","app-layout")},m($,T){g&&g.m(document.head,null),w(document.head,t),v($,i,T),v($,l,T),_&&_.m(l,null),w(l,s),w(l,o),q(r,o,null),w(o,a),q(u,o,null),v($,f,T),q(c,$,T),v($,d,T),k&&k.m($,T),v($,m,T),h=!0},p($,[T]){var O;(!h||T&24)&&e!==(e=V.joinNonEmpty([$[4],$[3],"PocketBase"]," - "))&&(document.title=e),(O=$[0])!=null&&O.id&&$[1]?_?(_.p($,T),T&3&&M(_,1)):(_=jb($),_.c(),M(_,1),_.m(l,s)):_&&(re(),D(_,1,1,()=>{_=null}),ae()),$[1]&&!$[2]?k?(k.p($,T),T&6&&M(k,1)):(k=zb($),k.c(),M(k,1),k.m(m.parentNode,m)):k&&(re(),D(k,1,1,()=>{k=null}),ae())},i($){h||(M(_),M(r.$$.fragment,$),M(u.$$.fragment,$),M(c.$$.fragment,$),M(k),h=!0)},o($){D(_),D(r.$$.fragment,$),D(u.$$.fragment,$),D(c.$$.fragment,$),D(k),h=!1},d($){$&&(y(i),y(l),y(f),y(d),y(m)),g&&g.d($),y(t),_&&_.d(),H(r),H(u),H(c,$),k&&k.d($)}}}function oq(n,e,t){let i,l,s,o;Qe(n,Dl,g=>t(10,i=g)),Qe(n,_r,g=>t(3,l=g)),Qe(n,Rr,g=>t(0,s=g)),Qe(n,un,g=>t(4,o=g));let r,a=!1,u=!1;function f(g){var _,k,S,$;((_=g==null?void 0:g.detail)==null?void 0:_.location)!==r&&(t(1,a=!!((S=(k=g==null?void 0:g.detail)==null?void 0:k.userData)!=null&&S.showAppSidebar)),r=($=g==null?void 0:g.detail)==null?void 0:$.location,Rn(un,o="",o),Ut({}),lk())}function c(){is("/")}async function d(){var g,_;if(s!=null&&s.id)try{const k=await _e.settings.getAll({$cancelKey:"initialAppSettings"});Rn(_r,l=((g=k==null?void 0:k.meta)==null?void 0:g.appName)||"",l),Rn(Dl,i=!!((_=k==null?void 0:k.meta)!=null&&_.hideControls),i)}catch(k){k!=null&&k.isAbort||console.warn("Failed to load app settings.",k)}}function m(){_e.logout()}const h=()=>{t(2,u=!0)};return n.$$.update=()=>{n.$$.dirty&1&&s!=null&&s.id&&d()},[s,a,u,l,o,f,c,m,h]}class rq extends Se{constructor(e){super(),we(this,e,oq,sq,ke,{})}}new rq({target:document.getElementById("app")});export{dt as $,he as A,Ks as B,Oe as C,Bn as D,re as E,zF as F,ae as G,oe as H,te as I,V as J,nn as K,ye as L,co as M,Fr as N,Qe as O,Rn as P,Xt as Q,un as R,Se as S,Mn as T,kt as U,EP as V,xu as W,de as X,vt as Y,di as Z,Bt as _,D as a,zt as a0,Hy as a1,Ci as b,j as c,H as d,dn as e,fe as f,xl as g,b as h,we as i,C as j,p as k,ee as l,q as m,v as n,w as o,_e as p,W as q,is as r,ke as s,M as t,nt as u,y as v,Ie as w,_n as x,ie as y,B as z}; diff --git a/ui/dist/assets/index-CH-gyH77.js b/ui/dist/assets/index-CH-gyH77.js new file mode 100644 index 00000000..d893efcb --- /dev/null +++ b/ui/dist/assets/index-CH-gyH77.js @@ -0,0 +1,14 @@ +let ys=[],Nl=[];(()=>{let n="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(t=>t?parseInt(t,36):1);for(let t=0,e=0;t>1;if(n=Nl[i])t=i+1;else return!0;if(t==e)return!1}}function Yr(n){return n>=127462&&n<=127487}const Xr=8205;function Tc(n,t,e=!0,i=!0){return(e?Fl:Bc)(n,t,i)}function Fl(n,t,e){if(t==n.length)return t;t&&Vl(n.charCodeAt(t))&&Hl(n.charCodeAt(t-1))&&t--;let i=Xn(n,t);for(t+=_r(i);t=0&&Yr(Xn(n,o));)r++,o-=2;if(r%2==0)break;t+=2}else break}return t}function Bc(n,t,e){for(;t>0;){let i=Fl(n,t-2,e);if(i=56320&&n<57344}function Hl(n){return n>=55296&&n<56320}function _r(n){return n<65536?1:2}class F{lineAt(t){if(t<0||t>this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,e,i){[t,e]=Ue(this,t,e);let s=[];return this.decompose(0,t,s,2),i.length&&i.decompose(0,i.length,s,3),this.decompose(e,this.length,s,1),Ut.from(s,this.length-(e-t)+i.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,e=this.length){[t,e]=Ue(this,t,e);let i=[];return this.decompose(t,e,i,0),Ut.from(i,e-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let e=this.scanIdentical(t,1),i=this.length-this.scanIdentical(t,-1),s=new mi(this),r=new mi(t);for(let o=e,l=e;;){if(s.next(o),r.next(o),o=0,s.lineBreak!=r.lineBreak||s.done!=r.done||s.value!=r.value)return!1;if(l+=s.value.length,s.done||l>=i)return!0}}iter(t=1){return new mi(this,t)}iterRange(t,e=this.length){return new Wl(this,t,e)}iterLines(t,e){let i;if(t==null)i=this.iter();else{e==null&&(e=this.lines+1);let s=this.line(t).from;i=this.iterRange(s,Math.max(s,e==this.lines+1?this.length:e<=1?0:this.line(e-1).to))}return new zl(i)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}constructor(){}static of(t){if(t.length==0)throw new RangeError("A document must have at least one line");return t.length==1&&!t[0]?F.empty:t.length<=32?new _(t):Ut.from(_.split(t,[]))}}class _ extends F{constructor(t,e=Pc(t)){super(),this.text=t,this.length=e}get lines(){return this.text.length}get children(){return null}lineInner(t,e,i,s){for(let r=0;;r++){let o=this.text[r],l=s+o.length;if((e?i:l)>=t)return new Rc(s,l,i,o);s=l+1,i++}}decompose(t,e,i,s){let r=t<=0&&e>=this.length?this:new _(Qr(this.text,t,e),Math.min(e,this.length)-Math.max(0,t));if(s&1){let o=i.pop(),l=an(r.text,o.text.slice(),0,r.length);if(l.length<=32)i.push(new _(l,o.length+r.length));else{let a=l.length>>1;i.push(new _(l.slice(0,a)),new _(l.slice(a)))}}else i.push(r)}replace(t,e,i){if(!(i instanceof _))return super.replace(t,e,i);[t,e]=Ue(this,t,e);let s=an(this.text,an(i.text,Qr(this.text,0,t)),e),r=this.length+i.length-(e-t);return s.length<=32?new _(s,r):Ut.from(_.split(s,[]),r)}sliceString(t,e=this.length,i=` +`){[t,e]=Ue(this,t,e);let s="";for(let r=0,o=0;r<=e&&ot&&o&&(s+=i),tr&&(s+=l.slice(Math.max(0,t-r),e-r)),r=a+1}return s}flatten(t){for(let e of this.text)t.push(e)}scanIdentical(){return 0}static split(t,e){let i=[],s=-1;for(let r of t)i.push(r),s+=r.length+1,i.length==32&&(e.push(new _(i,s)),i=[],s=-1);return s>-1&&e.push(new _(i,s)),e}}class Ut extends F{constructor(t,e){super(),this.children=t,this.length=e,this.lines=0;for(let i of t)this.lines+=i.lines}lineInner(t,e,i,s){for(let r=0;;r++){let o=this.children[r],l=s+o.length,a=i+o.lines-1;if((e?a:l)>=t)return o.lineInner(t,e,i,s);s=l+1,i=a+1}}decompose(t,e,i,s){for(let r=0,o=0;o<=e&&r=o){let c=s&((o<=t?1:0)|(a>=e?2:0));o>=t&&a<=e&&!c?i.push(l):l.decompose(t-o,e-o,i,c)}o=a+1}}replace(t,e,i){if([t,e]=Ue(this,t,e),i.lines=r&&e<=l){let a=o.replace(t-r,e-r,i),c=this.lines-o.lines+a.lines;if(a.lines>4&&a.lines>c>>6){let h=this.children.slice();return h[s]=a,new Ut(h,this.length-(e-t)+i.length)}return super.replace(r,l,a)}r=l+1}return super.replace(t,e,i)}sliceString(t,e=this.length,i=` +`){[t,e]=Ue(this,t,e);let s="";for(let r=0,o=0;rt&&r&&(s+=i),to&&(s+=l.sliceString(t-o,e-o,i)),o=a+1}return s}flatten(t){for(let e of this.children)e.flatten(t)}scanIdentical(t,e){if(!(t instanceof Ut))return 0;let i=0,[s,r,o,l]=e>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;s+=e,r+=e){if(s==o||r==l)return i;let a=this.children[s],c=t.children[r];if(a!=c)return i+a.scanIdentical(c,e);i+=a.length+1}}static from(t,e=t.reduce((i,s)=>i+s.length+1,-1)){let i=0;for(let d of t)i+=d.lines;if(i<32){let d=[];for(let p of t)p.flatten(d);return new _(d,e)}let s=Math.max(32,i>>5),r=s<<1,o=s>>1,l=[],a=0,c=-1,h=[];function f(d){let p;if(d.lines>r&&d instanceof Ut)for(let g of d.children)f(g);else d.lines>o&&(a>o||!a)?(u(),l.push(d)):d instanceof _&&a&&(p=h[h.length-1])instanceof _&&d.lines+p.lines<=32?(a+=d.lines,c+=d.length+1,h[h.length-1]=new _(p.text.concat(d.text),p.length+1+d.length)):(a+d.lines>s&&u(),a+=d.lines,c+=d.length+1,h.push(d))}function u(){a!=0&&(l.push(h.length==1?h[0]:Ut.from(h,c)),c=-1,a=h.length=0)}for(let d of t)f(d);return u(),l.length==1?l[0]:new Ut(l,e)}}F.empty=new _([""],0);function Pc(n){let t=-1;for(let e of n)t+=e.length+1;return t}function an(n,t,e=0,i=1e9){for(let s=0,r=0,o=!0;r=e&&(a>i&&(l=l.slice(0,i-s)),s0?1:(t instanceof _?t.text.length:t.children.length)<<1]}nextInner(t,e){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,s=this.nodes[i],r=this.offsets[i],o=r>>1,l=s instanceof _?s.text.length:s.children.length;if(o==(e>0?l:0)){if(i==0)return this.done=!0,this.value="",this;e>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((r&1)==(e>0?0:1)){if(this.offsets[i]+=e,t==0)return this.lineBreak=!0,this.value=` +`,this;t--}else if(s instanceof _){let a=s.text[o+(e<0?-1:0)];if(this.offsets[i]+=e,a.length>Math.max(0,t))return this.value=t==0?a:e>0?a.slice(t):a.slice(0,a.length-t),this;t-=a.length}else{let a=s.children[o+(e<0?-1:0)];t>a.length?(t-=a.length,this.offsets[i]+=e):(e<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(e>0?1:(a instanceof _?a.text.length:a.children.length)<<1))}}}next(t=0){return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}class Wl{constructor(t,e,i){this.value="",this.done=!1,this.cursor=new mi(t,e>i?-1:1),this.pos=e>i?t.length:0,this.from=Math.min(e,i),this.to=Math.max(e,i)}nextInner(t,e){if(e<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,e<0?this.pos-this.to:this.from-this.pos);let i=e<0?this.pos-this.from:this.to-this.pos;t>i&&(t=i),i-=t;let{value:s}=this.cursor.next(t);return this.pos+=(s.length+t)*e,this.value=s.length<=i?s:e<0?s.slice(s.length-i):s.slice(0,i),this.done=!this.value,this}next(t=0){return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class zl{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:e,lineBreak:i,value:s}=this.inner.next(t);return e&&this.afterBreak?(this.value="",this.afterBreak=!1):e?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(F.prototype[Symbol.iterator]=function(){return this.iter()},mi.prototype[Symbol.iterator]=Wl.prototype[Symbol.iterator]=zl.prototype[Symbol.iterator]=function(){return this});class Rc{constructor(t,e,i,s){this.from=t,this.to=e,this.number=i,this.text=s}get length(){return this.to-this.from}}function Ue(n,t,e){return t=Math.max(0,Math.min(n.length,t)),[t,Math.max(t,Math.min(n.length,e))]}function rt(n,t,e=!0,i=!0){return Tc(n,t,e,i)}function Lc(n){return n>=56320&&n<57344}function Ec(n){return n>=55296&&n<56320}function yt(n,t){let e=n.charCodeAt(t);if(!Ec(e)||t+1==n.length)return e;let i=n.charCodeAt(t+1);return Lc(i)?(e-55296<<10)+(i-56320)+65536:e}function ur(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function Gt(n){return n<65536?1:2}const bs=/\r\n?|\n/;var at=function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n}(at||(at={}));class Qt{constructor(t){this.sections=t}get length(){let t=0;for(let e=0;et)return r+(t-s);r+=l}else{if(i!=at.Simple&&c>=t&&(i==at.TrackDel&&st||i==at.TrackBefore&&st))return null;if(c>t||c==t&&e<0&&!l)return t==s||e<0?r:r+a;r+=a}s=c}if(t>s)throw new RangeError(`Position ${t} is out of range for changeset of length ${s}`);return r}touchesRange(t,e=t){for(let i=0,s=0;i=0&&s<=e&&l>=t)return se?"cover":!0;s=l}return!1}toString(){let t="";for(let e=0;e=0?":"+s:"")}return t}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(e=>typeof e!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Qt(t)}static create(t){return new Qt(t)}}class tt extends Qt{constructor(t,e){super(t),this.inserted=e}apply(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return xs(this,(e,i,s,r,o)=>t=t.replace(s,s+(i-e),o),!1),t}mapDesc(t,e=!1){return ws(this,t,e,!0)}invert(t){let e=this.sections.slice(),i=[];for(let s=0,r=0;s=0){e[s]=l,e[s+1]=o;let a=s>>1;for(;i.length0&&ce(i,e,r.text),r.forward(h),l+=h}let c=t[o++];for(;l>1].toJSON()))}return t}static of(t,e,i){let s=[],r=[],o=0,l=null;function a(h=!1){if(!h&&!s.length)return;ou||f<0||u>e)throw new RangeError(`Invalid change range ${f} to ${u} (in doc of length ${e})`);let p=d?typeof d=="string"?F.of(d.split(i||bs)):d:F.empty,g=p.length;if(f==u&&g==0)return;fo&<(s,f-o,-1),lt(s,u-f,g),ce(r,s,p),o=u}}return c(t),a(!l),l}static empty(t){return new tt(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");let e=[],i=[];for(let s=0;sl&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(r.length==1)e.push(r[0],0);else{for(;i.length=0&&e<=0&&e==n[s+1]?n[s]+=t:s>=0&&t==0&&n[s]==0?n[s+1]+=e:i?(n[s]+=t,n[s+1]+=e):n.push(t,e)}function ce(n,t,e){if(e.length==0)return;let i=t.length-2>>1;if(i>1])),!(e||o==n.sections.length||n.sections[o+1]<0);)l=n.sections[o++],a=n.sections[o++];t(s,c,r,h,f),s=c,r=h}}}function ws(n,t,e,i=!1){let s=[],r=i?[]:null,o=new wi(n),l=new wi(t);for(let a=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&l.ins==-1){let c=Math.min(o.len,l.len);lt(s,c,-1),o.forward(c),l.forward(c)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len=0&&a=0){let c=0,h=o.len;for(;h;)if(l.ins==-1){let f=Math.min(h,l.len);c+=f,h-=f,l.forward(f)}else if(l.ins==0&&l.lena||o.ins>=0&&o.len>a)&&(l||i.length>c),r.forward2(a),o.forward(a)}}}}class wi{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i>1;return e>=t.length?F.empty:t[e]}textBit(t){let{inserted:e}=this.set,i=this.i-2>>1;return i>=e.length&&!t?F.empty:e[i].slice(this.off,t==null?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){this.ins==-1?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class ke{constructor(t,e,i){this.from=t,this.to=e,this.flags=i}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let t=this.flags&7;return t==7?null:t}get goalColumn(){let t=this.flags>>6;return t==16777215?void 0:t}map(t,e=-1){let i,s;return this.empty?i=s=t.mapPos(this.from,e):(i=t.mapPos(this.from,1),s=t.mapPos(this.to,-1)),i==this.from&&s==this.to?this:new ke(i,s,this.flags)}extend(t,e=t){if(t<=this.anchor&&e>=this.anchor)return b.range(t,e);let i=Math.abs(t-this.anchor)>Math.abs(e-this.anchor)?t:e;return b.range(this.anchor,i)}eq(t,e=!1){return this.anchor==t.anchor&&this.head==t.head&&(!e||!this.empty||this.assoc==t.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return b.range(t.anchor,t.head)}static create(t,e,i){return new ke(t,e,i)}}class b{constructor(t,e){this.ranges=t,this.mainIndex=e}map(t,e=-1){return t.empty?this:b.create(this.ranges.map(i=>i.map(t,e)),this.mainIndex)}eq(t,e=!1){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(let i=0;it.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!="number"||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new b(t.ranges.map(e=>ke.fromJSON(e)),t.main)}static single(t,e=t){return new b([b.range(t,e)],0)}static create(t,e=0){if(t.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,s=0;st?8:0)|r)}static normalized(t,e=0){let i=t[e];t.sort((s,r)=>s.from-r.from),e=t.indexOf(i);for(let s=1;sr.head?b.range(a,l):b.range(l,a))}}return new b(t,e)}}function Kl(n,t){for(let e of n.ranges)if(e.to>t)throw new RangeError("Selection points outside of document")}let dr=0;class T{constructor(t,e,i,s,r){this.combine=t,this.compareInput=e,this.compare=i,this.isStatic=s,this.id=dr++,this.default=t([]),this.extensions=typeof r=="function"?r(this):r}get reader(){return this}static define(t={}){return new T(t.combine||(e=>e),t.compareInput||((e,i)=>e===i),t.compare||(t.combine?(e,i)=>e===i:pr),!!t.static,t.enables)}of(t){return new hn([],this,0,t)}compute(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new hn(t,this,1,e)}computeN(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new hn(t,this,2,e)}from(t,e){return e||(e=i=>i),this.compute([t],i=>e(i.field(t)))}}function pr(n,t){return n==t||n.length==t.length&&n.every((e,i)=>e===t[i])}class hn{constructor(t,e,i,s){this.dependencies=t,this.facet=e,this.type=i,this.value=s,this.id=dr++}dynamicSlot(t){var e;let i=this.value,s=this.facet.compareInput,r=this.id,o=t[r]>>1,l=this.type==2,a=!1,c=!1,h=[];for(let f of this.dependencies)f=="doc"?a=!0:f=="selection"?c=!0:((e=t[f.id])!==null&&e!==void 0?e:1)&1||h.push(t[f.id]);return{create(f){return f.values[o]=i(f),1},update(f,u){if(a&&u.docChanged||c&&(u.docChanged||u.selection)||Ss(f,h)){let d=i(f);if(l?!Zr(d,f.values[o],s):!s(d,f.values[o]))return f.values[o]=d,1}return 0},reconfigure:(f,u)=>{let d,p=u.config.address[r];if(p!=null){let g=bn(u,p);if(this.dependencies.every(m=>m instanceof T?u.facet(m)===f.facet(m):m instanceof mt?u.field(m,!1)==f.field(m,!1):!0)||(l?Zr(d=i(f),g,s):s(d=i(f),g)))return f.values[o]=g,0}else d=i(f);return f.values[o]=d,1}}}}function Zr(n,t,e){if(n.length!=t.length)return!1;for(let i=0;in[a.id]),s=e.map(a=>a.type),r=i.filter(a=>!(a&1)),o=n[t.id]>>1;function l(a){let c=[];for(let h=0;hi===s),t);return t.provide&&(e.provides=t.provide(e)),e}create(t){let e=t.facet(to).find(i=>i.field==this);return((e==null?void 0:e.create)||this.createF)(t)}slot(t){let e=t[this.id]>>1;return{create:i=>(i.values[e]=this.create(i),1),update:(i,s)=>{let r=i.values[e],o=this.updateF(r,s);return this.compareF(r,o)?0:(i.values[e]=o,1)},reconfigure:(i,s)=>s.config.address[this.id]!=null?(i.values[e]=s.field(this),0):(i.values[e]=this.create(i),1)}}init(t){return[this,to.of({field:this,create:t})]}get extension(){return this}}const Se={lowest:4,low:3,default:2,high:1,highest:0};function ri(n){return t=>new $l(t,n)}const ye={highest:ri(Se.highest),high:ri(Se.high),default:ri(Se.default),low:ri(Se.low),lowest:ri(Se.lowest)};class $l{constructor(t,e){this.inner=t,this.prec=e}}class Hn{of(t){return new ks(this,t)}reconfigure(t){return Hn.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class ks{constructor(t,e){this.compartment=t,this.inner=e}}class yn{constructor(t,e,i,s,r,o){for(this.base=t,this.compartments=e,this.dynamicSlots=i,this.address=s,this.staticValues=r,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(t,e,i){let s=[],r=Object.create(null),o=new Map;for(let u of Nc(t,e,o))u instanceof mt?s.push(u):(r[u.facet.id]||(r[u.facet.id]=[])).push(u);let l=Object.create(null),a=[],c=[];for(let u of s)l[u.id]=c.length<<1,c.push(d=>u.slot(d));let h=i==null?void 0:i.config.facets;for(let u in r){let d=r[u],p=d[0].facet,g=h&&h[u]||[];if(d.every(m=>m.type==0))if(l[p.id]=a.length<<1|1,pr(g,d))a.push(i.facet(p));else{let m=p.combine(d.map(y=>y.value));a.push(i&&p.compare(m,i.facet(p))?i.facet(p):m)}else{for(let m of d)m.type==0?(l[m.id]=a.length<<1|1,a.push(m.value)):(l[m.id]=c.length<<1,c.push(y=>m.dynamicSlot(y)));l[p.id]=c.length<<1,c.push(m=>Ic(m,p,d))}}let f=c.map(u=>u(l));return new yn(t,o,f,l,a,r)}}function Nc(n,t,e){let i=[[],[],[],[],[]],s=new Map;function r(o,l){let a=s.get(o);if(a!=null){if(a<=l)return;let c=i[a].indexOf(o);c>-1&&i[a].splice(c,1),o instanceof ks&&e.delete(o.compartment)}if(s.set(o,l),Array.isArray(o))for(let c of o)r(c,l);else if(o instanceof ks){if(e.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=t.get(o.compartment)||o.inner;e.set(o.compartment,c),r(c,l)}else if(o instanceof $l)r(o.inner,o.prec);else if(o instanceof mt)i[l].push(o),o.provides&&r(o.provides,l);else if(o instanceof hn)i[l].push(o),o.facet.extensions&&r(o.facet.extensions,Se.default);else{let c=o.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);r(c,l)}}return r(n,Se.default),i.reduce((o,l)=>o.concat(l))}function yi(n,t){if(t&1)return 2;let e=t>>1,i=n.status[e];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;n.status[e]=4;let s=n.computeSlot(n,n.config.dynamicSlots[e]);return n.status[e]=2|s}function bn(n,t){return t&1?n.config.staticValues[t>>1]:n.values[t>>1]}const jl=T.define(),vs=T.define({combine:n=>n.some(t=>t),static:!0}),Ul=T.define({combine:n=>n.length?n[0]:void 0,static:!0}),Gl=T.define(),Jl=T.define(),Yl=T.define(),Xl=T.define({combine:n=>n.length?n[0]:!1});class oe{constructor(t,e){this.type=t,this.value=e}static define(){return new Fc}}class Fc{of(t){return new oe(this,t)}}class Vc{constructor(t){this.map=t}of(t){return new N(this,t)}}class N{constructor(t,e){this.type=t,this.value=e}map(t){let e=this.type.map(this.value,t);return e===void 0?void 0:e==this.value?this:new N(this.type,e)}is(t){return this.type==t}static define(t={}){return new Vc(t.map||(e=>e))}static mapEffects(t,e){if(!t.length)return t;let i=[];for(let s of t){let r=s.map(e);r&&i.push(r)}return i}}N.reconfigure=N.define();N.appendConfig=N.define();class Z{constructor(t,e,i,s,r,o){this.startState=t,this.changes=e,this.selection=i,this.effects=s,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,i&&Kl(i,e.newLength),r.some(l=>l.type==Z.time)||(this.annotations=r.concat(Z.time.of(Date.now())))}static create(t,e,i,s,r,o){return new Z(t,e,i,s,r,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(t){for(let e of this.annotations)if(e.type==t)return e.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let e=this.annotation(Z.userEvent);return!!(e&&(e==t||e.length>t.length&&e.slice(0,t.length)==t&&e[t.length]=="."))}}Z.time=oe.define();Z.userEvent=oe.define();Z.addToHistory=oe.define();Z.remote=oe.define();function Hc(n,t){let e=[];for(let i=0,s=0;;){let r,o;if(i=n[i]))r=n[i++],o=n[i++];else if(s=0;s--){let r=i[s](n);r instanceof Z?n=r:Array.isArray(r)&&r.length==1&&r[0]instanceof Z?n=r[0]:n=Ql(t,ze(r),!1)}return n}function zc(n){let t=n.startState,e=t.facet(Yl),i=n;for(let s=e.length-1;s>=0;s--){let r=e[s](n);r&&Object.keys(r).length&&(i=_l(i,Cs(t,r,n.changes.newLength),!0))}return i==n?n:Z.create(t,n.changes,n.selection,i.effects,i.annotations,i.scrollIntoView)}const qc=[];function ze(n){return n==null?qc:Array.isArray(n)?n:[n]}var J=function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n}(J||(J={}));const Kc=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let As;try{As=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function $c(n){if(As)return As.test(n);for(let t=0;t"€"&&(e.toUpperCase()!=e.toLowerCase()||Kc.test(e)))return!0}return!1}function jc(n){return t=>{if(!/\S/.test(t))return J.Space;if($c(t))return J.Word;for(let e=0;e-1)return J.Word;return J.Other}}class H{constructor(t,e,i,s,r,o){this.config=t,this.doc=e,this.selection=i,this.values=s,this.status=t.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let l=0;ls.set(c,a)),e=null),s.set(l.value.compartment,l.value.extension)):l.is(N.reconfigure)?(e=null,i=l.value):l.is(N.appendConfig)&&(e=null,i=ze(i).concat(l.value));let r;e?r=t.startState.values.slice():(e=yn.resolve(i,s,this),r=new H(e,this.doc,this.selection,e.dynamicSlots.map(()=>null),(a,c)=>c.reconfigure(a,this),null).values);let o=t.startState.facet(vs)?t.newSelection:t.newSelection.asSingle();new H(e,t.newDoc,o,r,(l,a)=>a.update(l,t),t)}replaceSelection(t){return typeof t=="string"&&(t=this.toText(t)),this.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:t},range:b.cursor(e.from+t.length)}))}changeByRange(t){let e=this.selection,i=t(e.ranges[0]),s=this.changes(i.changes),r=[i.range],o=ze(i.effects);for(let l=1;lo.spec.fromJSON(l,a)))}}return H.create({doc:t.doc,selection:b.fromJSON(t.selection),extensions:e.extensions?s.concat([e.extensions]):s})}static create(t={}){let e=yn.resolve(t.extensions||[],new Map),i=t.doc instanceof F?t.doc:F.of((t.doc||"").split(e.staticFacet(H.lineSeparator)||bs)),s=t.selection?t.selection instanceof b?t.selection:b.single(t.selection.anchor,t.selection.head):b.single(0);return Kl(s,i.length),e.staticFacet(vs)||(s=s.asSingle()),new H(e,i,s,e.dynamicSlots.map(()=>null),(r,o)=>o.create(r),null)}get tabSize(){return this.facet(H.tabSize)}get lineBreak(){return this.facet(H.lineSeparator)||` +`}get readOnly(){return this.facet(Xl)}phrase(t,...e){for(let i of this.facet(H.phrases))if(Object.prototype.hasOwnProperty.call(i,t)){t=i[t];break}return e.length&&(t=t.replace(/\$(\$|\d*)/g,(i,s)=>{if(s=="$")return"$";let r=+(s||1);return!r||r>e.length?i:e[r-1]})),t}languageDataAt(t,e,i=-1){let s=[];for(let r of this.facet(jl))for(let o of r(this,e,i))Object.prototype.hasOwnProperty.call(o,t)&&s.push(o[t]);return s}charCategorizer(t){return jc(this.languageDataAt("wordChars",t).join(""))}wordAt(t){let{text:e,from:i,length:s}=this.doc.lineAt(t),r=this.charCategorizer(t),o=t-i,l=t-i;for(;o>0;){let a=rt(e,o,!1);if(r(e.slice(a,o))!=J.Word)break;o=a}for(;ln.length?n[0]:4});H.lineSeparator=Ul;H.readOnly=Xl;H.phrases=T.define({compare(n,t){let e=Object.keys(n),i=Object.keys(t);return e.length==i.length&&e.every(s=>n[s]==t[s])}});H.languageData=jl;H.changeFilter=Gl;H.transactionFilter=Jl;H.transactionExtender=Yl;Hn.reconfigure=N.define();function Ee(n,t,e={}){let i={};for(let s of n)for(let r of Object.keys(s)){let o=s[r],l=i[r];if(l===void 0)i[r]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(e,r))i[r]=e[r](l,o);else throw new Error("Config merge conflict for field "+r)}for(let s in t)i[s]===void 0&&(i[s]=t[s]);return i}class De{eq(t){return this==t}range(t,e=t){return Ms.create(t,e,this)}}De.prototype.startSide=De.prototype.endSide=0;De.prototype.point=!1;De.prototype.mapMode=at.TrackDel;let Ms=class Zl{constructor(t,e,i){this.from=t,this.to=e,this.value=i}static create(t,e,i){return new Zl(t,e,i)}};function Ds(n,t){return n.from-t.from||n.value.startSide-t.value.startSide}class gr{constructor(t,e,i,s){this.from=t,this.to=e,this.value=i,this.maxPoint=s}get length(){return this.to[this.to.length-1]}findIndex(t,e,i,s=0){let r=i?this.to:this.from;for(let o=s,l=r.length;;){if(o==l)return o;let a=o+l>>1,c=r[a]-t||(i?this.value[a].endSide:this.value[a].startSide)-e;if(a==o)return c>=0?o:l;c>=0?l=a:o=a+1}}between(t,e,i,s){for(let r=this.findIndex(e,-1e9,!0),o=this.findIndex(i,1e9,!1,r);rd||u==d&&c.startSide>0&&c.endSide<=0)continue;(d-u||c.endSide-c.startSide)<0||(o<0&&(o=u),c.point&&(l=Math.max(l,d-u)),i.push(c),s.push(u-o),r.push(d-o))}return{mapped:i.length?new gr(s,r,i,l):null,pos:o}}}class K{constructor(t,e,i,s){this.chunkPos=t,this.chunk=e,this.nextLayer=i,this.maxPoint=s}static create(t,e,i,s){return new K(t,e,i,s)}get length(){let t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let t=this.nextLayer.size;for(let e of this.chunk)t+=e.value.length;return t}chunkEnd(t){return this.chunkPos[t]+this.chunk[t].length}update(t){let{add:e=[],sort:i=!1,filterFrom:s=0,filterTo:r=this.length}=t,o=t.filter;if(e.length==0&&!o)return this;if(i&&(e=e.slice().sort(Ds)),this.isEmpty)return e.length?K.of(e):this;let l=new ta(this,null,-1).goto(0),a=0,c=[],h=new Oe;for(;l.value||a=0){let f=e[a++];h.addInner(f.from,f.to,f.value)||c.push(f)}else l.rangeIndex==1&&l.chunkIndexthis.chunkEnd(l.chunkIndex)||rl.to||r=r&&t<=r+o.length&&o.between(r,t-r,e-r,i)===!1)return}this.nextLayer.between(t,e,i)}}iter(t=0){return Si.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,e=0){return Si.from(t).goto(e)}static compare(t,e,i,s,r=-1){let o=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),l=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),a=eo(o,l,i),c=new oi(o,a,r),h=new oi(l,a,r);i.iterGaps((f,u,d)=>io(c,f,h,u,d,s)),i.empty&&i.length==0&&io(c,0,h,0,0,s)}static eq(t,e,i=0,s){s==null&&(s=999999999);let r=t.filter(h=>!h.isEmpty&&e.indexOf(h)<0),o=e.filter(h=>!h.isEmpty&&t.indexOf(h)<0);if(r.length!=o.length)return!1;if(!r.length)return!0;let l=eo(r,o),a=new oi(r,l,0).goto(i),c=new oi(o,l,0).goto(i);for(;;){if(a.to!=c.to||!Os(a.active,c.active)||a.point&&(!c.point||!a.point.eq(c.point)))return!1;if(a.to>s)return!0;a.next(),c.next()}}static spans(t,e,i,s,r=-1){let o=new oi(t,null,r).goto(e),l=e,a=o.openStart;for(;;){let c=Math.min(o.to,i);if(o.point){let h=o.activeForPoint(o.to),f=o.pointFroml&&(s.span(l,c,o.active,a),a=o.openEnd(c));if(o.to>i)return a+(o.point&&o.to>i?1:0);l=o.to,o.next()}}static of(t,e=!1){let i=new Oe;for(let s of t instanceof Ms?[t]:e?Uc(t):t)i.add(s.from,s.to,s.value);return i.finish()}static join(t){if(!t.length)return K.empty;let e=t[t.length-1];for(let i=t.length-2;i>=0;i--)for(let s=t[i];s!=K.empty;s=s.nextLayer)e=new K(s.chunkPos,s.chunk,e,Math.max(s.maxPoint,e.maxPoint));return e}}K.empty=new K([],[],null,-1);function Uc(n){if(n.length>1)for(let t=n[0],e=1;e0)return n.slice().sort(Ds);t=i}return n}K.empty.nextLayer=K.empty;class Oe{finishChunk(t){this.chunks.push(new gr(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,t&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(t,e,i){this.addInner(t,e,i)||(this.nextLayer||(this.nextLayer=new Oe)).add(t,e,i)}addInner(t,e,i){let s=t-this.lastTo||i.startSide-this.last.endSide;if(s<=0&&(t-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return s<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(e-this.chunkStart),this.last=i,this.lastFrom=t,this.lastTo=e,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,e-t)),!0)}addChunk(t,e){if((t-this.lastTo||e.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,e.maxPoint),this.chunks.push(e),this.chunkPos.push(t);let i=e.value.length-1;return this.last=e.value[i],this.lastFrom=e.from[i]+t,this.lastTo=e.to[i]+t,!0}finish(){return this.finishInner(K.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return t;let e=K.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,e}}function eo(n,t,e){let i=new Map;for(let r of n)for(let o=0;o=this.minPoint)break}}setRangeIndex(t){if(t==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=i&&s.push(new ta(o,e,i,r));return s.length==1?s[0]:new Si(s)}get startSide(){return this.value?this.value.startSide:0}goto(t,e=-1e9){for(let i of this.heap)i.goto(t,e);for(let i=this.heap.length>>1;i>=0;i--)_n(this.heap,i);return this.next(),this}forward(t,e){for(let i of this.heap)i.forward(t,e);for(let i=this.heap.length>>1;i>=0;i--)_n(this.heap,i);(this.to-t||this.value.endSide-e)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let t=this.heap[0];this.from=t.from,this.to=t.to,this.value=t.value,this.rank=t.rank,t.value&&t.next(),_n(this.heap,0)}}}function _n(n,t){for(let e=n[t];;){let i=(t<<1)+1;if(i>=n.length)break;let s=n[i];if(i+1=0&&(s=n[i+1],i++),e.compare(s)<0)break;n[i]=e,n[t]=s,t=i}}class oi{constructor(t,e,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Si.from(t,e,i)}goto(t,e=-1e9){return this.cursor.goto(t,e),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=e,this.openStart=-1,this.next(),this}forward(t,e){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-e)<0;)this.removeActive(this.minActive);this.cursor.forward(t,e)}removeActive(t){zi(this.active,t),zi(this.activeTo,t),zi(this.activeRank,t),this.minActive=no(this.active,this.activeTo)}addActive(t){let e=0,{value:i,to:s,rank:r}=this.cursor;for(;e0;)e++;qi(this.active,e,i),qi(this.activeTo,e,s),qi(this.activeRank,e,r),t&&qi(t,e,this.cursor.from),this.minActive=no(this.active,this.activeTo)}next(){let t=this.to,e=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let s=this.minActive;if(s>-1&&(this.activeTo[s]-this.cursor.from||this.active[s].endSide-this.cursor.startSide)<0){if(this.activeTo[s]>t){this.to=this.activeTo[s],this.endSide=this.active[s].endSide;break}this.removeActive(s),i&&zi(i,s)}else if(this.cursor.value)if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let r=this.cursor.value;if(!r.point)this.addActive(i),this.cursor.next();else if(e&&this.cursor.to==this.to&&this.cursor.from=0&&i[s]=0&&!(this.activeRank[i]t||this.activeTo[i]==t&&this.active[i].endSide>=this.point.endSide)&&e.push(this.active[i]);return e.reverse()}openEnd(t){let e=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>t;i--)e++;return e}}function io(n,t,e,i,s,r){n.goto(t),e.goto(i);let o=i+s,l=i,a=i-t;for(;;){let c=n.to+a-e.to,h=c||n.endSide-e.endSide,f=h<0?n.to+a:e.to,u=Math.min(f,o);if(n.point||e.point?n.point&&e.point&&(n.point==e.point||n.point.eq(e.point))&&Os(n.activeForPoint(n.to),e.activeForPoint(e.to))||r.comparePoint(l,u,n.point,e.point):u>l&&!Os(n.active,e.active)&&r.compareRange(l,u,n.active,e.active),f>o)break;(c||n.openEnd!=e.openEnd)&&r.boundChange&&r.boundChange(f),l=f,h<=0&&n.next(),h>=0&&e.next()}}function Os(n,t){if(n.length!=t.length)return!1;for(let e=0;e=t;i--)n[i+1]=n[i];n[t]=e}function no(n,t){let e=-1,i=1e9;for(let s=0;s=t)return s;if(s==n.length)break;r+=n.charCodeAt(s)==9?e-r%e:1,s=rt(n,s)}return i===!0?-1:n.length}const Bs="ͼ",so=typeof Symbol>"u"?"__"+Bs:Symbol.for(Bs),Ps=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),ro=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class de{constructor(t,e){this.rules=[];let{finish:i}=e||{};function s(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function r(o,l,a,c){let h=[],f=/^@(\w+)\b/.exec(o[0]),u=f&&f[1]=="keyframes";if(f&&l==null)return a.push(o[0]+";");for(let d in l){let p=l[d];if(/&/.test(d))r(d.split(/,\s*/).map(g=>o.map(m=>g.replace(/&/,m))).reduce((g,m)=>g.concat(m)),p,a);else if(p&&typeof p=="object"){if(!f)throw new RangeError("The value of a property ("+d+") should be a primitive value.");r(s(d),p,h,u)}else p!=null&&h.push(d.replace(/_.*/,"").replace(/[A-Z]/g,g=>"-"+g.toLowerCase())+": "+p+";")}(h.length||u)&&a.push((i&&!f&&!c?o.map(i):o).join(", ")+" {"+h.join(" ")+"}")}for(let o in t)r(s(o),t[o],this.rules)}getRules(){return this.rules.join(` +`)}static newName(){let t=ro[so]||1;return ro[so]=t+1,Bs+t.toString(36)}static mount(t,e,i){let s=t[Ps],r=i&&i.nonce;s?r&&s.setNonce(r):s=new Gc(t,r),s.mount(Array.isArray(e)?e:[e],t)}}let oo=new Map;class Gc{constructor(t,e){let i=t.ownerDocument||t,s=i.defaultView;if(!t.head&&t.adoptedStyleSheets&&s.CSSStyleSheet){let r=oo.get(i);if(r)return t[Ps]=r;this.sheet=new s.CSSStyleSheet,oo.set(i,this)}else this.styleTag=i.createElement("style"),e&&this.styleTag.setAttribute("nonce",e);this.modules=[],t[Ps]=this}mount(t,e){let i=this.sheet,s=0,r=0;for(let o=0;o-1&&(this.modules.splice(a,1),r--,a=-1),a==-1){if(this.modules.splice(r++,0,l),i)for(let c=0;c",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Jc=typeof navigator<"u"&&/Mac/.test(navigator.platform),Yc=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var st=0;st<10;st++)pe[48+st]=pe[96+st]=String(st);for(var st=1;st<=24;st++)pe[st+111]="F"+st;for(var st=65;st<=90;st++)pe[st]=String.fromCharCode(st+32),ki[st]=String.fromCharCode(st);for(var Qn in pe)ki.hasOwnProperty(Qn)||(ki[Qn]=pe[Qn]);function Xc(n){var t=Jc&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||Yc&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",e=!t&&n.key||(n.shiftKey?ki:pe)[n.keyCode]||n.key||"Unidentified";return e=="Esc"&&(e="Escape"),e=="Del"&&(e="Delete"),e=="Left"&&(e="ArrowLeft"),e=="Up"&&(e="ArrowUp"),e=="Right"&&(e="ArrowRight"),e=="Down"&&(e="ArrowDown"),e}function vi(n){let t;return n.nodeType==11?t=n.getSelection?n:n.ownerDocument:t=n,t.getSelection()}function Rs(n,t){return t?n==t||n.contains(t.nodeType!=1?t.parentNode:t):!1}function cn(n,t){if(!t.anchorNode)return!1;try{return Rs(n,t.anchorNode)}catch{return!1}}function Ge(n){return n.nodeType==3?Be(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function bi(n,t,e,i){return e?lo(n,t,e,i,-1)||lo(n,t,e,i,1):!1}function Te(n){for(var t=0;;t++)if(n=n.previousSibling,!n)return t}function xn(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(n.nodeName)}function lo(n,t,e,i,s){for(;;){if(n==e&&t==i)return!0;if(t==(s<0?0:Zt(n))){if(n.nodeName=="DIV")return!1;let r=n.parentNode;if(!r||r.nodeType!=1)return!1;t=Te(n)+(s<0?0:1),n=r}else if(n.nodeType==1){if(n=n.childNodes[t+(s<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;t=s<0?Zt(n):0}else return!1}}function Zt(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Li(n,t){let e=t?n.left:n.right;return{left:e,right:e,top:n.top,bottom:n.bottom}}function _c(n){let t=n.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function ea(n,t){let e=t.width/n.offsetWidth,i=t.height/n.offsetHeight;return(e>.995&&e<1.005||!isFinite(e)||Math.abs(t.width-n.offsetWidth)<1)&&(e=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(t.height-n.offsetHeight)<1)&&(i=1),{scaleX:e,scaleY:i}}function Qc(n,t,e,i,s,r,o,l){let a=n.ownerDocument,c=a.defaultView||window;for(let h=n,f=!1;h&&!f;)if(h.nodeType==1){let u,d=h==a.body,p=1,g=1;if(d)u=_c(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(h).position)&&(f=!0),h.scrollHeight<=h.clientHeight&&h.scrollWidth<=h.clientWidth){h=h.assignedSlot||h.parentNode;continue}let x=h.getBoundingClientRect();({scaleX:p,scaleY:g}=ea(h,x)),u={left:x.left,right:x.left+h.clientWidth*p,top:x.top,bottom:x.top+h.clientHeight*g}}let m=0,y=0;if(s=="nearest")t.top0&&t.bottom>u.bottom+y&&(y=t.bottom-u.bottom+y+o)):t.bottom>u.bottom&&(y=t.bottom-u.bottom+o,e<0&&t.top-y0&&t.right>u.right+m&&(m=t.right-u.right+m+r)):t.right>u.right&&(m=t.right-u.right+r,e<0&&t.lefts.clientHeight&&(i=s),!e&&s.scrollWidth>s.clientWidth&&(e=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:e,y:i}}class tf{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}setRange(t){let{anchorNode:e,focusNode:i}=t;this.set(e,Math.min(t.anchorOffset,e?Zt(e):0),i,Math.min(t.focusOffset,i?Zt(i):0))}set(t,e,i,s){this.anchorNode=t,this.anchorOffset=e,this.focusNode=i,this.focusOffset=s}}let Fe=null;function ia(n){if(n.setActive)return n.setActive();if(Fe)return n.focus(Fe);let t=[];for(let e=n;e&&(t.push(e,e.scrollTop,e.scrollLeft),e!=e.ownerDocument);e=e.parentNode);if(n.focus(Fe==null?{get preventScroll(){return Fe={preventScroll:!0},!0}}:void 0),!Fe){Fe=!1;for(let e=0;eMath.max(1,n.scrollHeight-n.clientHeight-4)}function ra(n,t){for(let e=n,i=t;;){if(e.nodeType==3&&i>0)return{node:e,offset:i};if(e.nodeType==1&&i>0){if(e.contentEditable=="false")return null;e=e.childNodes[i-1],i=Zt(e)}else if(e.parentNode&&!xn(e))i=Te(e),e=e.parentNode;else return null}}function oa(n,t){for(let e=n,i=t;;){if(e.nodeType==3&&ie)return f.domBoundsAround(t,e,c);if(u>=t&&s==-1&&(s=a,r=c),c>e&&f.dom.parentNode==this.dom){o=a,l=h;break}h=u,c=u+f.breakAfter}return{from:r,to:l<0?i+this.length:l,startDOM:(s?this.children[s-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o=0?this.children[o].dom:null}}markDirty(t=!1){this.flags|=2,this.markParentsDirty(t)}markParentsDirty(t){for(let e=this.parent;e;e=e.parent){if(t&&(e.flags|=2),e.flags&1)return;e.flags|=1,t=!1}}setParent(t){this.parent!=t&&(this.parent=t,this.flags&7&&this.markParentsDirty(!0))}setDOM(t){this.dom!=t&&(this.dom&&(this.dom.cmView=null),this.dom=t,t.cmView=this)}get rootView(){for(let t=this;;){let e=t.parent;if(!e)return t;t=e}}replaceChildren(t,e,i=mr){this.markDirty();for(let s=t;sthis.pos||t==this.pos&&(e>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=t-this.pos,this;let i=this.children[--this.i];this.pos-=i.length+i.breakAfter}}}function aa(n,t,e,i,s,r,o,l,a){let{children:c}=n,h=c.length?c[t]:null,f=r.length?r[r.length-1]:null,u=f?f.breakAfter:o;if(!(t==i&&h&&!o&&!u&&r.length<2&&h.merge(e,s,r.length?f:null,e==0,l,a))){if(i0&&(!o&&r.length&&h.merge(e,h.length,r[0],!1,l,0)?h.breakAfter=r.shift().breakAfter:(e2);var D={mac:uo||/Mac/.test(bt.platform),windows:/Win/.test(bt.platform),linux:/Linux|X11/.test(bt.platform),ie:Wn,ie_version:ca?Ls.documentMode||6:Is?+Is[1]:Es?+Es[1]:0,gecko:co,gecko_version:co?+(/Firefox\/(\d+)/.exec(bt.userAgent)||[0,0])[1]:0,chrome:!!Zn,chrome_version:Zn?+Zn[1]:0,ios:uo,android:/Android\b/.test(bt.userAgent),webkit:fo,safari:fa,webkit_version:fo?+(/\bAppleWebKit\/(\d+)/.exec(bt.userAgent)||[0,0])[1]:0,tabSize:Ls.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const sf=256;class Ft extends ${constructor(t){super(),this.text=t}get length(){return this.text.length}createDOM(t){this.setDOM(t||document.createTextNode(this.text))}sync(t,e){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text)}reuseDOM(t){t.nodeType==3&&this.createDOM(t)}merge(t,e,i){return this.flags&8||i&&(!(i instanceof Ft)||this.length-(e-t)+i.length>sf||i.flags&8)?!1:(this.text=this.text.slice(0,t)+(i?i.text:"")+this.text.slice(e),this.markDirty(),!0)}split(t){let e=new Ft(this.text.slice(t));return this.text=this.text.slice(0,t),this.markDirty(),e.flags|=this.flags&8,e}localPosFromDOM(t,e){return t==this.dom?e:e?this.text.length:0}domAtPos(t){return new ht(this.dom,t)}domBoundsAround(t,e,i){return{from:i,to:i+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(t,e){return rf(this.dom,t,e)}}class re extends ${constructor(t,e=[],i=0){super(),this.mark=t,this.children=e,this.length=i;for(let s of e)s.setParent(this)}setAttrs(t){if(na(t),this.mark.class&&(t.className=this.mark.class),this.mark.attrs)for(let e in this.mark.attrs)t.setAttribute(e,this.mark.attrs[e]);return t}canReuseDOM(t){return super.canReuseDOM(t)&&!((this.flags|t.flags)&8)}reuseDOM(t){t.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(t),this.flags|=6)}sync(t,e){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(t,e)}merge(t,e,i,s,r,o){return i&&(!(i instanceof re&&i.mark.eq(this.mark))||t&&r<=0||et&&e.push(i=t&&(s=r),i=a,r++}let o=this.length-t;return this.length=t,s>-1&&(this.children.length=s,this.markDirty()),new re(this.mark,e,o)}domAtPos(t){return ua(this,t)}coordsAt(t,e){return pa(this,t,e)}}function rf(n,t,e){let i=n.nodeValue.length;t>i&&(t=i);let s=t,r=t,o=0;t==0&&e<0||t==i&&e>=0?D.chrome||D.gecko||(t?(s--,o=1):r=0)?0:l.length-1];return D.safari&&!o&&a.width==0&&(a=Array.prototype.find.call(l,c=>c.width)||a),o?Li(a,o<0):a||null}class ve extends ${static create(t,e,i){return new ve(t,e,i)}constructor(t,e,i){super(),this.widget=t,this.length=e,this.side=i,this.prevWidget=null}split(t){let e=ve.create(this.widget,this.length-t,this.side);return this.length-=t,e}sync(t){(!this.dom||!this.widget.updateDOM(this.dom,t))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(t)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(t,e,i,s,r,o){return i&&(!(i instanceof ve)||!this.widget.compare(i.widget)||t>0&&r<=0||e0)?ht.before(this.dom):ht.after(this.dom,t==this.length)}domBoundsAround(){return null}coordsAt(t,e){let i=this.widget.coordsAt(this.dom,t,e);if(i)return i;let s=this.dom.getClientRects(),r=null;if(!s.length)return null;let o=this.side?this.side<0:t>0;for(let l=o?s.length-1:0;r=s[l],!(t>0?l==0:l==s.length-1||r.top0?ht.before(this.dom):ht.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(t){return this.dom.getBoundingClientRect()}get overrideDOMText(){return F.empty}get isHidden(){return!0}}Ft.prototype.children=ve.prototype.children=Je.prototype.children=mr;function ua(n,t){let e=n.dom,{children:i}=n,s=0;for(let r=0;sr&&t0;r--){let o=i[r-1];if(o.dom.parentNode==e)return o.domAtPos(o.length)}for(let r=s;r0&&t instanceof re&&s.length&&(i=s[s.length-1])instanceof re&&i.mark.eq(t.mark)?da(i,t.children[0],e-1):(s.push(t),t.setParent(n)),n.length+=t.length}function pa(n,t,e){let i=null,s=-1,r=null,o=-1;function l(c,h){for(let f=0,u=0;f=h&&(d.children.length?l(d,h-u):(!r||r.isHidden&&e>0)&&(p>h||u==p&&d.getSide()>0)?(r=d,o=h-u):(u-1?1:0)!=s.length-(e&&s.indexOf(e)>-1?1:0))return!1;for(let r of i)if(r!=e&&(s.indexOf(r)==-1||n[r]!==t[r]))return!1;return!0}function Fs(n,t,e){let i=!1;if(t)for(let s in t)e&&s in e||(i=!0,s=="style"?n.style.cssText="":n.removeAttribute(s));if(e)for(let s in e)t&&t[s]==e[s]||(i=!0,s=="style"?n.style.cssText=e[s]:n.setAttribute(s,e[s]));return i}function lf(n){let t=Object.create(null);for(let e=0;e0?3e8:-4e8:e>0?1e8:-1e8,new ge(t,e,e,i,t.widget||null,!1)}static replace(t){let e=!!t.block,i,s;if(t.isBlockGap)i=-5e8,s=4e8;else{let{start:r,end:o}=ga(t,e);i=(r?e?-3e8:-1:5e8)-1,s=(o?e?2e8:1:-6e8)+1}return new ge(t,i,s,e,t.widget||null,!0)}static line(t){return new Ii(t)}static set(t,e=!1){return K.of(t,e)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}P.none=K.empty;class Ei extends P{constructor(t){let{start:e,end:i}=ga(t);super(e?-1:5e8,i?1:-6e8,null,t),this.tagName=t.tagName||"span",this.class=t.class||"",this.attrs=t.attributes||null}eq(t){var e,i;return this==t||t instanceof Ei&&this.tagName==t.tagName&&(this.class||((e=this.attrs)===null||e===void 0?void 0:e.class))==(t.class||((i=t.attrs)===null||i===void 0?void 0:i.class))&&wn(this.attrs,t.attrs,"class")}range(t,e=t){if(t>=e)throw new RangeError("Mark decorations may not be empty");return super.range(t,e)}}Ei.prototype.point=!1;class Ii extends P{constructor(t){super(-2e8,-2e8,null,t)}eq(t){return t instanceof Ii&&this.spec.class==t.spec.class&&wn(this.spec.attributes,t.spec.attributes)}range(t,e=t){if(e!=t)throw new RangeError("Line decoration ranges must be zero-length");return super.range(t,e)}}Ii.prototype.mapMode=at.TrackBefore;Ii.prototype.point=!0;class ge extends P{constructor(t,e,i,s,r,o){super(e,i,r,t),this.block=s,this.isReplace=o,this.mapMode=s?e<=0?at.TrackBefore:at.TrackAfter:at.TrackDel}get type(){return this.startSide!=this.endSide?Mt.WidgetRange:this.startSide<=0?Mt.WidgetBefore:Mt.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof ge&&af(this.widget,t.widget)&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(t,e=t){if(this.isReplace&&(t>e||t==e&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&e!=t)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(t,e)}}ge.prototype.point=!0;function ga(n,t=!1){let{inclusiveStart:e,inclusiveEnd:i}=n;return e==null&&(e=n.inclusive),i==null&&(i=n.inclusive),{start:e??t,end:i??t}}function af(n,t){return n==t||!!(n&&t&&n.compare(t))}function fn(n,t,e,i=0){let s=e.length-1;s>=0&&e[s]+i>=n?e[s]=Math.max(e[s],t):e.push(n,t)}class Q extends ${constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(t,e,i,s,r,o){if(i){if(!(i instanceof Q))return!1;this.dom||i.transferDOM(this)}return s&&this.setDeco(i?i.attrs:null),ha(this,t,e,i?i.children.slice():[],r,o),!0}split(t){let e=new Q;if(e.breakAfter=this.breakAfter,this.length==0)return e;let{i,off:s}=this.childPos(t);s&&(e.append(this.children[i].split(s),0),this.children[i].merge(s,this.children[i].length,null,!1,0,0),i++);for(let r=i;r0&&this.children[i-1].length==0;)this.children[--i].destroy();return this.children.length=i,this.markDirty(),this.length=t,e}transferDOM(t){this.dom&&(this.markDirty(),t.setDOM(this.dom),t.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(t){wn(this.attrs,t)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=t)}append(t,e){da(this,t,e)}addLineDeco(t){let e=t.spec.attributes,i=t.spec.class;e&&(this.attrs=Ns(e,this.attrs||{})),i&&(this.attrs=Ns({class:i},this.attrs||{}))}domAtPos(t){return ua(this,t)}reuseDOM(t){t.nodeName=="DIV"&&(this.setDOM(t),this.flags|=6)}sync(t,e){var i;this.dom?this.flags&4&&(na(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(Fs(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(t,e);let s=this.dom.lastChild;for(;s&&$.get(s)instanceof re;)s=s.lastChild;if(!s||!this.length||s.nodeName!="BR"&&((i=$.get(s))===null||i===void 0?void 0:i.isEditable)==!1&&(!D.ios||!this.children.some(r=>r instanceof Ft))){let r=document.createElement("BR");r.cmIgnore=!0,this.dom.appendChild(r)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let t=0,e;for(let i of this.children){if(!(i instanceof Ft)||/[^ -~]/.test(i.text))return null;let s=Ge(i.dom);if(s.length!=1)return null;t+=s[0].width,e=s[0].height}return t?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:t/this.length,textHeight:e}:null}coordsAt(t,e){let i=pa(this,t,e);if(!this.children.length&&i&&this.parent){let{heightOracle:s}=this.parent.view.viewState,r=i.bottom-i.top;if(Math.abs(r-s.lineHeight)<2&&s.textHeight=e){if(r instanceof Q)return r;if(o>e)break}s=o+r.breakAfter}return null}}class ne extends ${constructor(t,e,i){super(),this.widget=t,this.length=e,this.deco=i,this.breakAfter=0,this.prevWidget=null}merge(t,e,i,s,r,o){return i&&(!(i instanceof ne)||!this.widget.compare(i.widget)||t>0&&r<=0||e0}}class Vs extends Ie{constructor(t){super(),this.height=t}toDOM(){let t=document.createElement("div");return t.className="cm-gap",this.updateDOM(t),t}eq(t){return t.height==this.height}updateDOM(t){return t.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class xi{constructor(t,e,i,s){this.doc=t,this.pos=e,this.end=i,this.disallowBlockEffectsFor=s,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=t.iter(),this.skip=e}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let t=this.content[this.content.length-1];return!(t.breakAfter||t instanceof ne&&t.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new Q),this.atCursorPos=!0),this.curLine}flushBuffer(t=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(Ki(new Je(-1),t),t.length),this.pendingBuffer=0)}addBlockWidget(t){this.flushBuffer(),this.curLine=null,this.content.push(t)}finish(t){this.pendingBuffer&&t<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(t&&this.content.length&&this.content[this.content.length-1]instanceof ne)&&this.getLine()}buildText(t,e,i){for(;t>0;){if(this.textOff==this.text.length){let{value:r,lineBreak:o,done:l}=this.cursor.next(this.skip);if(this.skip=0,l)throw new Error("Ran out of text content when drawing inline views");if(o){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,t--;continue}else this.text=r,this.textOff=0}let s=Math.min(this.text.length-this.textOff,t,512);this.flushBuffer(e.slice(e.length-i)),this.getLine().append(Ki(new Ft(this.text.slice(this.textOff,this.textOff+s)),e),i),this.atCursorPos=!0,this.textOff+=s,t-=s,i=0}}span(t,e,i,s){this.buildText(e-t,i,s),this.pos=e,this.openStart<0&&(this.openStart=s)}point(t,e,i,s,r,o){if(this.disallowBlockEffectsFor[o]&&i instanceof ge){if(i.block)throw new RangeError("Block decorations may not be specified via plugins");if(e>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let l=e-t;if(i instanceof ge)if(i.block)i.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new ne(i.widget||Ye.block,l,i));else{let a=ve.create(i.widget||Ye.inline,l,l?0:i.startSide),c=this.atCursorPos&&!a.isEditable&&r<=s.length&&(t0),h=!a.isEditable&&(ts.length||i.startSide<=0),f=this.getLine();this.pendingBuffer==2&&!c&&!a.isEditable&&(this.pendingBuffer=0),this.flushBuffer(s),c&&(f.append(Ki(new Je(1),s),r),r=s.length+Math.max(0,r-s.length)),f.append(Ki(a,s),r),this.atCursorPos=h,this.pendingBuffer=h?ts.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=s.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(i);l&&(this.textOff+l<=this.text.length?this.textOff+=l:(this.skip+=l-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=e),this.openStart<0&&(this.openStart=r)}static build(t,e,i,s,r){let o=new xi(t,e,i,r);return o.openEnd=K.spans(s,e,i,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}}function Ki(n,t){for(let e of t)n=new re(e,[n],n.length);return n}class Ye extends Ie{constructor(t){super(),this.tag=t}eq(t){return t.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(t){return t.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}Ye.inline=new Ye("span");Ye.block=new Ye("div");var X=function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n}(X||(X={}));const Pe=X.LTR,yr=X.RTL;function ma(n){let t=[];for(let e=0;e=e){if(l.level==i)return o;(r<0||(s!=0?s<0?l.frome:t[r].level>l.level))&&(r=o)}}if(r<0)throw new RangeError("Index out of range");return r}}function ba(n,t){if(n.length!=t.length)return!1;for(let e=0;e=0;g-=3)if(qt[g+1]==-d){let m=qt[g+2],y=m&2?s:m&4?m&1?r:s:0;y&&(q[f]=q[qt[g]]=y),l=g;break}}else{if(qt.length==189)break;qt[l++]=f,qt[l++]=u,qt[l++]=a}else if((p=q[f])==2||p==1){let g=p==s;a=g?0:1;for(let m=l-3;m>=0;m-=3){let y=qt[m+2];if(y&2)break;if(g)qt[m+2]|=2;else{if(y&4)break;qt[m+2]|=4}}}}}function pf(n,t,e,i){for(let s=0,r=i;s<=e.length;s++){let o=s?e[s-1].to:n,l=sa;)p==m&&(p=e[--g].from,m=g?e[g-1].to:n),q[--p]=d;a=h}else r=c,a++}}}function Ws(n,t,e,i,s,r,o){let l=i%2?2:1;if(i%2==s%2)for(let a=t,c=0;aa&&o.push(new fe(a,g.from,d));let m=g.direction==Pe!=!(d%2);zs(n,m?i+1:i,s,g.inner,g.from,g.to,o),a=g.to}p=g.to}else{if(p==e||(h?q[p]!=l:q[p]==l))break;p++}u?Ws(n,a,p,i+1,s,u,o):at;){let h=!0,f=!1;if(!c||a>r[c-1].to){let g=q[a-1];g!=l&&(h=!1,f=g==16)}let u=!h&&l==1?[]:null,d=h?i:i+1,p=a;t:for(;;)if(c&&p==r[c-1].to){if(f)break t;let g=r[--c];if(!h)for(let m=g.from,y=c;;){if(m==t)break t;if(y&&r[y-1].to==m)m=r[--y].from;else{if(q[m-1]==l)break t;break}}if(u)u.push(g);else{g.toq.length;)q[q.length]=256;let i=[],s=t==Pe?0:1;return zs(n,s,s,e,0,n.length,i),i}function xa(n){return[new fe(0,n,0)]}let wa="";function mf(n,t,e,i,s){var r;let o=i.head-n.from,l=fe.find(t,o,(r=i.bidiLevel)!==null&&r!==void 0?r:-1,i.assoc),a=t[l],c=a.side(s,e);if(o==c){let u=l+=s?1:-1;if(u<0||u>=t.length)return null;a=t[l=u],o=a.side(!s,e),c=a.side(s,e)}let h=rt(n.text,o,a.forward(s,e));(ha.to)&&(h=c),wa=n.text.slice(Math.min(o,h),Math.max(o,h));let f=l==(s?t.length-1:0)?null:t[l+(s?1:-1)];return f&&h==c&&f.level+(s?0:1)n.some(t=>t)}),Oa=T.define({combine:n=>n.some(t=>t)}),Ta=T.define();class Ke{constructor(t,e="nearest",i="nearest",s=5,r=5,o=!1){this.range=t,this.y=e,this.x=i,this.yMargin=s,this.xMargin=r,this.isSnapshot=o}map(t){return t.empty?this:new Ke(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new Ke(b.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const $i=N.define({map:(n,t)=>n.map(t)}),Ba=N.define();function At(n,t,e){let i=n.facet(Ca);i.length?i[0](t):window.onerror?window.onerror(String(t),e,void 0,void 0,t):e?console.error(e+":",t):console.error(t)}const ie=T.define({combine:n=>n.length?n[0]:!0});let bf=0;const fi=T.define();class ft{constructor(t,e,i,s,r){this.id=t,this.create=e,this.domEventHandlers=i,this.domEventObservers=s,this.extension=r(this)}static define(t,e){const{eventHandlers:i,eventObservers:s,provide:r,decorations:o}=e||{};return new ft(bf++,t,i,s,l=>{let a=[fi.of(l)];return o&&a.push(Ci.of(c=>{let h=c.plugin(l);return h?o(h):P.none})),r&&a.push(r(l)),a})}static fromClass(t,e){return ft.define(i=>new t(i),e)}}class ts{constructor(t){this.spec=t,this.mustUpdate=null,this.value=null}update(t){if(this.value){if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(i){if(At(e.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(t)}catch(e){At(t.state,e,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(t){var e;if(!((e=this.value)===null||e===void 0)&&e.destroy)try{this.value.destroy()}catch(i){At(t.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const Pa=T.define(),wr=T.define(),Ci=T.define(),Ra=T.define(),Sr=T.define(),La=T.define();function go(n,t){let e=n.state.facet(La);if(!e.length)return e;let i=e.map(r=>r instanceof Function?r(n):r),s=[];return K.spans(i,t.from,t.to,{point(){},span(r,o,l,a){let c=r-t.from,h=o-t.from,f=s;for(let u=l.length-1;u>=0;u--,a--){let d=l[u].spec.bidiIsolate,p;if(d==null&&(d=yf(t.text,c,h)),a>0&&f.length&&(p=f[f.length-1]).to==c&&p.direction==d)p.to=h,f=p.inner;else{let g={from:c,to:h,direction:d,inner:[]};f.push(g),f=g.inner}}}}),s}const Ea=T.define();function kr(n){let t=0,e=0,i=0,s=0;for(let r of n.state.facet(Ea)){let o=r(n);o&&(o.left!=null&&(t=Math.max(t,o.left)),o.right!=null&&(e=Math.max(e,o.right)),o.top!=null&&(i=Math.max(i,o.top)),o.bottom!=null&&(s=Math.max(s,o.bottom)))}return{left:t,right:e,top:i,bottom:s}}const ui=T.define();class Et{constructor(t,e,i,s){this.fromA=t,this.toA=e,this.fromB=i,this.toB=s}join(t){return new Et(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(t){let e=t.length,i=this;for(;e>0;e--){let s=t[e-1];if(!(s.fromA>i.toA)){if(s.toAh)break;r+=2}if(!a)return i;new Et(a.fromA,a.toA,a.fromB,a.toB).addToSet(i),o=a.toA,l=a.toB}}}class Sn{constructor(t,e,i){this.view=t,this.state=e,this.transactions=i,this.flags=0,this.startState=t.state,this.changes=tt.empty(this.startState.doc.length);for(let r of i)this.changes=this.changes.compose(r.changes);let s=[];this.changes.iterChangedRanges((r,o,l,a)=>s.push(new Et(r,o,l,a))),this.changedRanges=s}static create(t,e,i){return new Sn(t,e,i)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(t=>t.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class mo extends ${get length(){return this.view.state.doc.length}constructor(t){super(),this.view=t,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=P.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(t.contentDOM),this.children=[new Q],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new Et(0,0,0,t.state.doc.length)],0,null)}update(t){var e;let i=t.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:c,toA:h})=>hthis.minWidthTo)?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(t);let s=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((e=this.domChanged)===null||e===void 0)&&e.newSel?s=this.domChanged.newSel.head:!Af(t.changes,this.hasComposition)&&!t.selectionSet&&(s=t.state.selection.main.head));let r=s>-1?wf(this.view,t.changes,s):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:c,to:h}=this.hasComposition;i=new Et(c,h,t.changes.mapPos(c,-1),t.changes.mapPos(h,1)).addToSet(i.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(D.ie||D.chrome)&&!r&&t&&t.state.doc.lines!=t.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.updateDeco(),a=vf(o,l,t.changes);return i=Et.extendWithRanges(i,a),!(this.flags&7)&&i.length==0?!1:(this.updateInner(i,t.startState.doc.length,r),t.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(t,e,i){this.view.viewState.mustMeasureContent=!0,this.updateChildren(t,e,i);let{observer:s}=this.view;s.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let o=D.chrome||D.ios?{node:s.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,o),this.flags&=-8,o&&(o.written||s.selectionRange.focusNode!=o.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(o=>o.flags&=-9);let r=[];if(this.view.viewport.from||this.view.viewport.to=0?s[o]:null;if(!l)break;let{fromA:a,toA:c,fromB:h,toB:f}=l,u,d,p,g;if(i&&i.range.fromBh){let k=xi.build(this.view.state.doc,h,i.range.fromB,this.decorations,this.dynamicDecorationMap),w=xi.build(this.view.state.doc,i.range.toB,f,this.decorations,this.dynamicDecorationMap);d=k.breakAtStart,p=k.openStart,g=w.openEnd;let v=this.compositionView(i);w.breakAtStart?v.breakAfter=1:w.content.length&&v.merge(v.length,v.length,w.content[0],!1,w.openStart,0)&&(v.breakAfter=w.content[0].breakAfter,w.content.shift()),k.content.length&&v.merge(0,0,k.content[k.content.length-1],!0,0,k.openEnd)&&k.content.pop(),u=k.content.concat(v).concat(w.content)}else({content:u,breakAtStart:d,openStart:p,openEnd:g}=xi.build(this.view.state.doc,h,f,this.decorations,this.dynamicDecorationMap));let{i:m,off:y}=r.findPos(c,1),{i:x,off:S}=r.findPos(a,-1);aa(this,x,S,m,y,u,d,p,g)}i&&this.fixCompositionDOM(i)}updateEditContextFormatting(t){this.editContextFormatting=this.editContextFormatting.map(t.changes);for(let e of t.transactions)for(let i of e.effects)i.is(Ba)&&(this.editContextFormatting=i.value)}compositionView(t){let e=new Ft(t.text.nodeValue);e.flags|=8;for(let{deco:s}of t.marks)e=new re(s,[e],e.length);let i=new Q;return i.append(e,0),i}fixCompositionDOM(t){let e=(r,o)=>{o.flags|=8|(o.children.some(a=>a.flags&7)?1:0),this.markedForComposition.add(o);let l=$.get(r);l&&l!=o&&(l.dom=null),o.setDOM(r)},i=this.childPos(t.range.fromB,1),s=this.children[i.i];e(t.line,s);for(let r=t.marks.length-1;r>=-1;r--)i=s.childPos(i.off,1),s=s.children[i.i],e(r>=0?t.marks[r].node:t.text,s)}updateSelection(t=!1,e=!1){(t||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let i=this.view.root.activeElement,s=i==this.dom,r=!s&&!(this.view.state.facet(ie)||this.dom.tabIndex>-1)&&cn(this.dom,this.view.observer.selectionRange)&&!(i&&this.dom.contains(i));if(!(s||e||r))return;let o=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(l.anchor)),c=l.empty?a:this.moveToLine(this.domAtPos(l.head));if(D.gecko&&l.empty&&!this.hasComposition&&xf(a)){let f=document.createTextNode("");this.view.observer.ignore(()=>a.node.insertBefore(f,a.node.childNodes[a.offset]||null)),a=c=new ht(f,0),o=!0}let h=this.view.observer.selectionRange;(o||!h.focusNode||(!bi(a.node,a.offset,h.anchorNode,h.anchorOffset)||!bi(c.node,c.offset,h.focusNode,h.focusOffset))&&!this.suppressWidgetCursorChange(h,l))&&(this.view.observer.ignore(()=>{D.android&&D.chrome&&this.dom.contains(h.focusNode)&&Cf(h.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let f=vi(this.view.root);if(f)if(l.empty){if(D.gecko){let u=Sf(a.node,a.offset);if(u&&u!=3){let d=(u==1?ra:oa)(a.node,a.offset);d&&(a=new ht(d.node,d.offset))}}f.collapse(a.node,a.offset),l.bidiLevel!=null&&f.caretBidiLevel!==void 0&&(f.caretBidiLevel=l.bidiLevel)}else if(f.extend){f.collapse(a.node,a.offset);try{f.extend(c.node,c.offset)}catch{}}else{let u=document.createRange();l.anchor>l.head&&([a,c]=[c,a]),u.setEnd(c.node,c.offset),u.setStart(a.node,a.offset),f.removeAllRanges(),f.addRange(u)}r&&this.view.root.activeElement==this.dom&&(this.dom.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(a,c)),this.impreciseAnchor=a.precise?null:new ht(h.anchorNode,h.anchorOffset),this.impreciseHead=c.precise?null:new ht(h.focusNode,h.focusOffset)}suppressWidgetCursorChange(t,e){return this.hasComposition&&e.empty&&bi(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)&&this.posFromDOM(t.focusNode,t.focusOffset)==e.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:t}=this,e=t.state.selection.main,i=vi(t.root),{anchorNode:s,anchorOffset:r}=t.observer.selectionRange;if(!i||!e.empty||!e.assoc||!i.modify)return;let o=Q.find(this,e.head);if(!o)return;let l=o.posAtStart;if(e.head==l||e.head==l+o.length)return;let a=this.coordsAt(e.head,-1),c=this.coordsAt(e.head,1);if(!a||!c||a.bottom>c.top)return;let h=this.domAtPos(e.head+e.assoc);i.collapse(h.node,h.offset),i.modify("move",e.assoc<0?"forward":"backward","lineboundary"),t.observer.readSelectionRange();let f=t.observer.selectionRange;t.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=e.from&&i.collapse(s,r)}moveToLine(t){let e=this.dom,i;if(t.node!=e)return t;for(let s=t.offset;!i&&s=0;s--){let r=$.get(e.childNodes[s]);r instanceof Q&&(i=r.domAtPos(r.length))}return i?new ht(i.node,i.offset,!0):t}nearest(t){for(let e=t;e;){let i=$.get(e);if(i&&i.rootView==this)return i;e=e.parentNode}return null}posFromDOM(t,e){let i=this.nearest(t);if(!i)throw new RangeError("Trying to find position for a DOM position outside of the document");return i.localPosFromDOM(t,e)+i.posAtStart}domAtPos(t){let{i:e,off:i}=this.childCursor().findPos(t,-1);for(;e=0;o--){let l=this.children[o],a=r-l.breakAfter,c=a-l.length;if(at||l.covers(1))&&(!i||l instanceof Q&&!(i instanceof Q&&e>=0)))i=l,s=c;else if(i&&c==t&&a==t&&l instanceof ne&&Math.abs(e)<2){if(l.deco.startSide<0)break;o&&(i=null)}r=c}return i?i.coordsAt(t-s,e):null}coordsForChar(t){let{i:e,off:i}=this.childPos(t,1),s=this.children[e];if(!(s instanceof Q))return null;for(;s.children.length;){let{i:l,off:a}=s.childPos(i,1);for(;;l++){if(l==s.children.length)return null;if((s=s.children[l]).length)break}i=a}if(!(s instanceof Ft))return null;let r=rt(s.text,i);if(r==i)return null;let o=Be(s.dom,i,r).getClientRects();for(let l=0;lMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==X.LTR;for(let c=0,h=0;hs)break;if(c>=i){let d=f.dom.getBoundingClientRect();if(e.push(d.height),o){let p=f.dom.lastChild,g=p?Ge(p):[];if(g.length){let m=g[g.length-1],y=a?m.right-d.left:d.right-m.left;y>l&&(l=y,this.minWidth=r,this.minWidthFrom=c,this.minWidthTo=u)}}}c=u+f.breakAfter}return e}textDirectionAt(t){let{i:e}=this.childPos(t,1);return getComputedStyle(this.children[e].dom).direction=="rtl"?X.RTL:X.LTR}measureTextSize(){for(let r of this.children)if(r instanceof Q){let o=r.measureTextSize();if(o)return o}let t=document.createElement("div"),e,i,s;return t.className="cm-line",t.style.width="99999px",t.style.position="absolute",t.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(t);let r=Ge(t.firstChild)[0];e=t.getBoundingClientRect().height,i=r?r.width/27:7,s=r?r.height:e,t.remove()}),{lineHeight:e,charWidth:i,textHeight:s}}childCursor(t=this.length){let e=this.children.length;return e&&(t-=this.children[--e].length),new la(this.children,t,e)}computeBlockGapDeco(){let t=[],e=this.view.viewState;for(let i=0,s=0;;s++){let r=s==e.viewports.length?null:e.viewports[s],o=r?r.from-1:this.length;if(o>i){let l=(e.lineBlockAt(o).bottom-e.lineBlockAt(i).top)/this.view.scaleY;t.push(P.replace({widget:new Vs(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!r)break;i=r.to+1}return P.set(t)}updateDeco(){let t=1,e=this.view.state.facet(Ci).map(r=>(this.dynamicDecorationMap[t++]=typeof r=="function")?r(this.view):r),i=!1,s=this.view.state.facet(Ra).map((r,o)=>{let l=typeof r=="function";return l&&(i=!0),l?r(this.view):r});for(s.length&&(this.dynamicDecorationMap[t++]=i,e.push(K.join(s))),this.decorations=[this.editContextFormatting,...e,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];te.anchor?-1:1),s;if(!i)return;!e.empty&&(s=this.coordsAt(e.anchor,e.anchor>e.head?-1:1))&&(i={left:Math.min(i.left,s.left),top:Math.min(i.top,s.top),right:Math.max(i.right,s.right),bottom:Math.max(i.bottom,s.bottom)});let r=kr(this.view),o={left:i.left-r.left,top:i.top-r.top,right:i.right+r.right,bottom:i.bottom+r.bottom},{offsetWidth:l,offsetHeight:a}=this.view.scrollDOM;Qc(this.view.scrollDOM,o,e.head{it.from&&(e=!0)}),e}function Mf(n,t,e=1){let i=n.charCategorizer(t),s=n.doc.lineAt(t),r=t-s.from;if(s.length==0)return b.cursor(t);r==0?e=1:r==s.length&&(e=-1);let o=r,l=r;e<0?o=rt(s.text,r,!1):l=rt(s.text,r);let a=i(s.text.slice(o,l));for(;o>0;){let c=rt(s.text,o,!1);if(i(s.text.slice(c,o))!=a)break;o=c}for(;ln?t.left-n:Math.max(0,n-t.right)}function Of(n,t){return t.top>n?t.top-n:Math.max(0,n-t.bottom)}function es(n,t){return n.topt.top+1}function yo(n,t){return tn.bottom?{top:n.top,left:n.left,right:n.right,bottom:t}:n}function Ks(n,t,e){let i,s,r,o,l=!1,a,c,h,f;for(let p=n.firstChild;p;p=p.nextSibling){let g=Ge(p);for(let m=0;mS||o==S&&r>x){i=p,s=y,r=x,o=S;let k=S?e0?m0)}x==0?e>y.bottom&&(!h||h.bottomy.top)&&(c=p,f=y):h&&es(h,y)?h=bo(h,y.bottom):f&&es(f,y)&&(f=yo(f,y.top))}}if(h&&h.bottom>=e?(i=a,s=h):f&&f.top<=e&&(i=c,s=f),!i)return{node:n,offset:0};let u=Math.max(s.left,Math.min(s.right,t));if(i.nodeType==3)return xo(i,u,e);if(l&&i.contentEditable!="false")return Ks(i,u,e);let d=Array.prototype.indexOf.call(n.childNodes,i)+(t>=(s.left+s.right)/2?1:0);return{node:n,offset:d}}function xo(n,t,e){let i=n.nodeValue.length,s=-1,r=1e9,o=0;for(let l=0;le?h.top-e:e-h.bottom)-1;if(h.left-1<=t&&h.right+1>=t&&f=(h.left+h.right)/2,d=u;if((D.chrome||D.gecko)&&Be(n,l).getBoundingClientRect().left==h.right&&(d=!u),f<=0)return{node:n,offset:l+(d?1:0)};s=l+(d?1:0),r=f}}}return{node:n,offset:s>-1?s:o>0?n.nodeValue.length:0}}function Na(n,t,e,i=-1){var s,r;let o=n.contentDOM.getBoundingClientRect(),l=o.top+n.viewState.paddingTop,a,{docHeight:c}=n.viewState,{x:h,y:f}=t,u=f-l;if(u<0)return 0;if(u>c)return n.state.doc.length;for(let k=n.viewState.heightOracle.textHeight/2,w=!1;a=n.elementAtHeight(u),a.type!=Mt.Text;)for(;u=i>0?a.bottom+k:a.top-k,!(u>=0&&u<=c);){if(w)return e?null:0;w=!0,i=-i}f=l+u;let d=a.from;if(dn.viewport.to)return n.viewport.to==n.state.doc.length?n.state.doc.length:e?null:wo(n,o,a,h,f);let p=n.dom.ownerDocument,g=n.root.elementFromPoint?n.root:p,m=g.elementFromPoint(h,f);m&&!n.contentDOM.contains(m)&&(m=null),m||(h=Math.max(o.left+1,Math.min(o.right-1,h)),m=g.elementFromPoint(h,f),m&&!n.contentDOM.contains(m)&&(m=null));let y,x=-1;if(m&&((s=n.docView.nearest(m))===null||s===void 0?void 0:s.isEditable)!=!1){if(p.caretPositionFromPoint){let k=p.caretPositionFromPoint(h,f);k&&({offsetNode:y,offset:x}=k)}else if(p.caretRangeFromPoint){let k=p.caretRangeFromPoint(h,f);k&&({startContainer:y,startOffset:x}=k,(!n.contentDOM.contains(y)||D.safari&&Tf(y,x,h)||D.chrome&&Bf(y,x,h))&&(y=void 0))}y&&(x=Math.min(Zt(y),x))}if(!y||!n.docView.dom.contains(y)){let k=Q.find(n.docView,d);if(!k)return u>a.top+a.height/2?a.to:a.from;({node:y,offset:x}=Ks(k.dom,h,f))}let S=n.docView.nearest(y);if(!S)return null;if(S.isWidget&&((r=S.dom)===null||r===void 0?void 0:r.nodeType)==1){let k=S.dom.getBoundingClientRect();return t.yn.defaultLineHeight*1.5){let l=n.viewState.heightOracle.textHeight,a=Math.floor((s-e.top-(n.defaultLineHeight-l)*.5)/l);r+=a*n.viewState.heightOracle.lineLength}let o=n.state.sliceDoc(e.from,e.to);return e.from+Ts(o,r,n.state.tabSize)}function Tf(n,t,e){let i;if(n.nodeType!=3||t!=(i=n.nodeValue.length))return!1;for(let s=n.nextSibling;s;s=s.nextSibling)if(s.nodeType!=1||s.nodeName!="BR")return!1;return Be(n,i-1,i).getBoundingClientRect().left>e}function Bf(n,t,e){if(t!=0)return!1;for(let s=n;;){let r=s.parentNode;if(!r||r.nodeType!=1||r.firstChild!=s)return!1;if(r.classList.contains("cm-line"))break;s=r}let i=n.nodeType==1?n.getBoundingClientRect():Be(n,0,Math.max(n.nodeValue.length,1)).getBoundingClientRect();return e-i.left>5}function $s(n,t){let e=n.lineBlockAt(t);if(Array.isArray(e.type)){for(let i of e.type)if(i.to>t||i.to==t&&(i.to==e.to||i.type==Mt.Text))return i}return e}function Pf(n,t,e,i){let s=$s(n,t.head),r=!i||s.type!=Mt.Text||!(n.lineWrapping||s.widgetLineBreaks)?null:n.coordsAtPos(t.assoc<0&&t.head>s.from?t.head-1:t.head);if(r){let o=n.dom.getBoundingClientRect(),l=n.textDirectionAt(s.from),a=n.posAtCoords({x:e==(l==X.LTR)?o.right-1:o.left+1,y:(r.top+r.bottom)/2});if(a!=null)return b.cursor(a,e?-1:1)}return b.cursor(e?s.to:s.from,e?-1:1)}function So(n,t,e,i){let s=n.state.doc.lineAt(t.head),r=n.bidiSpans(s),o=n.textDirectionAt(s.from);for(let l=t,a=null;;){let c=mf(s,r,o,l,e),h=wa;if(!c){if(s.number==(e?n.state.doc.lines:1))return l;h=` +`,s=n.state.doc.line(s.number+(e?1:-1)),r=n.bidiSpans(s),c=n.visualLineSide(s,!e)}if(a){if(!a(h))return l}else{if(!i)return c;a=i(h)}l=c}}function Rf(n,t,e){let i=n.state.charCategorizer(t),s=i(e);return r=>{let o=i(r);return s==J.Space&&(s=o),s==o}}function Lf(n,t,e,i){let s=t.head,r=e?1:-1;if(s==(e?n.state.doc.length:0))return b.cursor(s,t.assoc);let o=t.goalColumn,l,a=n.contentDOM.getBoundingClientRect(),c=n.coordsAtPos(s,t.assoc||-1),h=n.documentTop;if(c)o==null&&(o=c.left-a.left),l=r<0?c.top:c.bottom;else{let d=n.viewState.lineBlockAt(s);o==null&&(o=Math.min(a.right-a.left,n.defaultCharacterWidth*(s-d.from))),l=(r<0?d.top:d.bottom)+h}let f=a.left+o,u=i??n.viewState.heightOracle.textHeight>>1;for(let d=0;;d+=10){let p=l+(u+d)*r,g=Na(n,{x:f,y:p},!1,r);if(pa.bottom||(r<0?gs)){let m=n.docView.coordsForChar(g),y=!m||p{if(t>r&&ts(n)),e.from,t.head>e.from?-1:1);return i==e.from?e:b.cursor(i,ir)&&this.lineBreak(),s=o}return this.findPointBefore(i,e),this}readTextNode(t){let e=t.nodeValue;for(let i of this.points)i.node==t&&(i.pos=this.text.length+Math.min(i.offset,e.length));for(let i=0,s=this.lineSeparator?null:/\r\n?|\n/g;;){let r=-1,o=1,l;if(this.lineSeparator?(r=e.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(l=s.exec(e))&&(r=l.index,o=l[0].length),this.append(e.slice(i,r<0?e.length:r)),r<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==t&&a.pos>this.text.length&&(a.pos-=o-1);i=r+o}}readNode(t){if(t.cmIgnore)return;let e=$.get(t),i=e&&e.overrideDOMText;if(i!=null){this.findPointInside(t,i.length);for(let s=i.iter();!s.next().done;)s.lineBreak?this.lineBreak():this.append(s.value)}else t.nodeType==3?this.readTextNode(t):t.nodeName=="BR"?t.nextSibling&&this.lineBreak():t.nodeType==1&&this.readRange(t.firstChild,null)}findPointBefore(t,e){for(let i of this.points)i.node==t&&t.childNodes[i.offset]==e&&(i.pos=this.text.length)}findPointInside(t,e){for(let i of this.points)(t.nodeType==3?i.node==t:t.contains(i.node))&&(i.pos=this.text.length+(If(t,i.node,i.offset)?e:0))}}function If(n,t,e){for(;;){if(!t||e-1;let{impreciseHead:r,impreciseAnchor:o}=t.docView;if(t.state.readOnly&&e>-1)this.newSel=null;else if(e>-1&&(this.bounds=t.docView.domBoundsAround(e,i,0))){let l=r||o?[]:Hf(t),a=new Ef(l,t.state);a.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=a.text,this.newSel=Wf(l,this.bounds.from)}else{let l=t.observer.selectionRange,a=r&&r.node==l.focusNode&&r.offset==l.focusOffset||!Rs(t.contentDOM,l.focusNode)?t.state.selection.main.head:t.docView.posFromDOM(l.focusNode,l.focusOffset),c=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!Rs(t.contentDOM,l.anchorNode)?t.state.selection.main.anchor:t.docView.posFromDOM(l.anchorNode,l.anchorOffset),h=t.viewport;if((D.ios||D.chrome)&&t.state.selection.main.empty&&a!=c&&(h.from>0||h.toDate.now()-100?n.inputState.lastKeyCode:-1;if(t.bounds){let{from:o,to:l}=t.bounds,a=s.from,c=null;(r===8||D.android&&t.text.length=s.from&&e.to<=s.to&&(e.from!=s.from||e.to!=s.to)&&s.to-s.from-(e.to-e.from)<=4?e={from:s.from,to:s.to,insert:n.state.doc.slice(s.from,e.from).append(e.insert).append(n.state.doc.slice(e.to,s.to))}:(D.mac||D.android)&&e&&e.from==e.to&&e.from==s.head-1&&/^\. ?$/.test(e.insert.toString())&&n.contentDOM.getAttribute("autocorrect")=="off"?(i&&e.insert.length==2&&(i=b.single(i.main.anchor-1,i.main.head-1)),e={from:s.from,to:s.to,insert:F.of([" "])}):D.chrome&&e&&e.from==e.to&&e.from==s.head&&e.insert.toString()==` + `&&n.lineWrapping&&(i&&(i=b.single(i.main.anchor-1,i.main.head-1)),e={from:s.from,to:s.to,insert:F.of([" "])}),e)return vr(n,e,i,r);if(i&&!i.main.eq(s)){let o=!1,l="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(o=!0),l=n.inputState.lastSelectionOrigin),n.dispatch({selection:i,scrollIntoView:o,userEvent:l}),!0}else return!1}function vr(n,t,e,i=-1){if(D.ios&&n.inputState.flushIOSKey(t))return!0;let s=n.state.selection.main;if(D.android&&(t.to==s.to&&(t.from==s.from||t.from==s.from-1&&n.state.sliceDoc(t.from,s.from)==" ")&&t.insert.length==1&&t.insert.lines==2&&qe(n.contentDOM,"Enter",13)||(t.from==s.from-1&&t.to==s.to&&t.insert.length==0||i==8&&t.insert.lengths.head)&&qe(n.contentDOM,"Backspace",8)||t.from==s.from&&t.to==s.to+1&&t.insert.length==0&&qe(n.contentDOM,"Delete",46)))return!0;let r=t.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let o,l=()=>o||(o=Ff(n,t,e));return n.state.facet(Aa).some(a=>a(n,t.from,t.to,r,l))||n.dispatch(l()),!0}function Ff(n,t,e){let i,s=n.state,r=s.selection.main;if(t.from>=r.from&&t.to<=r.to&&t.to-t.from>=(r.to-r.from)/3&&(!e||e.main.empty&&e.main.from==t.from+t.insert.length)&&n.inputState.composing<0){let l=r.fromt.to?s.sliceDoc(t.to,r.to):"";i=s.replaceSelection(n.state.toText(l+t.insert.sliceString(0,void 0,n.state.lineBreak)+a))}else{let l=s.changes(t),a=e&&e.main.to<=l.newLength?e.main:void 0;if(s.selection.ranges.length>1&&n.inputState.composing>=0&&t.to<=r.to&&t.to>=r.to-10){let c=n.state.sliceDoc(t.from,t.to),h,f=e&&Ia(n,e.main.head);if(f){let p=t.insert.length-(t.to-t.from);h={from:f.from,to:f.to-p}}else h=n.state.doc.lineAt(r.head);let u=r.to-t.to,d=r.to-r.from;i=s.changeByRange(p=>{if(p.from==r.from&&p.to==r.to)return{changes:l,range:a||p.map(l)};let g=p.to-u,m=g-c.length;if(p.to-p.from!=d||n.state.sliceDoc(m,g)!=c||p.to>=h.from&&p.from<=h.to)return{range:p};let y=s.changes({from:m,to:g,insert:t.insert}),x=p.to-r.to;return{changes:y,range:a?b.range(Math.max(0,a.anchor+x),Math.max(0,a.head+x)):p.map(y)}})}else i={changes:l,selection:a&&s.selection.replaceRange(a)}}let o="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,o+=".compose",n.inputState.compositionFirstChange&&(o+=".start",n.inputState.compositionFirstChange=!1)),s.update(i,{userEvent:o,scrollIntoView:!0})}function Vf(n,t,e,i){let s=Math.min(n.length,t.length),r=0;for(;r0&&l>0&&n.charCodeAt(o-1)==t.charCodeAt(l-1);)o--,l--;if(i=="end"){let a=Math.max(0,r-Math.min(o,l));e-=o+a-r}if(o=o?r-e:0;r-=a,l=r+(l-o),o=r}else if(l=l?r-e:0;r-=a,o=r+(o-l),l=r}return{from:r,toA:o,toB:l}}function Hf(n){let t=[];if(n.root.activeElement!=n.contentDOM)return t;let{anchorNode:e,anchorOffset:i,focusNode:s,focusOffset:r}=n.observer.selectionRange;return e&&(t.push(new ko(e,i)),(s!=e||r!=i)&&t.push(new ko(s,r))),t}function Wf(n,t){if(n.length==0)return null;let e=n[0].pos,i=n.length==2?n[1].pos:e;return e>-1&&i>-1?b.single(e+t,i+t):null}class zf{setSelectionOrigin(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now()}constructor(t){this.view=t,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=t.hasFocus,D.safari&&t.contentDOM.addEventListener("input",()=>null),D.gecko&&nu(t.contentDOM.ownerDocument)}handleEvent(t){!Yf(this.view,t)||this.ignoreDuringComposition(t)||t.type=="keydown"&&this.keydown(t)||this.runHandlers(t.type,t)}runHandlers(t,e){let i=this.handlers[t];if(i){for(let s of i.observers)s(this.view,e);for(let s of i.handlers){if(e.defaultPrevented)break;if(s(this.view,e)){e.preventDefault();break}}}}ensureHandlers(t){let e=qf(t),i=this.handlers,s=this.view.contentDOM;for(let r in e)if(r!="scroll"){let o=!e[r].handlers.length,l=i[r];l&&o!=!l.handlers.length&&(s.removeEventListener(r,this.handleEvent),l=null),l||s.addEventListener(r,this.handleEvent,{passive:o})}for(let r in i)r!="scroll"&&!e[r]&&s.removeEventListener(r,this.handleEvent);this.handlers=e}keydown(t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),t.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&t.keyCode!=27&&Ha.indexOf(t.keyCode)<0&&(this.tabFocusMode=-1),D.android&&D.chrome&&!t.synthetic&&(t.keyCode==13||t.keyCode==8))return this.view.observer.delayAndroidKey(t.key,t.keyCode),!0;let e;return D.ios&&!t.synthetic&&!t.altKey&&!t.metaKey&&((e=Va.find(i=>i.keyCode==t.keyCode))&&!t.ctrlKey||Kf.indexOf(t.key)>-1&&t.ctrlKey&&!t.shiftKey)?(this.pendingIOSKey=e||t,setTimeout(()=>this.flushIOSKey(),250),!0):(t.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(t){let e=this.pendingIOSKey;return!e||e.key=="Enter"&&t&&t.from0?!0:D.safari&&!D.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(t){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=t}update(t){this.view.observer.update(t),this.mouseSelection&&this.mouseSelection.update(t),this.draggedContent&&t.docChanged&&(this.draggedContent=this.draggedContent.map(t.changes)),t.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function vo(n,t){return(e,i)=>{try{return t.call(n,i,e)}catch(s){At(e.state,s)}}}function qf(n){let t=Object.create(null);function e(i){return t[i]||(t[i]={observers:[],handlers:[]})}for(let i of n){let s=i.spec;if(s&&s.domEventHandlers)for(let r in s.domEventHandlers){let o=s.domEventHandlers[r];o&&e(r).handlers.push(vo(i.value,o))}if(s&&s.domEventObservers)for(let r in s.domEventObservers){let o=s.domEventObservers[r];o&&e(r).observers.push(vo(i.value,o))}}for(let i in Vt)e(i).handlers.push(Vt[i]);for(let i in It)e(i).observers.push(It[i]);return t}const Va=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Kf="dthko",Ha=[16,17,18,20,91,92,224,225],ji=6;function Ui(n){return Math.max(0,n)*.7+8}function $f(n,t){return Math.max(Math.abs(n.clientX-t.clientX),Math.abs(n.clientY-t.clientY))}class jf{constructor(t,e,i,s){this.view=t,this.startEvent=e,this.style=i,this.mustSelect=s,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=e,this.scrollParents=Zc(t.contentDOM),this.atoms=t.state.facet(Sr).map(o=>o(t));let r=t.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=e.shiftKey,this.multiple=t.state.facet(H.allowMultipleSelections)&&Uf(t,e),this.dragging=Jf(t,e)&&qa(e)==1?null:!1}start(t){this.dragging===!1&&this.select(t)}move(t){if(t.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&$f(this.startEvent,t)<10)return;this.select(this.lastEvent=t);let e=0,i=0,s=0,r=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:s,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:r,bottom:l}=this.scrollParents.y.getBoundingClientRect());let a=kr(this.view);t.clientX-a.left<=s+ji?e=-Ui(s-t.clientX):t.clientX+a.right>=o-ji&&(e=Ui(t.clientX-o)),t.clientY-a.top<=r+ji?i=-Ui(r-t.clientY):t.clientY+a.bottom>=l-ji&&(i=Ui(t.clientY-l)),this.setScrollSpeed(e,i)}up(t){this.dragging==null&&this.select(this.lastEvent),this.dragging||t.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(t,e){this.scrollSpeed={x:t,y:e},t||e?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:t,y:e}=this.scrollSpeed;t&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=t,t=0),e&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=e,e=0),(t||e)&&this.view.win.scrollBy(t,e),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(t){let e=null;for(let i=0;ie.isUserEvent("input.type"))?this.destroy():this.style.update(t)&&setTimeout(()=>this.select(this.lastEvent),20)}}function Uf(n,t){let e=n.state.facet(Sa);return e.length?e[0](t):D.mac?t.metaKey:t.ctrlKey}function Gf(n,t){let e=n.state.facet(ka);return e.length?e[0](t):D.mac?!t.altKey:!t.ctrlKey}function Jf(n,t){let{main:e}=n.state.selection;if(e.empty)return!1;let i=vi(n.root);if(!i||i.rangeCount==0)return!0;let s=i.getRangeAt(0).getClientRects();for(let r=0;r=t.clientX&&o.top<=t.clientY&&o.bottom>=t.clientY)return!0}return!1}function Yf(n,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let e=t.target,i;e!=n.contentDOM;e=e.parentNode)if(!e||e.nodeType==11||(i=$.get(e))&&i.ignoreEvent(t))return!1;return!0}const Vt=Object.create(null),It=Object.create(null),Wa=D.ie&&D.ie_version<15||D.ios&&D.webkit_version<604;function Xf(n){let t=n.dom.parentNode;if(!t)return;let e=t.appendChild(document.createElement("textarea"));e.style.cssText="position: fixed; left: -10000px; top: 10px",e.focus(),setTimeout(()=>{n.focus(),e.remove(),za(n,e.value)},50)}function zn(n,t,e){for(let i of n.facet(t))e=i(e,n);return e}function za(n,t){t=zn(n.state,br,t);let{state:e}=n,i,s=1,r=e.toText(t),o=r.lines==e.selection.ranges.length;if(js!=null&&e.selection.ranges.every(a=>a.empty)&&js==r.toString()){let a=-1;i=e.changeByRange(c=>{let h=e.doc.lineAt(c.from);if(h.from==a)return{range:c};a=h.from;let f=e.toText((o?r.line(s++).text:t)+e.lineBreak);return{changes:{from:h.from,insert:f},range:b.cursor(c.from+f.length)}})}else o?i=e.changeByRange(a=>{let c=r.line(s++);return{changes:{from:a.from,to:a.to,insert:c.text},range:b.cursor(a.from+c.length)}}):i=e.replaceSelection(r);n.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}It.scroll=n=>{n.inputState.lastScrollTop=n.scrollDOM.scrollTop,n.inputState.lastScrollLeft=n.scrollDOM.scrollLeft};Vt.keydown=(n,t)=>(n.inputState.setSelectionOrigin("select"),t.keyCode==27&&n.inputState.tabFocusMode!=0&&(n.inputState.tabFocusMode=Date.now()+2e3),!1);It.touchstart=(n,t)=>{n.inputState.lastTouchTime=Date.now(),n.inputState.setSelectionOrigin("select.pointer")};It.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};Vt.mousedown=(n,t)=>{if(n.observer.flush(),n.inputState.lastTouchTime>Date.now()-2e3)return!1;let e=null;for(let i of n.state.facet(va))if(e=i(n,t),e)break;if(!e&&t.button==0&&(e=Zf(n,t)),e){let i=!n.hasFocus;n.inputState.startMouseSelection(new jf(n,t,e,i)),i&&n.observer.ignore(()=>{ia(n.contentDOM);let r=n.root.activeElement;r&&!r.contains(n.contentDOM)&&r.blur()});let s=n.inputState.mouseSelection;if(s)return s.start(t),s.dragging===!1}return!1};function Co(n,t,e,i){if(i==1)return b.cursor(t,e);if(i==2)return Mf(n.state,t,e);{let s=Q.find(n.docView,t),r=n.state.doc.lineAt(s?s.posAtEnd:t),o=s?s.posAtStart:r.from,l=s?s.posAtEnd:r.to;return lt>=e.top&&t<=e.bottom&&n>=e.left&&n<=e.right;function _f(n,t,e,i){let s=Q.find(n.docView,t);if(!s)return 1;let r=t-s.posAtStart;if(r==0)return 1;if(r==s.length)return-1;let o=s.coordsAt(r,-1);if(o&&Ao(e,i,o))return-1;let l=s.coordsAt(r,1);return l&&Ao(e,i,l)?1:o&&o.bottom>=i?-1:1}function Mo(n,t){let e=n.posAtCoords({x:t.clientX,y:t.clientY},!1);return{pos:e,bias:_f(n,e,t.clientX,t.clientY)}}const Qf=D.ie&&D.ie_version<=11;let Do=null,Oo=0,To=0;function qa(n){if(!Qf)return n.detail;let t=Do,e=To;return Do=n,To=Date.now(),Oo=!t||e>Date.now()-400&&Math.abs(t.clientX-n.clientX)<2&&Math.abs(t.clientY-n.clientY)<2?(Oo+1)%3:1}function Zf(n,t){let e=Mo(n,t),i=qa(t),s=n.state.selection;return{update(r){r.docChanged&&(e.pos=r.changes.mapPos(e.pos),s=s.map(r.changes))},get(r,o,l){let a=Mo(n,r),c,h=Co(n,a.pos,a.bias,i);if(e.pos!=a.pos&&!o){let f=Co(n,e.pos,e.bias,i),u=Math.min(f.from,h.from),d=Math.max(f.to,h.to);h=u1&&(c=tu(s,a.pos))?c:l?s.addRange(h):b.create([h])}}}function tu(n,t){for(let e=0;e=t)return b.create(n.ranges.slice(0,e).concat(n.ranges.slice(e+1)),n.mainIndex==e?0:n.mainIndex-(n.mainIndex>e?1:0))}return null}Vt.dragstart=(n,t)=>{let{selection:{main:e}}=n.state;if(t.target.draggable){let s=n.docView.nearest(t.target);if(s&&s.isWidget){let r=s.posAtStart,o=r+s.length;(r>=e.to||o<=e.from)&&(e=b.range(r,o))}}let{inputState:i}=n;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=e,t.dataTransfer&&(t.dataTransfer.setData("Text",zn(n.state,xr,n.state.sliceDoc(e.from,e.to))),t.dataTransfer.effectAllowed="copyMove"),!1};Vt.dragend=n=>(n.inputState.draggedContent=null,!1);function Bo(n,t,e,i){if(e=zn(n.state,br,e),!e)return;let s=n.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:r}=n.inputState,o=i&&r&&Gf(n,t)?{from:r.from,to:r.to}:null,l={from:s,insert:e},a=n.state.changes(o?[o,l]:l);n.focus(),n.dispatch({changes:a,selection:{anchor:a.mapPos(s,-1),head:a.mapPos(s,1)},userEvent:o?"move.drop":"input.drop"}),n.inputState.draggedContent=null}Vt.drop=(n,t)=>{if(!t.dataTransfer)return!1;if(n.state.readOnly)return!0;let e=t.dataTransfer.files;if(e&&e.length){let i=Array(e.length),s=0,r=()=>{++s==e.length&&Bo(n,t,i.filter(o=>o!=null).join(n.state.lineBreak),!1)};for(let o=0;o{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[o]=l.result),r()},l.readAsText(e[o])}return!0}else{let i=t.dataTransfer.getData("Text");if(i)return Bo(n,t,i,!0),!0}return!1};Vt.paste=(n,t)=>{if(n.state.readOnly)return!0;n.observer.flush();let e=Wa?null:t.clipboardData;return e?(za(n,e.getData("text/plain")||e.getData("text/uri-list")),!0):(Xf(n),!1)};function eu(n,t){let e=n.dom.parentNode;if(!e)return;let i=e.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=t,i.focus(),i.selectionEnd=t.length,i.selectionStart=0,setTimeout(()=>{i.remove(),n.focus()},50)}function iu(n){let t=[],e=[],i=!1;for(let s of n.selection.ranges)s.empty||(t.push(n.sliceDoc(s.from,s.to)),e.push(s));if(!t.length){let s=-1;for(let{from:r}of n.selection.ranges){let o=n.doc.lineAt(r);o.number>s&&(t.push(o.text),e.push({from:o.from,to:Math.min(n.doc.length,o.to+1)})),s=o.number}i=!0}return{text:zn(n,xr,t.join(n.lineBreak)),ranges:e,linewise:i}}let js=null;Vt.copy=Vt.cut=(n,t)=>{let{text:e,ranges:i,linewise:s}=iu(n.state);if(!e&&!s)return!1;js=s?e:null,t.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let r=Wa?null:t.clipboardData;return r?(r.clearData(),r.setData("text/plain",e),!0):(eu(n,e),!1)};const Ka=oe.define();function $a(n,t){let e=[];for(let i of n.facet(Ma)){let s=i(n,t);s&&e.push(s)}return e?n.update({effects:e,annotations:Ka.of(!0)}):null}function ja(n){setTimeout(()=>{let t=n.hasFocus;if(t!=n.inputState.notifiedFocused){let e=$a(n.state,t);e?n.dispatch(e):n.update([])}},10)}It.focus=n=>{n.inputState.lastFocusTime=Date.now(),!n.scrollDOM.scrollTop&&(n.inputState.lastScrollTop||n.inputState.lastScrollLeft)&&(n.scrollDOM.scrollTop=n.inputState.lastScrollTop,n.scrollDOM.scrollLeft=n.inputState.lastScrollLeft),ja(n)};It.blur=n=>{n.observer.clearSelectionRange(),ja(n)};It.compositionstart=It.compositionupdate=n=>{n.observer.editContext||(n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0))};It.compositionend=n=>{n.observer.editContext||(n.inputState.composing=-1,n.inputState.compositionEndedAt=Date.now(),n.inputState.compositionPendingKey=!0,n.inputState.compositionPendingChange=n.observer.pendingRecords().length>0,n.inputState.compositionFirstChange=null,D.chrome&&D.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.hasComposition&&n.update([])},50))};It.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};Vt.beforeinput=(n,t)=>{var e,i;if(t.inputType=="insertReplacementText"&&n.observer.editContext){let r=(e=t.dataTransfer)===null||e===void 0?void 0:e.getData("text/plain"),o=t.getTargetRanges();if(r&&o.length){let l=o[0],a=n.posAtDOM(l.startContainer,l.startOffset),c=n.posAtDOM(l.endContainer,l.endOffset);return vr(n,{from:a,to:c,insert:n.state.toText(r)},null),!0}}let s;if(D.chrome&&D.android&&(s=Va.find(r=>r.inputType==t.inputType))&&(n.observer.delayAndroidKey(s.key,s.keyCode),s.key=="Backspace"||s.key=="Delete")){let r=((i=window.visualViewport)===null||i===void 0?void 0:i.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>r+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}return D.ios&&t.inputType=="deleteContentForward"&&n.observer.flushSoon(),D.safari&&t.inputType=="insertText"&&n.inputState.composing>=0&&setTimeout(()=>It.compositionend(n,t),20),!1};const Po=new Set;function nu(n){Po.has(n)||(Po.add(n),n.addEventListener("copy",()=>{}),n.addEventListener("cut",()=>{}))}const Ro=["pre-wrap","normal","pre-line","break-spaces"];let Xe=!1;function Lo(){Xe=!1}class su{constructor(t){this.lineWrapping=t,this.doc=F.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(t,e){let i=this.doc.lineAt(e).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((e-t-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(t){return this.lineWrapping?(1+Math.max(0,Math.ceil((t-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(t){return this.doc=t,this}mustRefreshForWrapping(t){return Ro.indexOf(t)>-1!=this.lineWrapping}mustRefreshForHeights(t){let e=!1;for(let i=0;i-1,a=Math.round(e)!=Math.round(this.lineHeight)||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=e,this.charWidth=i,this.textHeight=s,this.lineLength=r,a){this.heightSamples={};for(let c=0;c0}set outdated(t){this.flags=(t?2:0)|this.flags&-3}setHeight(t){this.height!=t&&(Math.abs(this.height-t)>dn&&(Xe=!0),this.height=t)}replace(t,e,i){return pt.of(i)}decomposeLeft(t,e){e.push(this)}decomposeRight(t,e){e.push(this)}applyChanges(t,e,i,s){let r=this,o=i.doc;for(let l=s.length-1;l>=0;l--){let{fromA:a,toA:c,fromB:h,toB:f}=s[l],u=r.lineAt(a,G.ByPosNoHeight,i.setDoc(e),0,0),d=u.to>=c?u:r.lineAt(c,G.ByPosNoHeight,i,0,0);for(f+=d.to-c,c=d.to;l>0&&u.from<=s[l-1].toA;)a=s[l-1].fromA,h=s[l-1].fromB,l--,ar*2){let l=t[e-1];l.break?t.splice(--e,1,l.left,null,l.right):t.splice(--e,1,l.left,l.right),i+=1+l.break,s-=l.size}else if(r>s*2){let l=t[i];l.break?t.splice(i,1,l.left,null,l.right):t.splice(i,1,l.left,l.right),i+=2+l.break,r-=l.size}else break;else if(s=r&&o(this.blockAt(0,i,s,r))}updateHeight(t,e=0,i=!1,s){return s&&s.from<=e&&s.more&&this.setHeight(s.heights[s.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Ct extends Ua{constructor(t,e){super(t,e,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(t,e,i,s){return new Jt(s,this.length,i,this.height,this.breaks)}replace(t,e,i){let s=i[0];return i.length==1&&(s instanceof Ct||s instanceof nt&&s.flags&4)&&Math.abs(this.length-s.length)<10?(s instanceof nt?s=new Ct(s.length,this.height):s.height=this.height,this.outdated||(s.outdated=!1),s):pt.of(i)}updateHeight(t,e=0,i=!1,s){return s&&s.from<=e&&s.more?this.setHeight(s.heights[s.index++]):(i||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,t.heightForLine(this.length-this.collapsed))+this.breaks*t.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class nt extends pt{constructor(t){super(t,0)}heightMetrics(t,e){let i=t.doc.lineAt(e).number,s=t.doc.lineAt(e+this.length).number,r=s-i+1,o,l=0;if(t.lineWrapping){let a=Math.min(this.height,t.lineHeight*r);o=a/r,this.length>r+1&&(l=(this.height-a)/(this.length-r-1))}else o=this.height/r;return{firstLine:i,lastLine:s,perLine:o,perChar:l}}blockAt(t,e,i,s){let{firstLine:r,lastLine:o,perLine:l,perChar:a}=this.heightMetrics(e,s);if(e.lineWrapping){let c=s+(t0){let r=i[i.length-1];r instanceof nt?i[i.length-1]=new nt(r.length+s):i.push(null,new nt(s-1))}if(t>0){let r=i[0];r instanceof nt?i[0]=new nt(t+r.length):i.unshift(new nt(t-1),null)}return pt.of(i)}decomposeLeft(t,e){e.push(new nt(t-1),null)}decomposeRight(t,e){e.push(null,new nt(this.length-t-1))}updateHeight(t,e=0,i=!1,s){let r=e+this.length;if(s&&s.from<=e+this.length&&s.more){let o=[],l=Math.max(e,s.from),a=-1;for(s.from>e&&o.push(new nt(s.from-e-1).updateHeight(t,e));l<=r&&s.more;){let h=t.doc.lineAt(l).length;o.length&&o.push(null);let f=s.heights[s.index++];a==-1?a=f:Math.abs(f-a)>=dn&&(a=-2);let u=new Ct(h,f);u.outdated=!1,o.push(u),l+=h+1}l<=r&&o.push(null,new nt(r-l).updateHeight(t,l));let c=pt.of(o);return(a<0||Math.abs(c.height-this.height)>=dn||Math.abs(a-this.heightMetrics(t,e).perLine)>=dn)&&(Xe=!0),kn(this,c)}else(i||this.outdated)&&(this.setHeight(t.heightForGap(e,e+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class ou extends pt{constructor(t,e,i){super(t.length+e+i.length,t.height+i.height,e|(t.outdated||i.outdated?2:0)),this.left=t,this.right=i,this.size=t.size+i.size}get break(){return this.flags&1}blockAt(t,e,i,s){let r=i+this.left.height;return tl))return c;let h=e==G.ByPosNoHeight?G.ByPosNoHeight:G.ByPos;return a?c.join(this.right.lineAt(l,h,i,o,l)):this.left.lineAt(l,h,i,s,r).join(c)}forEachLine(t,e,i,s,r,o){let l=s+this.left.height,a=r+this.left.length+this.break;if(this.break)t=a&&this.right.forEachLine(t,e,i,l,a,o);else{let c=this.lineAt(a,G.ByPos,i,s,r);t=t&&c.from<=e&&o(c),e>c.to&&this.right.forEachLine(c.to+1,e,i,l,a,o)}}replace(t,e,i){let s=this.left.length+this.break;if(ethis.left.length)return this.balanced(this.left,this.right.replace(t-s,e-s,i));let r=[];t>0&&this.decomposeLeft(t,r);let o=r.length;for(let l of i)r.push(l);if(t>0&&Eo(r,o-1),e=i&&e.push(null)),t>i&&this.right.decomposeLeft(t-i,e)}decomposeRight(t,e){let i=this.left.length,s=i+this.break;if(t>=s)return this.right.decomposeRight(t-s,e);t2*e.size||e.size>2*t.size?pt.of(this.break?[t,null,e]:[t,e]):(this.left=kn(this.left,t),this.right=kn(this.right,e),this.setHeight(t.height+e.height),this.outdated=t.outdated||e.outdated,this.size=t.size+e.size,this.length=t.length+this.break+e.length,this)}updateHeight(t,e=0,i=!1,s){let{left:r,right:o}=this,l=e+r.length+this.break,a=null;return s&&s.from<=e+r.length&&s.more?a=r=r.updateHeight(t,e,i,s):r.updateHeight(t,e,i),s&&s.from<=l+o.length&&s.more?a=o=o.updateHeight(t,l,i,s):o.updateHeight(t,l,i),a?this.balanced(r,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function Eo(n,t){let e,i;n[t]==null&&(e=n[t-1])instanceof nt&&(i=n[t+1])instanceof nt&&n.splice(t-1,3,new nt(e.length+1+i.length))}const lu=5;class Cr{constructor(t,e){this.pos=t,this.oracle=e,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(t,e){if(this.lineStart>-1){let i=Math.min(e,this.lineEnd),s=this.nodes[this.nodes.length-1];s instanceof Ct?s.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new Ct(i-this.pos,-1)),this.writtenTo=i,e>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=e}point(t,e,i){if(t=lu)&&this.addLineDeco(s,r,o)}else e>t&&this.span(t,e);this.lineEnd>-1&&this.lineEnd-1)return;let{from:t,to:e}=this.oracle.doc.lineAt(this.pos);this.lineStart=t,this.lineEnd=e,this.writtenTot&&this.nodes.push(new Ct(this.pos-t,-1)),this.writtenTo=this.pos}blankContent(t,e){let i=new nt(e-t);return this.oracle.doc.lineAt(t).to==e&&(i.flags|=4),i}ensureLine(){this.enterLine();let t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof Ct)return t;let e=new Ct(0,-1);return this.nodes.push(e),e}addBlock(t){this.enterLine();let e=t.deco;e&&e.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,e&&e.endSide>0&&(this.covering=t)}addLineDeco(t,e,i){let s=this.ensureLine();s.length+=i,s.collapsed+=i,s.widgetHeight=Math.max(s.widgetHeight,t),s.breaks+=e,this.writtenTo=this.pos=this.pos+i}finish(t){let e=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(e instanceof Ct)&&!this.isCovered?this.nodes.push(new Ct(0,-1)):(this.writtenToh.clientHeight||h.scrollWidth>h.clientWidth)&&f.overflow!="visible"){let u=h.getBoundingClientRect();r=Math.max(r,u.left),o=Math.min(o,u.right),l=Math.max(l,u.top),a=Math.min(c==n.parentNode?s.innerHeight:a,u.bottom)}c=f.position=="absolute"||f.position=="fixed"?h.offsetParent:h.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:r-e.left,right:Math.max(r,o)-e.left,top:l-(e.top+t),bottom:Math.max(l,a)-(e.top+t)}}function fu(n,t){let e=n.getBoundingClientRect();return{left:0,right:e.right-e.left,top:t,bottom:e.bottom-(e.top+t)}}class ns{constructor(t,e,i,s){this.from=t,this.to=e,this.size=i,this.displaySize=s}static same(t,e){if(t.length!=e.length)return!1;for(let i=0;itypeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new su(e),this.stateDeco=t.facet(Ci).filter(i=>typeof i!="function"),this.heightMap=pt.empty().applyChanges(this.stateDeco,F.empty,this.heightOracle.setDoc(t.doc),[new Et(0,0,0,t.doc.length)]);for(let i=0;i<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());i++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=P.set(this.lineGaps.map(i=>i.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let t=[this.viewport],{main:e}=this.state.selection;for(let i=0;i<=1;i++){let s=i?e.head:e.anchor;if(!t.some(({from:r,to:o})=>s>=r&&s<=o)){let{from:r,to:o}=this.lineBlockAt(s);t.push(new Gi(r,o))}}return this.viewports=t.sort((i,s)=>i.from-s.from),this.updateScaler()}updateScaler(){let t=this.scaler;return this.scaler=this.heightMap.height<=7e6?No:new Ar(this.heightOracle,this.heightMap,this.viewports),t.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,t=>{this.viewportLines.push(pi(t,this.scaler))})}update(t,e=null){this.state=t.state;let i=this.stateDeco;this.stateDeco=this.state.facet(Ci).filter(h=>typeof h!="function");let s=t.changedRanges,r=Et.extendWithRanges(s,au(i,this.stateDeco,t?t.changes:tt.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);Lo(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),r),(this.heightMap.height!=o||Xe)&&(t.flags|=2),l?(this.scrollAnchorPos=t.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let a=r.length?this.mapViewport(this.viewport,t.changes):this.viewport;(e&&(e.range.heada.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,e));let c=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,t.flags|=this.updateForViewport(),(c||!t.changes.empty||t.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes))),t.flags|=this.computeVisibleRanges(),e&&(this.scrollTarget=e),!this.mustEnforceCursorAssoc&&t.selectionSet&&t.view.lineWrapping&&t.state.selection.main.empty&&t.state.selection.main.assoc&&!t.state.facet(Oa)&&(this.mustEnforceCursorAssoc=!0)}measure(t){let e=t.contentDOM,i=window.getComputedStyle(e),s=this.heightOracle,r=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?X.RTL:X.LTR;let o=this.heightOracle.mustRefreshForWrapping(r),l=e.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let c=0,h=0;if(l.width&&l.height){let{scaleX:k,scaleY:w}=ea(e,l);(k>.005&&Math.abs(this.scaleX-k)>.005||w>.005&&Math.abs(this.scaleY-w)>.005)&&(this.scaleX=k,this.scaleY=w,c|=8,o=a=!0)}let f=(parseInt(i.paddingTop)||0)*this.scaleY,u=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=u)&&(this.paddingTop=f,this.paddingBottom=u,c|=10),this.editorWidth!=t.scrollDOM.clientWidth&&(s.lineWrapping&&(a=!0),this.editorWidth=t.scrollDOM.clientWidth,c|=8);let d=t.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=d&&(this.scrollAnchorHeight=-1,this.scrollTop=d),this.scrolledToBottom=sa(t.scrollDOM);let p=(this.printing?fu:cu)(e,this.paddingTop),g=p.top-this.pixelViewport.top,m=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let y=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(y!=this.inView&&(this.inView=y,y&&(a=!0)),!this.inView&&!this.scrollTarget)return 0;let x=l.width;if((this.contentDOMWidth!=x||this.editorHeight!=t.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=t.scrollDOM.clientHeight,c|=8),a){let k=t.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(k)&&(o=!0),o||s.lineWrapping&&Math.abs(x-this.contentDOMWidth)>s.charWidth){let{lineHeight:w,charWidth:v,textHeight:A}=t.docView.measureTextSize();o=w>0&&s.refresh(r,w,v,A,x/v,k),o&&(t.docView.minWidth=0,c|=8)}g>0&&m>0?h=Math.max(g,m):g<0&&m<0&&(h=Math.min(g,m)),Lo();for(let w of this.viewports){let v=w.from==this.viewport.from?k:t.docView.measureVisibleLineHeights(w);this.heightMap=(o?pt.empty().applyChanges(this.stateDeco,F.empty,this.heightOracle,[new Et(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(s,0,o,new ru(w.from,v))}Xe&&(c|=2)}let S=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return S&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(h,this.scrollTarget),c|=this.updateForViewport()),(c&2||S)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,t)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,t.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(t,e){let i=.5-Math.max(-.5,Math.min(.5,t/1e3/2)),s=this.heightMap,r=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,a=new Gi(s.lineAt(o-i*1e3,G.ByHeight,r,0,0).from,s.lineAt(l+(1-i)*1e3,G.ByHeight,r,0,0).to);if(e){let{head:c}=e.range;if(ca.to){let h=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=s.lineAt(c,G.ByPos,r,0,0),u;e.y=="center"?u=(f.top+f.bottom)/2-h/2:e.y=="start"||e.y=="nearest"&&c=l+Math.max(10,Math.min(i,250)))&&s>o-2*1e3&&r>1,o=s<<1;if(this.defaultTextDirection!=X.LTR&&!i)return[];let l=[],a=(h,f,u,d)=>{if(f-hh&&yy.from>=u.from&&y.to<=u.to&&Math.abs(y.from-h)y.fromx));if(!m){if(fS.from<=f&&S.to>=f)){let S=e.moveToLineBoundary(b.cursor(f),!1,!0).head;S>h&&(f=S)}let y=this.gapSize(u,h,f,d),x=i||y<2e6?y:2e6;m=new ns(h,f,y,x)}l.push(m)},c=h=>{if(h.length2e6)for(let v of t)v.from>=h.from&&v.fromh.from&&a(h.from,d,h,f),pe.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let e=[];K.spans(t,this.viewport.from,this.viewport.to,{span(s,r){e.push({from:s,to:r})},point(){}},20);let i=e.length!=this.visibleRanges.length||this.visibleRanges.some((s,r)=>s.from!=e[r].from||s.to!=e[r].to);return this.visibleRanges=e,i?4:0}lineBlockAt(t){return t>=this.viewport.from&&t<=this.viewport.to&&this.viewportLines.find(e=>e.from<=t&&e.to>=t)||pi(this.heightMap.lineAt(t,G.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(t){return t>=this.viewportLines[0].top&&t<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(e=>e.top<=t&&e.bottom>=t)||pi(this.heightMap.lineAt(this.scaler.fromDOM(t),G.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(t){let e=this.lineBlockAtHeight(t+8);return e.from>=this.viewport.from||this.viewportLines[0].top-t>200?e:this.viewportLines[0]}elementAtHeight(t){return pi(this.heightMap.blockAt(this.scaler.fromDOM(t),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Gi{constructor(t,e){this.from=t,this.to=e}}function du(n,t,e){let i=[],s=n,r=0;return K.spans(e,n,t,{span(){},point(o,l){o>s&&(i.push({from:s,to:o}),r+=o-s),s=l}},20),s=1)return t[t.length-1].to;let i=Math.floor(n*e);for(let s=0;;s++){let{from:r,to:o}=t[s],l=o-r;if(i<=l)return r+i;i-=l}}function Yi(n,t){let e=0;for(let{from:i,to:s}of n.ranges){if(t<=s){e+=t-i;break}e+=s-i}return e/n.total}function pu(n,t){for(let e of n)if(t(e))return e}const No={toDOM(n){return n},fromDOM(n){return n},scale:1,eq(n){return n==this}};class Ar{constructor(t,e,i){let s=0,r=0,o=0;this.viewports=i.map(({from:l,to:a})=>{let c=e.lineAt(l,G.ByPos,t,0,0).top,h=e.lineAt(a,G.ByPos,t,0,0).bottom;return s+=h-c,{from:l,to:a,top:c,bottom:h,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(e.height-s);for(let l of this.viewports)l.domTop=o+(l.top-r)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),r=l.bottom}toDOM(t){for(let e=0,i=0,s=0;;e++){let r=ee.from==t.viewports[i].from&&e.to==t.viewports[i].to):!1}}function pi(n,t){if(t.scale==1)return n;let e=t.toDOM(n.top),i=t.toDOM(n.bottom);return new Jt(n.from,n.length,e,i-e,Array.isArray(n._content)?n._content.map(s=>pi(s,t)):n._content)}const Xi=T.define({combine:n=>n.join(" ")}),Us=T.define({combine:n=>n.indexOf(!0)>-1}),Gs=de.newName(),Ga=de.newName(),Ja=de.newName(),Ya={"&light":"."+Ga,"&dark":"."+Ja};function Js(n,t,e){return new de(t,{finish(i){return/&/.test(i)?i.replace(/&\w*/,s=>{if(s=="&")return n;if(!e||!e[s])throw new RangeError(`Unsupported selector: ${s}`);return e[s]}):n+" "+i}})}const gu=Js("."+Gs,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},Ya),mu={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},ss=D.ie&&D.ie_version<=11;class yu{constructor(t){this.view=t,this.active=!1,this.editContext=null,this.selectionRange=new tf,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=t.contentDOM,this.observer=new MutationObserver(e=>{for(let i of e)this.queue.push(i);(D.ie&&D.ie_version<=11||D.ios&&t.composing)&&e.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&t.constructor.EDIT_CONTEXT!==!1&&!(D.chrome&&D.chrome_version<126)&&(this.editContext=new xu(t),t.state.facet(ie)&&(t.contentDOM.editContext=this.editContext.editContext)),ss&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var e;((e=this.view.docView)===null||e===void 0?void 0:e.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(e=>{e.length>0&&e[e.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(t){this.view.inputState.runHandlers("scroll",t),this.intersecting&&this.view.measure()}onScroll(t){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(t)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(t){(t.type=="change"||!t.type)&&!t.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(t){if(this.gapIntersection&&(t.length!=this.gaps.length||this.gaps.some((e,i)=>e!=t[i]))){this.gapIntersection.disconnect();for(let e of t)this.gapIntersection.observe(e);this.gaps=t}}onSelectionChange(t){let e=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,s=this.selectionRange;if(i.state.facet(ie)?i.root.activeElement!=this.dom:!cn(this.dom,s))return;let r=s.anchorNode&&i.docView.nearest(s.anchorNode);if(r&&r.ignoreEvent(t)){e||(this.selectionChanged=!1);return}(D.ie&&D.ie_version<=11||D.android&&D.chrome)&&!i.state.selection.main.empty&&s.focusNode&&bi(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:t}=this,e=vi(t.root);if(!e)return!1;let i=D.safari&&t.root.nodeType==11&&t.root.activeElement==this.dom&&bu(this.view,e)||e;if(!i||this.selectionRange.eq(i))return!1;let s=cn(this.dom,i);return s&&!this.selectionChanged&&t.inputState.lastFocusTime>Date.now()-200&&t.inputState.lastTouchTime{let r=this.delayedAndroidKey;r&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=r.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&r.force&&qe(this.dom,r.key,r.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(s)}(!this.delayedAndroidKey||t=="Enter")&&(this.delayedAndroidKey={key:t,keyCode:e,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}processRecords(){let t=this.pendingRecords();t.length&&(this.queue=[]);let e=-1,i=-1,s=!1;for(let r of t){let o=this.readMutation(r);o&&(o.typeOver&&(s=!0),e==-1?{from:e,to:i}=o:(e=Math.min(o.from,e),i=Math.max(o.to,i)))}return{from:e,to:i,typeOver:s}}readChange(){let{from:t,to:e,typeOver:i}=this.processRecords(),s=this.selectionChanged&&cn(this.dom,this.selectionRange);if(t<0&&!s)return null;t>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let r=new Nf(this.view,t,e,i);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r}flush(t=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;t&&this.readSelectionRange();let e=this.readChange();if(!e)return this.view.requestMeasure(),!1;let i=this.view.state,s=Fa(this.view,e);return this.view.state==i&&(e.domChanged||e.newSel&&!e.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),s}readMutation(t){let e=this.view.docView.nearest(t.target);if(!e||e.ignoreMutation(t))return null;if(e.markDirty(t.type=="attributes"),t.type=="attributes"&&(e.flags|=4),t.type=="childList"){let i=Fo(e,t.previousSibling||t.target.previousSibling,-1),s=Fo(e,t.nextSibling||t.target.nextSibling,1);return{from:i?e.posAfter(i):e.posAtStart,to:s?e.posBefore(s):e.posAtEnd,typeOver:!1}}else return t.type=="characterData"?{from:e.posAtStart,to:e.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}:null}setWindow(t){t!=this.win&&(this.removeWindowListeners(this.win),this.win=t,this.addWindowListeners(this.win))}addWindowListeners(t){t.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):t.addEventListener("beforeprint",this.onPrint),t.addEventListener("scroll",this.onScroll),t.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(t){t.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):t.removeEventListener("beforeprint",this.onPrint),t.document.removeEventListener("selectionchange",this.onSelectionChange)}update(t){this.editContext&&(this.editContext.update(t),t.startState.facet(ie)!=t.state.facet(ie)&&(t.view.contentDOM.editContext=t.state.facet(ie)?this.editContext.editContext:null))}destroy(){var t,e,i;this.stop(),(t=this.intersection)===null||t===void 0||t.disconnect(),(e=this.gapIntersection)===null||e===void 0||e.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let s of this.scrollTargets)s.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function Fo(n,t,e){for(;t;){let i=$.get(t);if(i&&i.parent==n)return i;let s=t.parentNode;t=s!=n.dom?s:e>0?t.nextSibling:t.previousSibling}return null}function Vo(n,t){let e=t.startContainer,i=t.startOffset,s=t.endContainer,r=t.endOffset,o=n.docView.domAtPos(n.state.selection.main.anchor);return bi(o.node,o.offset,s,r)&&([e,i,s,r]=[s,r,e,i]),{anchorNode:e,anchorOffset:i,focusNode:s,focusOffset:r}}function bu(n,t){if(t.getComposedRanges){let s=t.getComposedRanges(n.root)[0];if(s)return Vo(n,s)}let e=null;function i(s){s.preventDefault(),s.stopImmediatePropagation(),e=s.getTargetRanges()[0]}return n.contentDOM.addEventListener("beforeinput",i,!0),n.dom.ownerDocument.execCommand("indent"),n.contentDOM.removeEventListener("beforeinput",i,!0),e?Vo(n,e):null}class xu{constructor(t){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(t.state);let e=this.editContext=new window.EditContext({text:t.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,t.state.selection.main.anchor))),selectionEnd:this.toContextPos(t.state.selection.main.head)});this.handlers.textupdate=i=>{let{anchor:s}=t.state.selection.main,r=this.toEditorPos(i.updateRangeStart),o=this.toEditorPos(i.updateRangeEnd);t.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:i.updateRangeStart,editorBase:r,drifted:!1});let l={from:r,to:o,insert:F.of(i.text.split(` +`))};if(l.from==this.from&&sthis.to&&(l.to=s),!(l.from==l.to&&!l.insert.length)){if(this.pendingContextChange=l,!t.state.readOnly){let a=this.to-this.from+(l.to-l.from+l.insert.length);vr(t,l,b.single(this.toEditorPos(i.selectionStart,a),this.toEditorPos(i.selectionEnd,a)))}this.pendingContextChange&&(this.revertPending(t.state),this.setSelection(t.state))}},this.handlers.characterboundsupdate=i=>{let s=[],r=null;for(let o=this.toEditorPos(i.rangeStart),l=this.toEditorPos(i.rangeEnd);o{let s=[];for(let r of i.getTextFormats()){let o=r.underlineStyle,l=r.underlineThickness;if(o!="None"&&l!="None"){let a=this.toEditorPos(r.rangeStart),c=this.toEditorPos(r.rangeEnd);if(a{t.inputState.composing<0&&(t.inputState.composing=0,t.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(t.inputState.composing=-1,t.inputState.compositionFirstChange=null,this.composing){let{drifted:i}=this.composing;this.composing=null,i&&this.reset(t.state)}};for(let i in this.handlers)e.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{this.editContext.updateControlBounds(i.contentDOM.getBoundingClientRect());let s=vi(i.root);s&&s.rangeCount&&this.editContext.updateSelectionBounds(s.getRangeAt(0).getBoundingClientRect())}}}applyEdits(t){let e=0,i=!1,s=this.pendingContextChange;return t.changes.iterChanges((r,o,l,a,c)=>{if(i)return;let h=c.length-(o-r);if(s&&o>=s.to)if(s.from==r&&s.to==o&&s.insert.eq(c)){s=this.pendingContextChange=null,e+=h,this.to+=h;return}else s=null,this.revertPending(t.state);if(r+=e,o+=e,o<=this.from)this.from+=h,this.to+=h;else if(rthis.to||this.to-this.from+c.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(r),this.toContextPos(o),c.toString()),this.to+=h}e+=h}),s&&!i&&this.revertPending(t.state),!i}update(t){let e=this.pendingContextChange;this.composing&&(this.composing.drifted||t.transactions.some(i=>!i.isUserEvent("input.type")&&i.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=t.changes.mapPos(this.composing.editorBase)):!this.applyEdits(t)||!this.rangeIsValid(t.state)?(this.pendingContextChange=null,this.reset(t.state)):(t.docChanged||t.selectionSet||e)&&this.setSelection(t.state),(t.geometryChanged||t.docChanged||t.selectionSet)&&t.view.requestMeasure(this.measureReq)}resetRange(t){let{head:e}=t.selection.main;this.from=Math.max(0,e-1e4),this.to=Math.min(t.doc.length,e+1e4)}reset(t){this.resetRange(t),this.editContext.updateText(0,this.editContext.text.length,t.doc.sliceString(this.from,this.to)),this.setSelection(t)}revertPending(t){let e=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(e.from),this.toContextPos(e.from+e.insert.length),t.doc.sliceString(e.from,e.to))}setSelection(t){let{main:e}=t.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,e.anchor))),s=this.toContextPos(e.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=s)&&this.editContext.updateSelection(i,s)}rangeIsValid(t){let{head:e}=t.selection.main;return!(this.from>0&&e-this.from<500||this.to1e4*3)}toEditorPos(t,e=this.to-this.from){t=Math.min(t,e);let i=this.composing;return i&&i.drifted?i.editorBase+(t-i.contextBase):t+this.from}toContextPos(t){let e=this.composing;return e&&e.drifted?e.contextBase+(t-e.editorBase):t-this.from}destroy(){for(let t in this.handlers)this.editContext.removeEventListener(t,this.handlers[t])}}class O{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(t={}){var e;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),t.parent&&t.parent.appendChild(this.dom);let{dispatch:i}=t;this.dispatchTransactions=t.dispatchTransactions||i&&(s=>s.forEach(r=>i(r,this)))||(s=>this.update(s)),this.dispatch=this.dispatch.bind(this),this._root=t.root||ef(t.parent)||document,this.viewState=new Io(t.state||H.create(t)),t.scrollTo&&t.scrollTo.is($i)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(fi).map(s=>new ts(s));for(let s of this.plugins)s.update(this);this.observer=new yu(this),this.inputState=new zf(this),this.inputState.ensureHandlers(this.plugins),this.docView=new mo(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((e=document.fonts)===null||e===void 0)&&e.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...t){let e=t.length==1&&t[0]instanceof Z?t:t.length==1&&Array.isArray(t[0])?t[0]:[this.state.update(...t)];this.dispatchTransactions(e,this)}update(t){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let e=!1,i=!1,s,r=this.state;for(let u of t){if(u.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=u.state}if(this.destroyed){this.viewState.state=r;return}let o=this.hasFocus,l=0,a=null;t.some(u=>u.annotation(Ka))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=$a(r,o),a||(l=1));let c=this.observer.delayedAndroidKey,h=null;if(c?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(h=null)):this.observer.clear(),r.facet(H.phrases)!=this.state.facet(H.phrases))return this.setState(r);s=Sn.create(this,r,t),s.flags|=l;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let u of t){if(f&&(f=f.map(u.changes)),u.scrollIntoView){let{main:d}=u.state.selection;f=new Ke(d.empty?d:b.cursor(d.head,d.head>d.anchor?-1:1))}for(let d of u.effects)d.is($i)&&(f=d.value.clip(this.state))}this.viewState.update(s,f),this.bidiCache=vn.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),e=this.docView.update(s),this.state.facet(ui)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(e,t.some(u=>u.isUserEvent("select.pointer")))}finally{this.updateState=0}if(s.startState.facet(Xi)!=s.state.facet(Xi)&&(this.viewState.mustMeasureContent=!0),(e||i||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),e&&this.docViewUpdate(),!s.empty)for(let u of this.state.facet(qs))try{u(s)}catch(d){At(this.state,d,"update listener")}(a||h)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),h&&!Fa(this,h)&&c.force&&qe(this.contentDOM,c.key,c.keyCode)})}setState(t){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=t;return}this.updateState=2;let e=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new Io(t),this.plugins=t.facet(fi).map(i=>new ts(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new mo(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}e&&this.focus(),this.requestMeasure()}updatePlugins(t){let e=t.startState.facet(fi),i=t.state.facet(fi);if(e!=i){let s=[];for(let r of i){let o=e.indexOf(r);if(o<0)s.push(new ts(r));else{let l=this.plugins[o];l.mustUpdate=t,s.push(l)}}for(let r of this.plugins)r.mustUpdate!=t&&r.destroy(this);this.plugins=s,this.pluginMap.clear()}else for(let s of this.plugins)s.mustUpdate=t;for(let s=0;s-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,t&&this.observer.forceFlush();let e=null,i=this.scrollDOM,s=i.scrollTop*this.scaleY,{scrollAnchorPos:r,scrollAnchorHeight:o}=this.viewState;Math.abs(s-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(sa(i))r=-1,o=this.viewState.heightMap.height;else{let d=this.viewState.scrollAnchorAt(s);r=d.from,o=d.top}this.updateState=1;let a=this.viewState.measure(this);if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];a&4||([this.measureRequests,c]=[c,this.measureRequests]);let h=c.map(d=>{try{return d.read(this)}catch(p){return At(this.state,p),Ho}}),f=Sn.create(this,this.state,[]),u=!1;f.flags|=a,e?e.flags|=a:e=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),u=this.docView.update(f),u&&this.docViewUpdate());for(let d=0;d1||p<-1){s=s+p,i.scrollTop=s/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(e&&!e.empty)for(let l of this.state.facet(qs))l(e)}get themeClasses(){return Gs+" "+(this.state.facet(Us)?Ja:Ga)+" "+this.state.facet(Xi)}updateAttrs(){let t=Wo(this,Pa,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),e={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(ie)?"true":"false",class:"cm-content",style:`${D.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(e["aria-readonly"]="true"),Wo(this,wr,e);let i=this.observer.ignore(()=>{let s=Fs(this.contentDOM,this.contentAttrs,e),r=Fs(this.dom,this.editorAttrs,t);return s||r});return this.editorAttrs=t,this.contentAttrs=e,i}showAnnouncements(t){let e=!0;for(let i of t)for(let s of i.effects)if(s.is(O.announce)){e&&(this.announceDOM.textContent=""),e=!1;let r=this.announceDOM.appendChild(document.createElement("div"));r.textContent=s.value}}mountStyles(){this.styleModules=this.state.facet(ui);let t=this.state.facet(O.cspNonce);de.mount(this.root,this.styleModules.concat(gu).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(t){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),t){if(this.measureRequests.indexOf(t)>-1)return;if(t.key!=null){for(let e=0;ei.spec==t)||null),e&&e.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(t){return this.readMeasured(),this.viewState.elementAtHeight(t)}lineBlockAtHeight(t){return this.readMeasured(),this.viewState.lineBlockAtHeight(t)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(t){return this.viewState.lineBlockAt(t)}get contentHeight(){return this.viewState.contentHeight}moveByChar(t,e,i){return is(this,t,So(this,t,e,i))}moveByGroup(t,e){return is(this,t,So(this,t,e,i=>Rf(this,t.head,i)))}visualLineSide(t,e){let i=this.bidiSpans(t),s=this.textDirectionAt(t.from),r=i[e?i.length-1:0];return b.cursor(r.side(e,s)+t.from,r.forward(!e,s)?1:-1)}moveToLineBoundary(t,e,i=!0){return Pf(this,t,e,i)}moveVertically(t,e,i){return is(this,t,Lf(this,t,e,i))}domAtPos(t){return this.docView.domAtPos(t)}posAtDOM(t,e=0){return this.docView.posFromDOM(t,e)}posAtCoords(t,e=!0){return this.readMeasured(),Na(this,t,e)}coordsAtPos(t,e=1){this.readMeasured();let i=this.docView.coordsAt(t,e);if(!i||i.left==i.right)return i;let s=this.state.doc.lineAt(t),r=this.bidiSpans(s),o=r[fe.find(r,t-s.from,-1,e)];return Li(i,o.dir==X.LTR==e>0)}coordsForChar(t){return this.readMeasured(),this.docView.coordsForChar(t)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(t){return!this.state.facet(Da)||tthis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(t))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(t){if(t.length>wu)return xa(t.length);let e=this.textDirectionAt(t.from),i;for(let r of this.bidiCache)if(r.from==t.from&&r.dir==e&&(r.fresh||ba(r.isolates,i=go(this,t))))return r.order;i||(i=go(this,t));let s=gf(t.text,e,i);return this.bidiCache.push(new vn(t.from,t.to,e,i,!0,s)),s}get hasFocus(){var t;return(this.dom.ownerDocument.hasFocus()||D.safari&&((t=this.inputState)===null||t===void 0?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{ia(this.contentDOM),this.docView.updateSelection()})}setRoot(t){this._root!=t&&(this._root=t,this.observer.setWindow((t.nodeType==9?t:t.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let t of this.plugins)t.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(t,e={}){return $i.of(new Ke(typeof t=="number"?b.cursor(t):t,e.y,e.x,e.yMargin,e.xMargin))}scrollSnapshot(){let{scrollTop:t,scrollLeft:e}=this.scrollDOM,i=this.viewState.scrollAnchorAt(t);return $i.of(new Ke(b.cursor(i.from),"start","start",i.top-t,e,!0))}setTabFocusMode(t){t==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof t=="boolean"?this.inputState.tabFocusMode=t?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+t)}static domEventHandlers(t){return ft.define(()=>({}),{eventHandlers:t})}static domEventObservers(t){return ft.define(()=>({}),{eventObservers:t})}static theme(t,e){let i=de.newName(),s=[Xi.of(i),ui.of(Js(`.${i}`,t))];return e&&e.dark&&s.push(Us.of(!0)),s}static baseTheme(t){return ye.lowest(ui.of(Js("."+Gs,t,Ya)))}static findFromDOM(t){var e;let i=t.querySelector(".cm-content"),s=i&&$.get(i)||$.get(t);return((e=s==null?void 0:s.rootView)===null||e===void 0?void 0:e.view)||null}}O.styleModule=ui;O.inputHandler=Aa;O.clipboardInputFilter=br;O.clipboardOutputFilter=xr;O.scrollHandler=Ta;O.focusChangeEffect=Ma;O.perLineTextDirection=Da;O.exceptionSink=Ca;O.updateListener=qs;O.editable=ie;O.mouseSelectionStyle=va;O.dragMovesSelection=ka;O.clickAddsSelectionRange=Sa;O.decorations=Ci;O.outerDecorations=Ra;O.atomicRanges=Sr;O.bidiIsolatedRanges=La;O.scrollMargins=Ea;O.darkTheme=Us;O.cspNonce=T.define({combine:n=>n.length?n[0]:""});O.contentAttributes=wr;O.editorAttributes=Pa;O.lineWrapping=O.contentAttributes.of({class:"cm-lineWrapping"});O.announce=N.define();const wu=4096,Ho={};class vn{constructor(t,e,i,s,r,o){this.from=t,this.to=e,this.dir=i,this.isolates=s,this.fresh=r,this.order=o}static update(t,e){if(e.empty&&!t.some(r=>r.fresh))return t;let i=[],s=t.length?t[t.length-1].dir:X.LTR;for(let r=Math.max(0,t.length-10);r=0;s--){let r=i[s],o=typeof r=="function"?r(n):r;o&&Ns(o,e)}return e}const Su=D.mac?"mac":D.windows?"win":D.linux?"linux":"key";function ku(n,t){const e=n.split(/-(?!$)/);let i=e[e.length-1];i=="Space"&&(i=" ");let s,r,o,l;for(let a=0;ai.concat(s),[]))),e}function Cu(n,t,e){return _a(Xa(n.state),t,n,e)}let he=null;const Au=4e3;function Mu(n,t=Su){let e=Object.create(null),i=Object.create(null),s=(o,l)=>{let a=i[o];if(a==null)i[o]=l;else if(a!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},r=(o,l,a,c,h)=>{var f,u;let d=e[o]||(e[o]=Object.create(null)),p=l.split(/ (?!$)/).map(y=>ku(y,t));for(let y=1;y{let k=he={view:S,prefix:x,scope:o};return setTimeout(()=>{he==k&&(he=null)},Au),!0}]})}let g=p.join(" ");s(g,!1);let m=d[g]||(d[g]={preventDefault:!1,stopPropagation:!1,run:((u=(f=d._any)===null||f===void 0?void 0:f.run)===null||u===void 0?void 0:u.slice())||[]});a&&m.run.push(a),c&&(m.preventDefault=!0),h&&(m.stopPropagation=!0)};for(let o of n){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let c of l){let h=e[c]||(e[c]=Object.create(null));h._any||(h._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=o;for(let u in h)h[u].run.push(d=>f(d,Ys))}let a=o[t]||o.key;if(a)for(let c of l)r(c,a,o.run,o.preventDefault,o.stopPropagation),o.shift&&r(c,"Shift-"+a,o.shift,o.preventDefault,o.stopPropagation)}return e}let Ys=null;function _a(n,t,e,i){Ys=t;let s=Xc(t),r=yt(s,0),o=Gt(r)==s.length&&s!=" ",l="",a=!1,c=!1,h=!1;he&&he.view==e&&he.scope==i&&(l=he.prefix+" ",Ha.indexOf(t.keyCode)<0&&(c=!0,he=null));let f=new Set,u=m=>{if(m){for(let y of m.run)if(!f.has(y)&&(f.add(y),y(e)))return m.stopPropagation&&(h=!0),!0;m.preventDefault&&(m.stopPropagation&&(h=!0),c=!0)}return!1},d=n[i],p,g;return d&&(u(d[l+_i(s,t,!o)])?a=!0:o&&(t.altKey||t.metaKey||t.ctrlKey)&&!(D.windows&&t.ctrlKey&&t.altKey)&&(p=pe[t.keyCode])&&p!=s?(u(d[l+_i(p,t,!0)])||t.shiftKey&&(g=ki[t.keyCode])!=s&&g!=p&&u(d[l+_i(g,t,!1)]))&&(a=!0):o&&t.shiftKey&&u(d[l+_i(s,t,!0)])&&(a=!0),!a&&u(d._any)&&(a=!0)),c&&(a=!0),a&&h&&t.stopPropagation(),Ys=null,a}class Ni{constructor(t,e,i,s,r){this.className=t,this.left=e,this.top=i,this.width=s,this.height=r}draw(){let t=document.createElement("div");return t.className=this.className,this.adjust(t),t}update(t,e){return e.className!=this.className?!1:(this.adjust(t),!0)}adjust(t){t.style.left=this.left+"px",t.style.top=this.top+"px",this.width!=null&&(t.style.width=this.width+"px"),t.style.height=this.height+"px"}eq(t){return this.left==t.left&&this.top==t.top&&this.width==t.width&&this.height==t.height&&this.className==t.className}static forRange(t,e,i){if(i.empty){let s=t.coordsAtPos(i.head,i.assoc||1);if(!s)return[];let r=Qa(t);return[new Ni(e,s.left-r.left,s.top-r.top,null,s.bottom-s.top)]}else return Du(t,e,i)}}function Qa(n){let t=n.scrollDOM.getBoundingClientRect();return{left:(n.textDirection==X.LTR?t.left:t.right-n.scrollDOM.clientWidth*n.scaleX)-n.scrollDOM.scrollLeft*n.scaleX,top:t.top-n.scrollDOM.scrollTop*n.scaleY}}function qo(n,t,e,i){let s=n.coordsAtPos(t,e*2);if(!s)return i;let r=n.dom.getBoundingClientRect(),o=(s.top+s.bottom)/2,l=n.posAtCoords({x:r.left+1,y:o}),a=n.posAtCoords({x:r.right-1,y:o});return l==null||a==null?i:{from:Math.max(i.from,Math.min(l,a)),to:Math.min(i.to,Math.max(l,a))}}function Du(n,t,e){if(e.to<=n.viewport.from||e.from>=n.viewport.to)return[];let i=Math.max(e.from,n.viewport.from),s=Math.min(e.to,n.viewport.to),r=n.textDirection==X.LTR,o=n.contentDOM,l=o.getBoundingClientRect(),a=Qa(n),c=o.querySelector(".cm-line"),h=c&&window.getComputedStyle(c),f=l.left+(h?parseInt(h.paddingLeft)+Math.min(0,parseInt(h.textIndent)):0),u=l.right-(h?parseInt(h.paddingRight):0),d=$s(n,i),p=$s(n,s),g=d.type==Mt.Text?d:null,m=p.type==Mt.Text?p:null;if(g&&(n.lineWrapping||d.widgetLineBreaks)&&(g=qo(n,i,1,g)),m&&(n.lineWrapping||p.widgetLineBreaks)&&(m=qo(n,s,-1,m)),g&&m&&g.from==m.from&&g.to==m.to)return x(S(e.from,e.to,g));{let w=g?S(e.from,null,g):k(d,!1),v=m?S(null,e.to,m):k(p,!0),A=[];return(g||d).to<(m||p).from-(g&&m?1:0)||d.widgetLineBreaks>1&&w.bottom+n.defaultLineHeight/2B&&V.from=dt)break;Dt>j&&E(Math.max(it,j),w==null&&it<=B,Math.min(Dt,dt),v==null&&Dt>=W,Wt.dir)}if(j=kt.to+1,j>=dt)break}return z.length==0&&E(B,w==null,W,v==null,n.textDirection),{top:R,bottom:I,horizontal:z}}function k(w,v){let A=l.top+(v?w.top:w.bottom);return{top:A,bottom:A,horizontal:[]}}}function Ou(n,t){return n.constructor==t.constructor&&n.eq(t)}class Tu{constructor(t,e){this.view=t,this.layer=e,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=t.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),e.above&&this.dom.classList.add("cm-layer-above"),e.class&&this.dom.classList.add(e.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(t.state),t.requestMeasure(this.measureReq),e.mount&&e.mount(this.dom,t)}update(t){t.startState.facet(pn)!=t.state.facet(pn)&&this.setOrder(t.state),(this.layer.update(t,this.dom)||t.geometryChanged)&&(this.scale(),t.view.requestMeasure(this.measureReq))}docViewUpdate(t){this.layer.updateOnDocViewUpdate!==!1&&t.requestMeasure(this.measureReq)}setOrder(t){let e=0,i=t.facet(pn);for(;e!Ou(e,this.drawn[i]))){let e=this.dom.firstChild,i=0;for(let s of t)s.update&&e&&s.constructor&&this.drawn[i].constructor&&s.update(e,this.drawn[i])?(e=e.nextSibling,i++):this.dom.insertBefore(s.draw(),e);for(;e;){let s=e.nextSibling;e.remove(),e=s}this.drawn=t}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const pn=T.define();function Za(n){return[ft.define(t=>new Tu(t,n)),pn.of(n)]}const th=!(D.ios&&D.webkit&&D.webkit_version<534),Ai=T.define({combine(n){return Ee(n,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(t,e)=>Math.min(t,e),drawRangeCursor:(t,e)=>t||e})}});function Mm(n={}){return[Ai.of(n),Bu,Pu,Ru,Oa.of(!0)]}function eh(n){return n.startState.facet(Ai)!=n.state.facet(Ai)}const Bu=Za({above:!0,markers(n){let{state:t}=n,e=t.facet(Ai),i=[];for(let s of t.selection.ranges){let r=s==t.selection.main;if(s.empty?!r||th:e.drawRangeCursor){let o=r?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=s.empty?s:b.cursor(s.head,s.head>s.anchor?-1:1);for(let a of Ni.forRange(n,o,l))i.push(a)}}return i},update(n,t){n.transactions.some(i=>i.selection)&&(t.style.animationName=t.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let e=eh(n);return e&&Ko(n.state,t),n.docChanged||n.selectionSet||e},mount(n,t){Ko(t.state,n)},class:"cm-cursorLayer"});function Ko(n,t){t.style.animationDuration=n.facet(Ai).cursorBlinkRate+"ms"}const Pu=Za({above:!1,markers(n){return n.state.selection.ranges.map(t=>t.empty?[]:Ni.forRange(n,"cm-selectionBackground",t)).reduce((t,e)=>t.concat(e))},update(n,t){return n.docChanged||n.selectionSet||n.viewportChanged||eh(n)},class:"cm-selectionLayer"}),Xs={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};th&&(Xs[".cm-line"].caretColor=Xs[".cm-content"].caretColor="transparent !important");const Ru=ye.highest(O.theme(Xs)),ih=N.define({map(n,t){return n==null?null:t.mapPos(n)}}),gi=mt.define({create(){return null},update(n,t){return n!=null&&(n=t.changes.mapPos(n)),t.effects.reduce((e,i)=>i.is(ih)?i.value:e,n)}}),Lu=ft.fromClass(class{constructor(n){this.view=n,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(n){var t;let e=n.state.field(gi);e==null?this.cursor!=null&&((t=this.cursor)===null||t===void 0||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(n.startState.field(gi)!=e||n.docChanged||n.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:n}=this,t=n.state.field(gi),e=t!=null&&n.coordsAtPos(t);if(!e)return null;let i=n.scrollDOM.getBoundingClientRect();return{left:e.left-i.left+n.scrollDOM.scrollLeft*n.scaleX,top:e.top-i.top+n.scrollDOM.scrollTop*n.scaleY,height:e.bottom-e.top}}drawCursor(n){if(this.cursor){let{scaleX:t,scaleY:e}=this.view;n?(this.cursor.style.left=n.left/t+"px",this.cursor.style.top=n.top/e+"px",this.cursor.style.height=n.height/e+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(n){this.view.state.field(gi)!=n&&this.view.dispatch({effects:ih.of(n)})}},{eventObservers:{dragover(n){this.setDropPos(this.view.posAtCoords({x:n.clientX,y:n.clientY}))},dragleave(n){(n.target==this.view.contentDOM||!this.view.contentDOM.contains(n.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function Dm(){return[gi,Lu]}function $o(n,t,e,i,s){t.lastIndex=0;for(let r=n.iterRange(e,i),o=e,l;!r.next().done;o+=r.value.length)if(!r.lineBreak)for(;l=t.exec(r.value);)s(o+l.index,l)}function Eu(n,t){let e=n.visibleRanges;if(e.length==1&&e[0].from==n.viewport.from&&e[0].to==n.viewport.to)return e;let i=[];for(let{from:s,to:r}of e)s=Math.max(n.state.doc.lineAt(s).from,s-t),r=Math.min(n.state.doc.lineAt(r).to,r+t),i.length&&i[i.length-1].to>=s?i[i.length-1].to=r:i.push({from:s,to:r});return i}class Iu{constructor(t){const{regexp:e,decoration:i,decorate:s,boundary:r,maxLength:o=1e3}=t;if(!e.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=e,s)this.addMatch=(l,a,c,h)=>s(h,c,c+l[0].length,l,a);else if(typeof i=="function")this.addMatch=(l,a,c,h)=>{let f=i(l,a,c);f&&h(c,c+l[0].length,f)};else if(i)this.addMatch=(l,a,c,h)=>h(c,c+l[0].length,i);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=r,this.maxLength=o}createDeco(t){let e=new Oe,i=e.add.bind(e);for(let{from:s,to:r}of Eu(t,this.maxLength))$o(t.state.doc,this.regexp,s,r,(o,l)=>this.addMatch(l,t,o,i));return e.finish()}updateDeco(t,e){let i=1e9,s=-1;return t.docChanged&&t.changes.iterChanges((r,o,l,a)=>{a>t.view.viewport.from&&l1e3?this.createDeco(t.view):s>-1?this.updateRange(t.view,e.map(t.changes),i,s):e}updateRange(t,e,i,s){for(let r of t.visibleRanges){let o=Math.max(r.from,i),l=Math.min(r.to,s);if(l>o){let a=t.state.doc.lineAt(o),c=a.toa.from;o--)if(this.boundary.test(a.text[o-1-a.from])){h=o;break}for(;lu.push(y.range(g,m));if(a==c)for(this.regexp.lastIndex=h-a.from;(d=this.regexp.exec(a.text))&&d.indexthis.addMatch(m,t,g,p));e=e.update({filterFrom:h,filterTo:f,filter:(g,m)=>gf,add:u})}}return e}}const _s=/x/.unicode!=null?"gu":"g",Nu=new RegExp(`[\0-\b +--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,_s),Fu={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let rs=null;function Vu(){var n;if(rs==null&&typeof document<"u"&&document.body){let t=document.body.style;rs=((n=t.tabSize)!==null&&n!==void 0?n:t.MozTabSize)!=null}return rs||!1}const gn=T.define({combine(n){let t=Ee(n,{render:null,specialChars:Nu,addSpecialChars:null});return(t.replaceTabs=!Vu())&&(t.specialChars=new RegExp(" |"+t.specialChars.source,_s)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,_s)),t}});function Om(n={}){return[gn.of(n),Hu()]}let jo=null;function Hu(){return jo||(jo=ft.fromClass(class{constructor(n){this.view=n,this.decorations=P.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(gn)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new Iu({regexp:n.specialChars,decoration:(t,e,i)=>{let{doc:s}=e.state,r=yt(t[0],0);if(r==9){let o=s.lineAt(i),l=e.state.tabSize,a=ei(o.text,l,i-o.from);return P.replace({widget:new Ku((l-a%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[r]||(this.decorationCache[r]=P.replace({widget:new qu(n,r)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let t=n.state.facet(gn);n.startState.facet(gn)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const Wu="•";function zu(n){return n>=32?Wu:n==10?"␤":String.fromCharCode(9216+n)}class qu extends Ie{constructor(t,e){super(),this.options=t,this.code=e}eq(t){return t.code==this.code}toDOM(t){let e=zu(this.code),i=t.state.phrase("Control character")+" "+(Fu[this.code]||"0x"+this.code.toString(16)),s=this.options.render&&this.options.render(this.code,i,e);if(s)return s;let r=document.createElement("span");return r.textContent=e,r.title=i,r.setAttribute("aria-label",i),r.className="cm-specialChar",r}ignoreEvent(){return!1}}class Ku extends Ie{constructor(t){super(),this.width=t}eq(t){return t.width==this.width}toDOM(){let t=document.createElement("span");return t.textContent=" ",t.className="cm-tab",t.style.width=this.width+"px",t}ignoreEvent(){return!1}}class $u extends Ie{constructor(t){super(),this.content=t}toDOM(t){let e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(t):this.content.cloneNode(!0)),typeof this.content=="string"?e.setAttribute("aria-label","placeholder "+this.content):e.setAttribute("aria-hidden","true"),e}coordsAt(t){let e=t.firstChild?Ge(t.firstChild):[];if(!e.length)return null;let i=window.getComputedStyle(t.parentNode),s=Li(e[0],i.direction!="rtl"),r=parseInt(i.lineHeight);return s.bottom-s.top>r*1.5?{left:s.left,right:s.right,top:s.top,bottom:s.top+r}:s}ignoreEvent(){return!1}}function Tm(n){return ft.fromClass(class{constructor(t){this.view=t,this.placeholder=n?P.set([P.widget({widget:new $u(n),side:1}).range(0)]):P.none}get decorations(){return this.view.state.doc.length?P.none:this.placeholder}},{decorations:t=>t.decorations})}const Qs=2e3;function ju(n,t,e){let i=Math.min(t.line,e.line),s=Math.max(t.line,e.line),r=[];if(t.off>Qs||e.off>Qs||t.col<0||e.col<0){let o=Math.min(t.off,e.off),l=Math.max(t.off,e.off);for(let a=i;a<=s;a++){let c=n.doc.line(a);c.length<=l&&r.push(b.range(c.from+o,c.to+l))}}else{let o=Math.min(t.col,e.col),l=Math.max(t.col,e.col);for(let a=i;a<=s;a++){let c=n.doc.line(a),h=Ts(c.text,o,n.tabSize,!0);if(h<0)r.push(b.cursor(c.to));else{let f=Ts(c.text,l,n.tabSize);r.push(b.range(c.from+h,c.from+f))}}}return r}function Uu(n,t){let e=n.coordsAtPos(n.viewport.from);return e?Math.round(Math.abs((e.left-t)/n.defaultCharacterWidth)):-1}function Uo(n,t){let e=n.posAtCoords({x:t.clientX,y:t.clientY},!1),i=n.state.doc.lineAt(e),s=e-i.from,r=s>Qs?-1:s==i.length?Uu(n,t.clientX):ei(i.text,n.state.tabSize,e-i.from);return{line:i.number,col:r,off:s}}function Gu(n,t){let e=Uo(n,t),i=n.state.selection;return e?{update(s){if(s.docChanged){let r=s.changes.mapPos(s.startState.doc.line(e.line).from),o=s.state.doc.lineAt(r);e={line:o.number,col:e.col,off:Math.min(e.off,o.length)},i=i.map(s.changes)}},get(s,r,o){let l=Uo(n,s);if(!l)return i;let a=ju(n.state,e,l);return a.length?o?b.create(a.concat(i.ranges)):b.create(a):i}}:null}function Bm(n){let t=e=>e.altKey&&e.button==0;return O.mouseSelectionStyle.of((e,i)=>t(i)?Gu(e,i):null)}const li="-10000px";class Ju{constructor(t,e,i,s){this.facet=e,this.createTooltipView=i,this.removeTooltipView=s,this.input=t.state.facet(e),this.tooltips=this.input.filter(o=>o);let r=null;this.tooltipViews=this.tooltips.map(o=>r=i(o,r))}update(t,e){var i;let s=t.state.facet(this.facet),r=s.filter(a=>a);if(s===this.input){for(let a of this.tooltipViews)a.update&&a.update(t);return!1}let o=[],l=e?[]:null;for(let a=0;ae[c]=a),e.length=l.length),this.input=s,this.tooltips=r,this.tooltipViews=o,!0}}function Yu(n){let{win:t}=n;return{top:0,left:0,bottom:t.innerHeight,right:t.innerWidth}}const os=T.define({combine:n=>{var t,e,i;return{position:D.ios?"absolute":((t=n.find(s=>s.position))===null||t===void 0?void 0:t.position)||"fixed",parent:((e=n.find(s=>s.parent))===null||e===void 0?void 0:e.parent)||null,tooltipSpace:((i=n.find(s=>s.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||Yu}}}),Go=new WeakMap,nh=ft.fromClass(class{constructor(n){this.view=n,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=n.state.facet(os);this.position=t.position,this.parent=t.parent,this.classes=n.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new Ju(n,sh,(e,i)=>this.createTooltip(e,i),e=>{this.resizeObserver&&this.resizeObserver.unobserve(e.dom),e.dom.remove()}),this.above=this.manager.tooltips.map(e=>!!e.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),n.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let n of this.manager.tooltipViews)this.intersectionObserver.observe(n.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(n){n.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(n,this.above);t&&this.observeIntersection();let e=t||n.geometryChanged,i=n.state.facet(os);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let s of this.manager.tooltipViews)s.dom.style.position=this.position;e=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let s of this.manager.tooltipViews)this.container.appendChild(s.dom);e=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);e&&this.maybeMeasure()}createTooltip(n,t){let e=n.create(this.view),i=t?t.dom:null;if(e.dom.classList.add("cm-tooltip"),n.arrow&&!e.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let s=document.createElement("div");s.className="cm-tooltip-arrow",e.dom.appendChild(s)}return e.dom.style.position=this.position,e.dom.style.top=li,e.dom.style.left="0px",this.container.insertBefore(e.dom,i),e.mount&&e.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(e.dom),e}destroy(){var n,t,e;this.view.win.removeEventListener("resize",this.measureSoon);for(let i of this.manager.tooltipViews)i.dom.remove(),(n=i.destroy)===null||n===void 0||n.call(i);this.parent&&this.container.remove(),(t=this.resizeObserver)===null||t===void 0||t.disconnect(),(e=this.intersectionObserver)===null||e===void 0||e.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let n=1,t=1,e=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:r}=this.manager.tooltipViews[0];if(D.gecko)e=r.offsetParent!=this.container.ownerDocument.body;else if(r.style.top==li&&r.style.left=="0px"){let o=r.getBoundingClientRect();e=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}}if(e||this.position=="absolute")if(this.parent){let r=this.parent.getBoundingClientRect();r.width&&r.height&&(n=r.width/this.parent.offsetWidth,t=r.height/this.parent.offsetHeight)}else({scaleX:n,scaleY:t}=this.view.viewState);let i=this.view.scrollDOM.getBoundingClientRect(),s=kr(this.view);return{visible:{left:i.left+s.left,top:i.top+s.top,right:i.right-s.right,bottom:i.bottom-s.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((r,o)=>{let l=this.manager.tooltipViews[o];return l.getCoords?l.getCoords(r.pos):this.view.coordsAtPos(r.pos)}),size:this.manager.tooltipViews.map(({dom:r})=>r.getBoundingClientRect()),space:this.view.state.facet(os).tooltipSpace(this.view),scaleX:n,scaleY:t,makeAbsolute:e}}writeMeasure(n){var t;if(n.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{visible:e,space:i,scaleX:s,scaleY:r}=n,o=[];for(let l=0;l=Math.min(e.bottom,i.bottom)||f.rightMath.min(e.right,i.right)+.1)){h.style.top=li;continue}let d=a.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,p=d?7:0,g=u.right-u.left,m=(t=Go.get(c))!==null&&t!==void 0?t:u.bottom-u.top,y=c.offset||_u,x=this.view.textDirection==X.LTR,S=u.width>i.right-i.left?x?i.left:i.right-u.width:x?Math.max(i.left,Math.min(f.left-(d?14:0)+y.x,i.right-g)):Math.min(Math.max(i.left,f.left-g+(d?14:0)-y.x),i.right-g),k=this.above[l];!a.strictSide&&(k?f.top-m-p-y.yi.bottom)&&k==i.bottom-f.bottom>f.top-i.top&&(k=this.above[l]=!k);let w=(k?f.top-i.top:i.bottom-f.bottom)-p;if(wS&&R.topv&&(v=k?R.top-m-2-p:R.bottom+p+2);if(this.position=="absolute"?(h.style.top=(v-n.parent.top)/r+"px",Jo(h,(S-n.parent.left)/s)):(h.style.top=v/r+"px",Jo(h,S/s)),d){let R=f.left+(x?y.x:-y.x)-(S+14-7);d.style.left=R/s+"px"}c.overlap!==!0&&o.push({left:S,top:v,right:A,bottom:v+m}),h.classList.toggle("cm-tooltip-above",k),h.classList.toggle("cm-tooltip-below",!k),c.positioned&&c.positioned(n.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let n of this.manager.tooltipViews)n.dom.style.top=li}},{eventObservers:{scroll(){this.maybeMeasure()}}});function Jo(n,t){let e=parseInt(n.style.left,10);(isNaN(e)||Math.abs(t-e)>1)&&(n.style.left=t+"px")}const Xu=O.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),_u={x:0,y:0},sh=T.define({enables:[nh,Xu]});function rh(n,t){let e=n.plugin(nh);if(!e)return null;let i=e.manager.tooltips.indexOf(t);return i<0?null:e.manager.tooltipViews[i]}const Yo=T.define({combine(n){let t,e;for(let i of n)t=t||i.topContainer,e=e||i.bottomContainer;return{topContainer:t,bottomContainer:e}}});function Cn(n,t){let e=n.plugin(oh),i=e?e.specs.indexOf(t):-1;return i>-1?e.panels[i]:null}const oh=ft.fromClass(class{constructor(n){this.input=n.state.facet(An),this.specs=this.input.filter(e=>e),this.panels=this.specs.map(e=>e(n));let t=n.state.facet(Yo);this.top=new Qi(n,!0,t.topContainer),this.bottom=new Qi(n,!1,t.bottomContainer),this.top.sync(this.panels.filter(e=>e.top)),this.bottom.sync(this.panels.filter(e=>!e.top));for(let e of this.panels)e.dom.classList.add("cm-panel"),e.mount&&e.mount()}update(n){let t=n.state.facet(Yo);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new Qi(n.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new Qi(n.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let e=n.state.facet(An);if(e!=this.input){let i=e.filter(a=>a),s=[],r=[],o=[],l=[];for(let a of i){let c=this.specs.indexOf(a),h;c<0?(h=a(n.view),l.push(h)):(h=this.panels[c],h.update&&h.update(n)),s.push(h),(h.top?r:o).push(h)}this.specs=i,this.panels=s,this.top.sync(r),this.bottom.sync(o);for(let a of l)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let i of this.panels)i.update&&i.update(n)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:n=>O.scrollMargins.of(t=>{let e=t.plugin(n);return e&&{top:e.top.scrollMargin(),bottom:e.bottom.scrollMargin()}})});class Qi{constructor(t,e,i){this.view=t,this.top=e,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(t){for(let e of this.panels)e.destroy&&t.indexOf(e)<0&&e.destroy();this.panels=t,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let e=this.container||this.view.dom;e.insertBefore(this.dom,this.top?e.firstChild:null)}let t=this.dom.firstChild;for(let e of this.panels)if(e.dom.parentNode==this.dom){for(;t!=e.dom;)t=Xo(t);t=t.nextSibling}else this.dom.insertBefore(e.dom,t);for(;t;)t=Xo(t)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let t of this.classes.split(" "))t&&this.container.classList.remove(t);for(let t of(this.classes=this.view.themeClasses).split(" "))t&&this.container.classList.add(t)}}}function Xo(n){let t=n.nextSibling;return n.remove(),t}const An=T.define({enables:oh});class Re extends De{compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}eq(t){return!1}destroy(t){}}Re.prototype.elementClass="";Re.prototype.toDOM=void 0;Re.prototype.mapMode=at.TrackBefore;Re.prototype.startSide=Re.prototype.endSide=-1;Re.prototype.point=!0;const Qu=T.define(),Zu=new class extends Re{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},td=Qu.compute(["selection"],n=>{let t=[],e=-1;for(let i of n.selection.ranges){let s=n.doc.lineAt(i.head).from;s>e&&(e=s,t.push(Zu.range(s)))}return K.of(t)});function Pm(){return td}const ed=1024;let id=0;class Bt{constructor(t,e){this.from=t,this.to=e}}class L{constructor(t={}){this.id=id++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(t){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof t!="function"&&(t=gt.match(t)),e=>{let i=t(e);return i===void 0?null:[this,i]}}}L.closedBy=new L({deserialize:n=>n.split(" ")});L.openedBy=new L({deserialize:n=>n.split(" ")});L.group=new L({deserialize:n=>n.split(" ")});L.isolate=new L({deserialize:n=>{if(n&&n!="rtl"&&n!="ltr"&&n!="auto")throw new RangeError("Invalid value for isolate: "+n);return n||"auto"}});L.contextHash=new L({perNode:!0});L.lookAhead=new L({perNode:!0});L.mounted=new L({perNode:!0});class Mi{constructor(t,e,i){this.tree=t,this.overlay=e,this.parser=i}static get(t){return t&&t.props&&t.props[L.mounted.id]}}const nd=Object.create(null);class gt{constructor(t,e,i,s=0){this.name=t,this.props=e,this.id=i,this.flags=s}static define(t){let e=t.props&&t.props.length?Object.create(null):nd,i=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),s=new gt(t.name||"",e,t.id,i);if(t.props){for(let r of t.props)if(Array.isArray(r)||(r=r(s)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");e[r[0].id]=r[1]}}return s}prop(t){return this.props[t.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(t){if(typeof t=="string"){if(this.name==t)return!0;let e=this.prop(L.group);return e?e.indexOf(t)>-1:!1}return this.id==t}static match(t){let e=Object.create(null);for(let i in t)for(let s of i.split(" "))e[s]=t[i];return i=>{for(let s=i.prop(L.group),r=-1;r<(s?s.length:0);r++){let o=e[r<0?i.name:s[r]];if(o)return o}}}}gt.none=new gt("",Object.create(null),0,8);class Dr{constructor(t){this.types=t;for(let e=0;e0;for(let a=this.cursor(o|Y.IncludeAnonymous);;){let c=!1;if(a.from<=r&&a.to>=s&&(!l&&a.type.isAnonymous||e(a)!==!1)){if(a.firstChild())continue;c=!0}for(;c&&i&&(l||!a.type.isAnonymous)&&i(a),!a.nextSibling();){if(!a.parent())return;c=!0}}}prop(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t)}get propValues(){let t=[];if(this.props)for(let e in this.props)t.push([+e,this.props[e]]);return t}balance(t={}){return this.children.length<=8?this:Br(gt.none,this.children,this.positions,0,this.children.length,0,this.length,(e,i,s)=>new U(this.type,e,i,s,this.propValues),t.makeTree||((e,i,s)=>new U(gt.none,e,i,s)))}static build(t){return ld(t)}}U.empty=new U(gt.none,[],[],0);class Or{constructor(t,e){this.buffer=t,this.index=e}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Or(this.buffer,this.index)}}class me{constructor(t,e,i){this.buffer=t,this.length=e,this.set=i}get type(){return gt.none}toString(){let t=[];for(let e=0;e0));a=o[a+3]);return l}slice(t,e,i){let s=this.buffer,r=new Uint16Array(e-t),o=0;for(let l=t,a=0;l=t&&et;case 1:return e<=t&&i>t;case 2:return i>t;case 4:return!0}}function Di(n,t,e,i){for(var s;n.from==n.to||(e<1?n.from>=t:n.from>t)||(e>-1?n.to<=t:n.to0?l.length:-1;t!=c;t+=e){let h=l[t],f=a[t]+o.from;if(lh(s,i,f,f+h.length)){if(h instanceof me){if(r&Y.ExcludeBuffers)continue;let u=h.findChild(0,h.buffer.length,e,i-f,s);if(u>-1)return new Yt(new sd(o,h,t,f),null,u)}else if(r&Y.IncludeAnonymous||!h.type.isAnonymous||Tr(h)){let u;if(!(r&Y.IgnoreMounts)&&(u=Mi.get(h))&&!u.overlay)return new ct(u.tree,f,t,o);let d=new ct(h,f,t,o);return r&Y.IncludeAnonymous||!d.type.isAnonymous?d:d.nextChild(e<0?h.children.length-1:0,e,i,s)}}}if(r&Y.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?t=o.index+e:t=e<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(t){return this.nextChild(0,1,t,2)}childBefore(t){return this.nextChild(this._tree.children.length-1,-1,t,-2)}enter(t,e,i=0){let s;if(!(i&Y.IgnoreOverlays)&&(s=Mi.get(this._tree))&&s.overlay){let r=t-this.from;for(let{from:o,to:l}of s.overlay)if((e>0?o<=r:o=r:l>r))return new ct(s.tree,s.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,e,i)}nextSignificantParent(){let t=this;for(;t.type.isAnonymous&&t._parent;)t=t._parent;return t}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function Qo(n,t,e,i){let s=n.cursor(),r=[];if(!s.firstChild())return r;if(e!=null){for(let o=!1;!o;)if(o=s.type.is(e),!s.nextSibling())return r}for(;;){if(i!=null&&s.type.is(i))return r;if(s.type.is(t)&&r.push(s.node),!s.nextSibling())return i==null?r:[]}}function Zs(n,t,e=t.length-1){for(let i=n;e>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(t[e]&&t[e]!=i.name)return!1;e--}}return!0}class sd{constructor(t,e,i,s){this.parent=t,this.buffer=e,this.index=i,this.start=s}}class Yt extends ah{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(t,e,i){super(),this.context=t,this._parent=e,this.index=i,this.type=t.buffer.set.types[t.buffer.buffer[i]]}child(t,e,i){let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],t,e-this.context.start,i);return r<0?null:new Yt(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(t){return this.child(1,t,2)}childBefore(t){return this.child(-1,t,-2)}enter(t,e,i=0){if(i&Y.ExcludeBuffers)return null;let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],e>0?1:-1,t-this.context.start,e);return r<0?null:new Yt(this.context,this,r)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,0,4)}get nextSibling(){let{buffer:t}=this.context,e=t.buffer[this.index+3];return e<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new Yt(this.context,this._parent,e):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,e=this._parent?this._parent.index+4:0;return this.index==e?this.externalSibling(-1):new Yt(this.context,this._parent,t.findChild(e,this.index,-1,0,4))}get tree(){return null}toTree(){let t=[],e=[],{buffer:i}=this.context,s=this.index+4,r=i.buffer[this.index+3];if(r>s){let o=i.buffer[this.index+1];t.push(i.slice(s,r,o)),e.push(0)}return new U(this.type,t,e,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function hh(n){if(!n.length)return null;let t=0,e=n[0];for(let r=1;re.from||o.to=t){let l=new ct(o.tree,o.overlay[0].from+r.from,-1,r);(s||(s=[i])).push(Di(l,t,e,!1))}}return s?hh(s):i}class Mn{get name(){return this.type.name}constructor(t,e=0){if(this.mode=e,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,t instanceof ct)this.yieldNode(t);else{this._tree=t.context.parent,this.buffer=t.context;for(let i=t._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=t,this.yieldBuf(t.index)}}yieldNode(t){return t?(this._tree=t,this.type=t.type,this.from=t.from,this.to=t.to,!0):!1}yieldBuf(t,e){this.index=t;let{start:i,buffer:s}=this.buffer;return this.type=e||s.set.types[s.buffer[t]],this.from=i+s.buffer[t+1],this.to=i+s.buffer[t+2],!0}yield(t){return t?t instanceof ct?(this.buffer=null,this.yieldNode(t)):(this.buffer=t.context,this.yieldBuf(t.index,t.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(t,e,i){if(!this.buffer)return this.yield(this._tree.nextChild(t<0?this._tree._tree.children.length-1:0,t,e,i,this.mode));let{buffer:s}=this.buffer,r=s.findChild(this.index+4,s.buffer[this.index+3],t,e-this.buffer.start,i);return r<0?!1:(this.stack.push(this.index),this.yieldBuf(r))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(t){return this.enterChild(1,t,2)}childBefore(t){return this.enterChild(-1,t,-2)}enter(t,e,i=this.mode){return this.buffer?i&Y.ExcludeBuffers?!1:this.enterChild(1,t,e):this.yield(this._tree.enter(t,e,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Y.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let t=this.mode&Y.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(t)}sibling(t){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+t,t,0,4,this.mode)):!1;let{buffer:e}=this.buffer,i=this.stack.length-1;if(t<0){let s=i<0?0:this.stack[i]+4;if(this.index!=s)return this.yieldBuf(e.findChild(s,this.index,-1,0,4))}else{let s=e.buffer[this.index+3];if(s<(i<0?e.buffer.length:e.buffer[this.stack[i]+3]))return this.yieldBuf(s)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+t,t,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(t){let e,i,{buffer:s}=this;if(s){if(t>0){if(this.index-1)for(let r=e+t,o=t<0?-1:i._tree.children.length;r!=o;r+=t){let l=i._tree.children[r];if(this.mode&Y.IncludeAnonymous||l instanceof me||!l.type.isAnonymous||Tr(l))return!1}return!0}move(t,e){if(e&&this.enterChild(t,0,4))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1}}next(t=!0){return this.move(1,t)}prev(t=!0){return this.move(-1,t)}moveTo(t,e=0){for(;(this.from==this.to||(e<1?this.from>=t:this.from>t)||(e>-1?this.to<=t:this.to=0;){for(let o=t;o;o=o._parent)if(o.index==s){if(s==this.index)return o;e=o,i=r+1;break t}s=this.stack[--r]}for(let s=i;s=0;r--){if(r<0)return Zs(this._tree,t,s);let o=i[e.buffer[this.stack[r]]];if(!o.isAnonymous){if(t[s]&&t[s]!=o.name)return!1;s--}}return!0}}function Tr(n){return n.children.some(t=>t instanceof me||!t.type.isAnonymous||Tr(t))}function ld(n){var t;let{buffer:e,nodeSet:i,maxBufferLength:s=ed,reused:r=[],minRepeatType:o=i.types.length}=n,l=Array.isArray(e)?new Or(e,e.length):e,a=i.types,c=0,h=0;function f(w,v,A,R,I,z){let{id:E,start:B,end:W,size:V}=l,j=h,dt=c;for(;V<0;)if(l.next(),V==-1){let ee=r[E];A.push(ee),R.push(B-w);return}else if(V==-3){c=E;return}else if(V==-4){h=E;return}else throw new RangeError(`Unrecognized record size: ${V}`);let kt=a[E],Wt,it,Dt=B-w;if(W-B<=s&&(it=m(l.pos-v,I))){let ee=new Uint16Array(it.size-it.skip),Ot=l.pos-it.size,zt=ee.length;for(;l.pos>Ot;)zt=y(it.start,ee,zt);Wt=new me(ee,W-it.start,i),Dt=it.start-w}else{let ee=l.pos-V;l.next();let Ot=[],zt=[],xe=E>=o?E:-1,Ne=0,Wi=W;for(;l.pos>ee;)xe>=0&&l.id==xe&&l.size>=0?(l.end<=Wi-s&&(p(Ot,zt,B,Ne,l.end,Wi,xe,j,dt),Ne=Ot.length,Wi=l.end),l.next()):z>2500?u(B,ee,Ot,zt):f(B,ee,Ot,zt,xe,z+1);if(xe>=0&&Ne>0&&Ne-1&&Ne>0){let Jr=d(kt,dt);Wt=Br(kt,Ot,zt,0,Ot.length,0,W-B,Jr,Jr)}else Wt=g(kt,Ot,zt,W-B,j-W,dt)}A.push(Wt),R.push(Dt)}function u(w,v,A,R){let I=[],z=0,E=-1;for(;l.pos>v;){let{id:B,start:W,end:V,size:j}=l;if(j>4)l.next();else{if(E>-1&&W=0;V-=3)B[j++]=I[V],B[j++]=I[V+1]-W,B[j++]=I[V+2]-W,B[j++]=j;A.push(new me(B,I[2]-W,i)),R.push(W-w)}}function d(w,v){return(A,R,I)=>{let z=0,E=A.length-1,B,W;if(E>=0&&(B=A[E])instanceof U){if(!E&&B.type==w&&B.length==I)return B;(W=B.prop(L.lookAhead))&&(z=R[E]+B.length+W)}return g(w,A,R,I,z,v)}}function p(w,v,A,R,I,z,E,B,W){let V=[],j=[];for(;w.length>R;)V.push(w.pop()),j.push(v.pop()+A-I);w.push(g(i.types[E],V,j,z-I,B-z,W)),v.push(I-A)}function g(w,v,A,R,I,z,E){if(z){let B=[L.contextHash,z];E=E?[B].concat(E):[B]}if(I>25){let B=[L.lookAhead,I];E=E?[B].concat(E):[B]}return new U(w,v,A,R,E)}function m(w,v){let A=l.fork(),R=0,I=0,z=0,E=A.end-s,B={size:0,start:0,skip:0};t:for(let W=A.pos-w;A.pos>W;){let V=A.size;if(A.id==v&&V>=0){B.size=R,B.start=I,B.skip=z,z+=4,R+=4,A.next();continue}let j=A.pos-V;if(V<0||j=o?4:0,kt=A.start;for(A.next();A.pos>j;){if(A.size<0)if(A.size==-3)dt+=4;else break t;else A.id>=o&&(dt+=4);A.next()}I=kt,R+=V,z+=dt}return(v<0||R==w)&&(B.size=R,B.start=I,B.skip=z),B.size>4?B:void 0}function y(w,v,A){let{id:R,start:I,end:z,size:E}=l;if(l.next(),E>=0&&R4){let W=l.pos-(E-4);for(;l.pos>W;)A=y(w,v,A)}v[--A]=B,v[--A]=z-w,v[--A]=I-w,v[--A]=R}else E==-3?c=R:E==-4&&(h=R);return A}let x=[],S=[];for(;l.pos>0;)f(n.start||0,n.bufferStart||0,x,S,-1,0);let k=(t=n.length)!==null&&t!==void 0?t:x.length?S[0]+x[0].length:0;return new U(a[n.topID],x.reverse(),S.reverse(),k)}const Zo=new WeakMap;function mn(n,t){if(!n.isAnonymous||t instanceof me||t.type!=n)return 1;let e=Zo.get(t);if(e==null){e=1;for(let i of t.children){if(i.type!=n||!(i instanceof U)){e=1;break}e+=mn(n,i)}Zo.set(t,e)}return e}function Br(n,t,e,i,s,r,o,l,a){let c=0;for(let p=i;p=h)break;v+=A}if(S==k+1){if(v>h){let A=p[k];d(A.children,A.positions,0,A.children.length,g[k]+x);continue}f.push(p[k])}else{let A=g[S-1]+p[S-1].length-w;f.push(Br(n,p,g,k,S,w,A,null,a))}u.push(w+x-r)}}return d(t,e,i,s,0),(l||a)(f,u,o)}class Rm{constructor(){this.map=new WeakMap}setBuffer(t,e,i){let s=this.map.get(t);s||this.map.set(t,s=new Map),s.set(e,i)}getBuffer(t,e){let i=this.map.get(t);return i&&i.get(e)}set(t,e){t instanceof Yt?this.setBuffer(t.context.buffer,t.index,e):t instanceof ct&&this.map.set(t.tree,e)}get(t){return t instanceof Yt?this.getBuffer(t.context.buffer,t.index):t instanceof ct?this.map.get(t.tree):void 0}cursorSet(t,e){t.buffer?this.setBuffer(t.buffer.buffer,t.index,e):this.map.set(t.tree,e)}cursorGet(t){return t.buffer?this.getBuffer(t.buffer.buffer,t.index):this.map.get(t.tree)}}class se{constructor(t,e,i,s,r=!1,o=!1){this.from=t,this.to=e,this.tree=i,this.offset=s,this.open=(r?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,e=[],i=!1){let s=[new se(0,t.length,t,0,!1,i)];for(let r of e)r.to>t.length&&s.push(r);return s}static applyChanges(t,e,i=128){if(!e.length)return t;let s=[],r=1,o=t.length?t[0]:null;for(let l=0,a=0,c=0;;l++){let h=l=i)for(;o&&o.from=u.from||f<=u.to||c){let d=Math.max(u.from,a)-c,p=Math.min(u.to,f)-c;u=d>=p?null:new se(d,p,u.tree,u.offset+c,l>0,!!h)}if(u&&s.push(u),o.to>f)break;o=rnew Bt(s.from,s.to)):[new Bt(0,0)]:[new Bt(0,t.length)],this.createParse(t,e||[],i)}parse(t,e,i){let s=this.startParse(t,e,i);for(;;){let r=s.advance();if(r)return r}}}class ad{constructor(t){this.string=t}get length(){return this.string.length}chunk(t){return this.string.slice(t)}get lineChunks(){return!1}read(t,e){return this.string.slice(t,e)}}function Lm(n){return(t,e,i,s)=>new cd(t,n,e,i,s)}class tl{constructor(t,e,i,s,r){this.parser=t,this.parse=e,this.overlay=i,this.target=s,this.from=r}}function el(n){if(!n.length||n.some(t=>t.from>=t.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(n))}class hd{constructor(t,e,i,s,r,o,l){this.parser=t,this.predicate=e,this.mounts=i,this.index=s,this.start=r,this.target=o,this.prev=l,this.depth=0,this.ranges=[]}}const tr=new L({perNode:!0});class cd{constructor(t,e,i,s,r){this.nest=e,this.input=i,this.fragments=s,this.ranges=r,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=t}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let s of this.inner)s.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new U(i.type,i.children,i.positions,i.length,i.propValues.concat([[tr,this.stoppedAt]]))),i}let t=this.inner[this.innerDone],e=t.parse.advance();if(e){this.innerDone++;let i=Object.assign(Object.create(null),t.target.props);i[L.mounted.id]=new Mi(e,t.overlay,t.parser),t.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let t=this.input.length;for(let e=this.innerDone;e=this.stoppedAt)l=!1;else if(t.hasNode(s)){if(e){let c=e.mounts.find(h=>h.frag.from<=s.from&&h.frag.to>=s.to&&h.mount.overlay);if(c)for(let h of c.mount.overlay){let f=h.from+c.pos,u=h.to+c.pos;f>=s.from&&u<=s.to&&!e.ranges.some(d=>d.fromf)&&e.ranges.push({from:f,to:u})}}l=!1}else if(i&&(o=fd(i.ranges,s.from,s.to)))l=o!=2;else if(!s.type.isAnonymous&&(r=this.nest(s,this.input))&&(s.fromnew Bt(f.from-s.from,f.to-s.from)):null,s.tree,h.length?h[0].from:s.from)),r.overlay?h.length&&(i={ranges:h,depth:0,prev:i}):l=!1}}else if(e&&(a=e.predicate(s))&&(a===!0&&(a=new Bt(s.from,s.to)),a.from=0&&e.ranges[c].to==a.from?e.ranges[c]={from:e.ranges[c].from,to:a.to}:e.ranges.push(a)}if(l&&s.firstChild())e&&e.depth++,i&&i.depth++;else for(;!s.nextSibling();){if(!s.parent())break t;if(e&&!--e.depth){let c=sl(this.ranges,e.ranges);c.length&&(el(c),this.inner.splice(e.index,0,new tl(e.parser,e.parser.startParse(this.input,rl(e.mounts,c),c),e.ranges.map(h=>new Bt(h.from-e.start,h.to-e.start)),e.target,c[0].from))),e=e.prev}i&&!--i.depth&&(i=i.prev)}}}}function fd(n,t,e){for(let i of n){if(i.from>=e)break;if(i.to>t)return i.from<=t&&i.to>=e?2:1}return 0}function il(n,t,e,i,s,r){if(t=t&&e.enter(i,1,Y.IgnoreOverlays|Y.ExcludeBuffers)||e.next(!1)||(this.done=!0)}hasNode(t){if(this.moveTo(t.from),!this.done&&this.cursor.from+this.offset==t.from&&this.cursor.tree)for(let e=this.cursor.tree;;){if(e==t.tree)return!0;if(e.children.length&&e.positions[0]==0&&e.children[0]instanceof U)e=e.children[0];else break}return!1}}class dd{constructor(t){var e;if(this.fragments=t,this.curTo=0,this.fragI=0,t.length){let i=this.curFrag=t[0];this.curTo=(e=i.tree.prop(tr))!==null&&e!==void 0?e:i.to,this.inner=new nl(i.tree,-i.offset)}else this.curFrag=this.inner=null}hasNode(t){for(;this.curFrag&&t.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=t.from&&this.curTo>=t.to&&this.inner.hasNode(t)}nextFrag(){var t;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let e=this.curFrag=this.fragments[this.fragI];this.curTo=(t=e.tree.prop(tr))!==null&&t!==void 0?t:e.to,this.inner=new nl(e.tree,-e.offset)}}findMounts(t,e){var i;let s=[];if(this.inner){this.inner.cursor.moveTo(t,1);for(let r=this.inner.cursor.node;r;r=r.parent){let o=(i=r.tree)===null||i===void 0?void 0:i.prop(L.mounted);if(o&&o.parser==e)for(let l=this.fragI;l=r.to)break;a.tree==this.curFrag.tree&&s.push({frag:a,pos:r.from-a.offset,mount:o})}}}return s}}function sl(n,t){let e=null,i=t;for(let s=1,r=0;s=l)break;a.to<=o||(e||(i=e=t.slice()),a.froml&&e.splice(r+1,0,new Bt(l,a.to))):a.to>l?e[r--]=new Bt(l,a.to):e.splice(r--,1))}}return i}function pd(n,t,e,i){let s=0,r=0,o=!1,l=!1,a=-1e9,c=[];for(;;){let h=s==n.length?1e9:o?n[s].to:n[s].from,f=r==t.length?1e9:l?t[r].to:t[r].from;if(o!=l){let u=Math.max(a,e),d=Math.min(h,f,i);unew Bt(u.from+i,u.to+i)),f=pd(t,h,a,c);for(let u=0,d=a;;u++){let p=u==f.length,g=p?c:f[u].from;if(g>d&&e.push(new se(d,g,s.tree,-o,r.from>=d||r.openStart,r.to<=g||r.openEnd)),p)break;d=f[u].to}}else e.push(new se(a,c,s.tree,-o,r.from>=o||r.openStart,r.to<=l||r.openEnd))}return e}let gd=0;class Tt{constructor(t,e,i,s){this.name=t,this.set=e,this.base=i,this.modified=s,this.id=gd++}toString(){let{name:t}=this;for(let e of this.modified)e.name&&(t=`${e.name}(${t})`);return t}static define(t,e){let i=typeof t=="string"?t:"?";if(t instanceof Tt&&(e=t),e!=null&&e.base)throw new Error("Can not derive from a modified tag");let s=new Tt(i,[],null,[]);if(s.set.push(s),e)for(let r of e.set)s.set.push(r);return s}static defineModifier(t){let e=new Dn(t);return i=>i.modified.indexOf(e)>-1?i:Dn.get(i.base||i,i.modified.concat(e).sort((s,r)=>s.id-r.id))}}let md=0;class Dn{constructor(t){this.name=t,this.instances=[],this.id=md++}static get(t,e){if(!e.length)return t;let i=e[0].instances.find(l=>l.base==t&&yd(e,l.modified));if(i)return i;let s=[],r=new Tt(t.name,s,t,e);for(let l of e)l.instances.push(r);let o=bd(e);for(let l of t.set)if(!l.modified.length)for(let a of o)s.push(Dn.get(l,a));return r}}function yd(n,t){return n.length==t.length&&n.every((e,i)=>e==t[i])}function bd(n){let t=[[]];for(let e=0;ei.length-e.length)}function xd(n){let t=Object.create(null);for(let e in n){let i=n[e];Array.isArray(i)||(i=[i]);for(let s of e.split(" "))if(s){let r=[],o=2,l=s;for(let f=0;;){if(l=="..."&&f>0&&f+3==s.length){o=1;break}let u=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!u)throw new RangeError("Invalid path: "+s);if(r.push(u[0]=="*"?"":u[0][0]=='"'?JSON.parse(u[0]):u[0]),f+=u[0].length,f==s.length)break;let d=s[f++];if(f==s.length&&d=="!"){o=0;break}if(d!="/")throw new RangeError("Invalid path: "+s);l=s.slice(f)}let a=r.length-1,c=r[a];if(!c)throw new RangeError("Invalid path: "+s);let h=new On(i,o,a>0?r.slice(0,a):null);t[c]=h.sort(t[c])}}return fh.add(t)}const fh=new L;class On{constructor(t,e,i,s){this.tags=t,this.mode=e,this.context=i,this.next=s}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(t){return!t||t.depth{let o=s;for(let l of r)for(let a of l.set){let c=e[a.id];if(c){o=o?o+" "+c:c;break}}return o},scope:i}}function wd(n,t){let e=null;for(let i of n){let s=i.style(t);s&&(e=e?e+" "+s:s)}return e}function Sd(n,t,e,i=0,s=n.length){let r=new kd(i,Array.isArray(t)?t:[t],e);r.highlightRange(n.cursor(),i,s,"",r.highlighters),r.flush(s)}class kd{constructor(t,e,i){this.at=t,this.highlighters=e,this.span=i,this.class=""}startSpan(t,e){e!=this.class&&(this.flush(t),t>this.at&&(this.at=t),this.class=e)}flush(t){t>this.at&&this.class&&this.span(this.at,t,this.class)}highlightRange(t,e,i,s,r){let{type:o,from:l,to:a}=t;if(l>=i||a<=e)return;o.isTop&&(r=this.highlighters.filter(d=>!d.scope||d.scope(o)));let c=s,h=vd(t)||On.empty,f=wd(r,h.tags);if(f&&(c&&(c+=" "),c+=f,h.mode==1&&(s+=(s?" ":"")+f)),this.startSpan(Math.max(e,l),c),h.opaque)return;let u=t.tree&&t.tree.prop(L.mounted);if(u&&u.overlay){let d=t.node.enter(u.overlay[0].from+l,1),p=this.highlighters.filter(m=>!m.scope||m.scope(u.tree.type)),g=t.firstChild();for(let m=0,y=l;;m++){let x=m=S||!t.nextSibling())););if(!x||S>i)break;y=x.to+l,y>e&&(this.highlightRange(d.cursor(),Math.max(e,x.from+l),Math.min(i,y),"",p),this.startSpan(Math.min(i,y),c))}g&&t.parent()}else if(t.firstChild()){u&&(s="");do if(!(t.to<=e)){if(t.from>=i)break;this.highlightRange(t,e,i,s,r),this.startSpan(Math.min(i,t.to),c)}while(t.nextSibling());t.parent()}}}function vd(n){let t=n.type.prop(fh);for(;t&&t.context&&!n.matchContext(t.context);)t=t.next;return t||null}const C=Tt.define,tn=C(),le=C(),ol=C(le),ll=C(le),ae=C(),en=C(ae),ls=C(ae),jt=C(),we=C(jt),Kt=C(),$t=C(),er=C(),ai=C(er),nn=C(),M={comment:tn,lineComment:C(tn),blockComment:C(tn),docComment:C(tn),name:le,variableName:C(le),typeName:ol,tagName:C(ol),propertyName:ll,attributeName:C(ll),className:C(le),labelName:C(le),namespace:C(le),macroName:C(le),literal:ae,string:en,docString:C(en),character:C(en),attributeValue:C(en),number:ls,integer:C(ls),float:C(ls),bool:C(ae),regexp:C(ae),escape:C(ae),color:C(ae),url:C(ae),keyword:Kt,self:C(Kt),null:C(Kt),atom:C(Kt),unit:C(Kt),modifier:C(Kt),operatorKeyword:C(Kt),controlKeyword:C(Kt),definitionKeyword:C(Kt),moduleKeyword:C(Kt),operator:$t,derefOperator:C($t),arithmeticOperator:C($t),logicOperator:C($t),bitwiseOperator:C($t),compareOperator:C($t),updateOperator:C($t),definitionOperator:C($t),typeOperator:C($t),controlOperator:C($t),punctuation:er,separator:C(er),bracket:ai,angleBracket:C(ai),squareBracket:C(ai),paren:C(ai),brace:C(ai),content:jt,heading:we,heading1:C(we),heading2:C(we),heading3:C(we),heading4:C(we),heading5:C(we),heading6:C(we),contentSeparator:C(jt),list:C(jt),quote:C(jt),emphasis:C(jt),strong:C(jt),link:C(jt),monospace:C(jt),strikethrough:C(jt),inserted:C(),deleted:C(),changed:C(),invalid:C(),meta:nn,documentMeta:C(nn),annotation:C(nn),processingInstruction:C(nn),definition:Tt.defineModifier("definition"),constant:Tt.defineModifier("constant"),function:Tt.defineModifier("function"),standard:Tt.defineModifier("standard"),local:Tt.defineModifier("local"),special:Tt.defineModifier("special")};for(let n in M){let t=M[n];t instanceof Tt&&(t.name=n)}uh([{tag:M.link,class:"tok-link"},{tag:M.heading,class:"tok-heading"},{tag:M.emphasis,class:"tok-emphasis"},{tag:M.strong,class:"tok-strong"},{tag:M.keyword,class:"tok-keyword"},{tag:M.atom,class:"tok-atom"},{tag:M.bool,class:"tok-bool"},{tag:M.url,class:"tok-url"},{tag:M.labelName,class:"tok-labelName"},{tag:M.inserted,class:"tok-inserted"},{tag:M.deleted,class:"tok-deleted"},{tag:M.literal,class:"tok-literal"},{tag:M.string,class:"tok-string"},{tag:M.number,class:"tok-number"},{tag:[M.regexp,M.escape,M.special(M.string)],class:"tok-string2"},{tag:M.variableName,class:"tok-variableName"},{tag:M.local(M.variableName),class:"tok-variableName tok-local"},{tag:M.definition(M.variableName),class:"tok-variableName tok-definition"},{tag:M.special(M.variableName),class:"tok-variableName2"},{tag:M.definition(M.propertyName),class:"tok-propertyName tok-definition"},{tag:M.typeName,class:"tok-typeName"},{tag:M.namespace,class:"tok-namespace"},{tag:M.className,class:"tok-className"},{tag:M.macroName,class:"tok-macroName"},{tag:M.propertyName,class:"tok-propertyName"},{tag:M.operator,class:"tok-operator"},{tag:M.comment,class:"tok-comment"},{tag:M.meta,class:"tok-meta"},{tag:M.invalid,class:"tok-invalid"},{tag:M.punctuation,class:"tok-punctuation"}]);var as;const Ce=new L;function dh(n){return T.define({combine:n?t=>t.concat(n):void 0})}const Cd=new L;class Pt{constructor(t,e,i=[],s=""){this.data=t,this.name=s,H.prototype.hasOwnProperty("tree")||Object.defineProperty(H.prototype,"tree",{get(){return St(this)}}),this.parser=e,this.extension=[Ze.of(this),H.languageData.of((r,o,l)=>{let a=al(r,o,l),c=a.type.prop(Ce);if(!c)return[];let h=r.facet(c),f=a.type.prop(Cd);if(f){let u=a.resolve(o-a.from,l);for(let d of f)if(d.test(u,r)){let p=r.facet(d.facet);return d.type=="replace"?p:p.concat(h)}}return h})].concat(i)}isActiveAt(t,e,i=-1){return al(t,e,i).type.prop(Ce)==this.data}findRegions(t){let e=t.facet(Ze);if((e==null?void 0:e.data)==this.data)return[{from:0,to:t.doc.length}];if(!e||!e.allowsNesting)return[];let i=[],s=(r,o)=>{if(r.prop(Ce)==this.data){i.push({from:o,to:o+r.length});return}let l=r.prop(L.mounted);if(l){if(l.tree.prop(Ce)==this.data){if(l.overlay)for(let a of l.overlay)i.push({from:a.from+o,to:a.to+o});else i.push({from:o,to:o+r.length});return}else if(l.overlay){let a=i.length;if(s(l.tree,l.overlay[0].from+o),i.length>a)return}}for(let a=0;ai.isTop?e:void 0)]}),t.name)}configure(t,e){return new ir(this.data,this.parser.configure(t),e||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function St(n){let t=n.field(Pt.state,!1);return t?t.tree:U.empty}class Ad{constructor(t){this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter()}get length(){return this.doc.length}syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}chunk(t){return this.syncTo(t),this.string}get lineChunks(){return!0}read(t,e){let i=this.cursorPos-this.string.length;return t=this.cursorPos?this.doc.sliceString(t,e):this.string.slice(t-i,e-i)}}let hi=null;class _e{constructor(t,e,i=[],s,r,o,l,a){this.parser=t,this.state=e,this.fragments=i,this.tree=s,this.treeLen=r,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(t,e,i){return new _e(t,e,[],U.empty,0,i,[],null)}startParse(){return this.parser.startParse(new Ad(this.state.doc),this.fragments)}work(t,e){return e!=null&&e>=this.state.doc.length&&(e=void 0),this.tree!=U.empty&&this.isDone(e??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof t=="number"){let s=Date.now()+t;t=()=>Date.now()>s}for(this.parse||(this.parse=this.startParse()),e!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&e=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext(()=>{for(;!(e=this.parse.advance()););}),this.treeLen=t,this.tree=e,this.fragments=this.withoutTempSkipped(se.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let e=hi;hi=this;try{return t()}finally{hi=e}}withoutTempSkipped(t){for(let e;e=this.tempSkipped.pop();)t=hl(t,e.from,e.to);return t}changes(t,e){let{fragments:i,tree:s,treeLen:r,viewport:o,skipped:l}=this;if(this.takeTree(),!t.empty){let a=[];if(t.iterChangedRanges((c,h,f,u)=>a.push({fromA:c,toA:h,fromB:f,toB:u})),i=se.applyChanges(i,a),s=U.empty,r=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length){l=[];for(let c of this.skipped){let h=t.mapPos(c.from,1),f=t.mapPos(c.to,-1);ht.from&&(this.fragments=hl(this.fragments,s,r),this.skipped.splice(i--,1))}return this.skipped.length>=e?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(t,e){this.skipped.push({from:t,to:e})}static getSkippingParser(t){return new class extends ch{createParse(e,i,s){let r=s[0].from,o=s[s.length-1].to;return{parsedPos:r,advance(){let a=hi;if(a){for(let c of s)a.tempSkipped.push(c);t&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,t]):t)}return this.parsedPos=o,new U(gt.none,[],[],o-r)},stoppedAt:null,stopAt(){}}}}}isDone(t){t=Math.min(t,this.state.doc.length);let e=this.fragments;return this.treeLen>=t&&e.length&&e[0].from==0&&e[0].to>=t}static get(){return hi}}function hl(n,t,e){return se.applyChanges(n,[{fromA:t,toA:e,fromB:t,toB:e}])}class Qe{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let e=this.context.changes(t.changes,t.state),i=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),e.viewport.to);return e.work(20,i)||e.takeTree(),new Qe(e)}static init(t){let e=Math.min(3e3,t.doc.length),i=_e.create(t.facet(Ze).parser,t,{from:0,to:e});return i.work(20,e)||i.takeTree(),new Qe(i)}}Pt.state=mt.define({create:Qe.init,update(n,t){for(let e of t.effects)if(e.is(Pt.setState))return e.value;return t.startState.facet(Ze)!=t.state.facet(Ze)?Qe.init(t.state):n.apply(t)}});let ph=n=>{let t=setTimeout(()=>n(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<"u"&&(ph=n=>{let t=-1,e=setTimeout(()=>{t=requestIdleCallback(n,{timeout:400})},100);return()=>t<0?clearTimeout(e):cancelIdleCallback(t)});const hs=typeof navigator<"u"&&(!((as=navigator.scheduling)===null||as===void 0)&&as.isInputPending)?()=>navigator.scheduling.isInputPending():null,Md=ft.fromClass(class{constructor(t){this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let e=this.view.state.field(Pt.state).context;(e.updateViewport(t.view.viewport)||this.view.viewport.to>e.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(e)}scheduleWork(){if(this.working)return;let{state:t}=this.view,e=t.field(Pt.state);(e.tree!=e.context.tree||!e.context.isDone(t.doc.length))&&(this.working=ph(this.work))}work(t){this.working=null;let e=Date.now();if(this.chunkEnds+1e3,a=r.context.work(()=>hs&&hs()||Date.now()>o,s+(l?0:1e5));this.chunkBudget-=Date.now()-e,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:Pt.setState.of(new Qe(r.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then(()=>this.scheduleWork()).catch(e=>At(this.view.state,e)).then(()=>this.workScheduled--),t.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Ze=T.define({combine(n){return n.length?n[0]:null},enables:n=>[Pt.state,Md,O.contentAttributes.compute([n],t=>{let e=t.facet(n);return e&&e.name?{"data-language":e.name}:{}})]});class Im{constructor(t,e=[]){this.language=t,this.support=e,this.extension=[t,e]}}const Dd=T.define(),qn=T.define({combine:n=>{if(!n.length)return" ";let t=n[0];if(!t||/\S/.test(t)||Array.from(t).some(e=>e!=t[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return t}});function Le(n){let t=n.facet(qn);return t.charCodeAt(0)==9?n.tabSize*t.length:t.length}function Tn(n,t){let e="",i=n.tabSize,s=n.facet(qn)[0];if(s==" "){for(;t>=i;)e+=" ",t-=i;s=" "}for(let r=0;r=t?Od(n,e,t):null}class Kn{constructor(t,e={}){this.state=t,this.options=e,this.unit=Le(t)}lineAt(t,e=1){let i=this.state.doc.lineAt(t),{simulateBreak:s,simulateDoubleBreak:r}=this.options;return s!=null&&s>=i.from&&s<=i.to?r&&s==t?{text:"",from:t}:(e<0?s-1&&(r+=o-this.countColumn(i,i.search(/\S|$/))),r}countColumn(t,e=t.length){return ei(t,this.state.tabSize,e)}lineIndent(t,e=1){let{text:i,from:s}=this.lineAt(t,e),r=this.options.overrideIndentation;if(r){let o=r(s);if(o>-1)return o}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const mh=new L;function Od(n,t,e){let i=t.resolveStack(e),s=i.node.enterUnfinishedNodesBefore(e);if(s!=i.node){let r=[];for(let o=s;o!=i.node;o=o.parent)r.push(o);for(let o=r.length-1;o>=0;o--)i={node:r[o],next:i}}return yh(i,n,e)}function yh(n,t,e){for(let i=n;i;i=i.next){let s=Bd(i.node);if(s)return s(Pr.create(t,e,i))}return 0}function Td(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function Bd(n){let t=n.type.prop(mh);if(t)return t;let e=n.firstChild,i;if(e&&(i=e.type.prop(L.closedBy))){let s=n.lastChild,r=s&&i.indexOf(s.name)>-1;return o=>bh(o,!0,1,void 0,r&&!Td(o)?s.from:void 0)}return n.parent==null?Pd:null}function Pd(){return 0}class Pr extends Kn{constructor(t,e,i){super(t.state,t.options),this.base=t,this.pos=e,this.context=i}get node(){return this.context.node}static create(t,e,i){return new Pr(t,e,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(t){let e=this.state.doc.lineAt(t.from);for(;;){let i=t.resolve(e.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(Rd(i,t))break;e=this.state.doc.lineAt(i.from)}return this.lineIndent(e.from)}continue(){return yh(this.context.next,this.base,this.pos)}}function Rd(n,t){for(let e=t;e;e=e.parent)if(n==e)return!0;return!1}function Ld(n){let t=n.node,e=t.childAfter(t.from),i=t.lastChild;if(!e)return null;let s=n.options.simulateBreak,r=n.state.doc.lineAt(e.from),o=s==null||s<=r.from?r.to:Math.min(r.to,s);for(let l=e.to;;){let a=t.childAfter(l);if(!a||a==i)return null;if(!a.type.isSkipped){if(a.from>=o)return null;let c=/^ */.exec(r.text.slice(e.to-r.from))[0].length;return{from:e.from,to:e.to+c}}l=a.to}}function Nm({closing:n,align:t=!0,units:e=1}){return i=>bh(i,t,e,n)}function bh(n,t,e,i,s){let r=n.textAfter,o=r.match(/^\s*/)[0].length,l=i&&r.slice(o,o+i.length)==i||s==n.pos+o,a=t?Ld(n):null;return a?l?n.column(a.from):n.column(a.to):n.baseIndent+(l?0:n.unit*e)}const Fm=n=>n.baseIndent;function Vm({except:n,units:t=1}={}){return e=>{let i=n&&n.test(e.textAfter);return e.baseIndent+(i?0:t*e.unit)}}const Hm=new L;function Wm(n){let t=n.firstChild,e=n.lastChild;return t&&t.tol.prop(Ce)==o.data:o?l=>l==o:void 0,this.style=uh(t.map(l=>({tag:l.tag,class:l.class||s(Object.assign({},l,{tag:null}))})),{all:r}).style,this.module=i?new de(i):null,this.themeType=e.themeType}static define(t,e){return new $n(t,e||{})}}const nr=T.define(),xh=T.define({combine(n){return n.length?[n[0]]:null}});function cs(n){let t=n.facet(nr);return t.length?t:n.facet(xh)}function zm(n,t){let e=[Id],i;return n instanceof $n&&(n.module&&e.push(O.styleModule.of(n.module)),i=n.themeType),t!=null&&t.fallback?e.push(xh.of(n)):i?e.push(nr.computeN([O.darkTheme],s=>s.facet(O.darkTheme)==(i=="dark")?[n]:[])):e.push(nr.of(n)),e}class Ed{constructor(t){this.markCache=Object.create(null),this.tree=St(t.state),this.decorations=this.buildDeco(t,cs(t.state)),this.decoratedTo=t.viewport.to}update(t){let e=St(t.state),i=cs(t.state),s=i!=cs(t.startState),{viewport:r}=t.view,o=t.changes.mapPos(this.decoratedTo,1);e.length=r.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=o):(e!=this.tree||t.viewportChanged||s)&&(this.tree=e,this.decorations=this.buildDeco(t.view,i),this.decoratedTo=r.to)}buildDeco(t,e){if(!e||!this.tree.length)return P.none;let i=new Oe;for(let{from:s,to:r}of t.visibleRanges)Sd(this.tree,e,(o,l,a)=>{i.add(o,l,this.markCache[a]||(this.markCache[a]=P.mark({class:a})))},s,r);return i.finish()}}const Id=ye.high(ft.fromClass(Ed,{decorations:n=>n.decorations})),qm=$n.define([{tag:M.meta,color:"#404740"},{tag:M.link,textDecoration:"underline"},{tag:M.heading,textDecoration:"underline",fontWeight:"bold"},{tag:M.emphasis,fontStyle:"italic"},{tag:M.strong,fontWeight:"bold"},{tag:M.strikethrough,textDecoration:"line-through"},{tag:M.keyword,color:"#708"},{tag:[M.atom,M.bool,M.url,M.contentSeparator,M.labelName],color:"#219"},{tag:[M.literal,M.inserted],color:"#164"},{tag:[M.string,M.deleted],color:"#a11"},{tag:[M.regexp,M.escape,M.special(M.string)],color:"#e40"},{tag:M.definition(M.variableName),color:"#00f"},{tag:M.local(M.variableName),color:"#30a"},{tag:[M.typeName,M.namespace],color:"#085"},{tag:M.className,color:"#167"},{tag:[M.special(M.variableName),M.macroName],color:"#256"},{tag:M.definition(M.propertyName),color:"#00c"},{tag:M.comment,color:"#940"},{tag:M.invalid,color:"#f00"}]),Nd=O.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),wh=1e4,Sh="()[]{}",kh=T.define({combine(n){return Ee(n,{afterCursor:!0,brackets:Sh,maxScanDistance:wh,renderMatch:Hd})}}),Fd=P.mark({class:"cm-matchingBracket"}),Vd=P.mark({class:"cm-nonmatchingBracket"});function Hd(n){let t=[],e=n.matched?Fd:Vd;return t.push(e.range(n.start.from,n.start.to)),n.end&&t.push(e.range(n.end.from,n.end.to)),t}const Wd=mt.define({create(){return P.none},update(n,t){if(!t.docChanged&&!t.selection)return n;let e=[],i=t.state.facet(kh);for(let s of t.state.selection.ranges){if(!s.empty)continue;let r=Xt(t.state,s.head,-1,i)||s.head>0&&Xt(t.state,s.head-1,1,i)||i.afterCursor&&(Xt(t.state,s.head,1,i)||s.headO.decorations.from(n)}),zd=[Wd,Nd];function Km(n={}){return[kh.of(n),zd]}const qd=new L;function sr(n,t,e){let i=n.prop(t<0?L.openedBy:L.closedBy);if(i)return i;if(n.name.length==1){let s=e.indexOf(n.name);if(s>-1&&s%2==(t<0?1:0))return[e[s+t]]}return null}function rr(n){let t=n.type.prop(qd);return t?t(n.node):n}function Xt(n,t,e,i={}){let s=i.maxScanDistance||wh,r=i.brackets||Sh,o=St(n),l=o.resolveInner(t,e);for(let a=l;a;a=a.parent){let c=sr(a.type,e,r);if(c&&a.from0?t>=h.from&&th.from&&t<=h.to))return Kd(n,t,e,a,h,c,r)}}return $d(n,t,e,o,l.type,s,r)}function Kd(n,t,e,i,s,r,o){let l=i.parent,a={from:s.from,to:s.to},c=0,h=l==null?void 0:l.cursor();if(h&&(e<0?h.childBefore(i.from):h.childAfter(i.to)))do if(e<0?h.to<=i.from:h.from>=i.to){if(c==0&&r.indexOf(h.type.name)>-1&&h.from0)return null;let c={from:e<0?t-1:t,to:e>0?t+1:t},h=n.doc.iterRange(t,e>0?n.doc.length:0),f=0;for(let u=0;!h.next().done&&u<=r;){let d=h.value;e<0&&(u+=d.length);let p=t+u*e;for(let g=e>0?0:d.length-1,m=e>0?d.length:-1;g!=m;g+=e){let y=o.indexOf(d[g]);if(!(y<0||i.resolveInner(p+g,1).type!=s))if(y%2==0==e>0)f++;else{if(f==1)return{start:c,end:{from:p+g,to:p+g+1},matched:y>>1==a>>1};f--}}e>0&&(u+=d.length)}return h.done?{start:c,matched:!1}:null}function cl(n,t,e,i=0,s=0){t==null&&(t=n.search(/[^\s\u00a0]/),t==-1&&(t=n.length));let r=s;for(let o=i;o=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pose}eatSpace(){let t=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t}skipToEnd(){this.pos=this.string.length}skipTo(t){let e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0}backUp(t){this.pos-=t}column(){return this.lastColumnPosi?o.toLowerCase():o,r=this.string.substr(this.pos,t.length);return s(r)==s(t)?(e!==!1&&(this.pos+=t.length),!0):null}else{let s=this.string.slice(this.pos).match(t);return s&&s.index>0?null:(s&&e!==!1&&(this.pos+=s[0].length),s)}}current(){return this.string.slice(this.start,this.pos)}}function jd(n){return{name:n.name||"",token:n.token,blankLine:n.blankLine||(()=>{}),startState:n.startState||(()=>!0),copyState:n.copyState||Ud,indent:n.indent||(()=>null),languageData:n.languageData||{},tokenTable:n.tokenTable||Lr}}function Ud(n){if(typeof n!="object")return n;let t={};for(let e in n){let i=n[e];t[e]=i instanceof Array?i.slice():i}return t}const fl=new WeakMap;class Ch extends Pt{constructor(t){let e=dh(t.languageData),i=jd(t),s,r=new class extends ch{createParse(o,l,a){return new Jd(s,o,l,a)}};super(e,r,[],t.name),this.topNode=_d(e,this),s=this,this.streamParser=i,this.stateAfter=new L({perNode:!0}),this.tokenTable=t.tokenTable?new Oh(i.tokenTable):Xd}static define(t){return new Ch(t)}getIndent(t){let e,{overrideIndentation:i}=t.options;i&&(e=fl.get(t.state),e!=null&&e1e4)return null;for(;r=i&&e+t.length<=s&&t.prop(n.stateAfter);if(r)return{state:n.streamParser.copyState(r),pos:e+t.length};for(let o=t.children.length-1;o>=0;o--){let l=t.children[o],a=e+t.positions[o],c=l instanceof U&&a=t.length)return t;!s&&e==0&&t.type==n.topNode&&(s=!0);for(let r=t.children.length-1;r>=0;r--){let o=t.positions[r],l=t.children[r],a;if(oe&&Rr(n,r.tree,0-r.offset,e,l),c;if(a&&a.pos<=i&&(c=Ah(n,r.tree,e+r.offset,a.pos+r.offset,!1)))return{state:a.state,tree:c}}return{state:n.streamParser.startState(s?Le(s):4),tree:U.empty}}class Jd{constructor(t,e,i,s){this.lang=t,this.input=e,this.fragments=i,this.ranges=s,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=s[s.length-1].to;let r=_e.get(),o=s[0].from,{state:l,tree:a}=Gd(t,i,o,this.to,r==null?void 0:r.state);this.state=l,this.parsedPos=this.chunkStart=o+a.length;for(let c=0;cc.from<=r.viewport.from&&c.to>=r.viewport.from)&&(this.state=this.lang.streamParser.startState(Le(r.state)),r.skipUntilInView(this.parsedPos,r.viewport.from),this.parsedPos=r.viewport.from),this.moveRangeIndex()}advance(){let t=_e.get(),e=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),i=Math.min(e,this.chunkStart+2048);for(t&&(i=Math.min(i,t.viewport.to));this.parsedPos=e?this.finish():t&&this.parsedPos>=t.viewport.to?(t.skipUntilInView(this.parsedPos,e),this.finish()):null}stopAt(t){this.stoppedAt=t}lineAfter(t){let e=this.input.chunk(t);if(this.input.lineChunks)e==` +`&&(e="");else{let i=e.indexOf(` +`);i>-1&&(e=e.slice(0,i))}return t+e.length<=this.to?e:e.slice(0,this.to-t)}nextLine(){let t=this.parsedPos,e=this.lineAfter(t),i=t+e.length;for(let s=this.rangeIndex;;){let r=this.ranges[s].to;if(r>=i||(e=e.slice(0,r-(i-e.length)),s++,s==this.ranges.length))break;let o=this.ranges[s].from,l=this.lineAfter(o);e+=l,i=o+l.length}return{line:e,end:i}}skipGapsTo(t,e,i){for(;;){let s=this.ranges[this.rangeIndex].to,r=t+e;if(i>0?s>r:s>=r)break;let o=this.ranges[++this.rangeIndex].from;e+=o-s}return e}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){s=this.skipGapsTo(e,s,1),e+=s;let l=this.chunk.length;s=this.skipGapsTo(i,s,-1),i+=s,r+=this.chunk.length-l}let o=this.chunk.length-4;return r==4&&o>=0&&this.chunk[o]==t&&this.chunk[o+2]==e?this.chunk[o+2]=i:this.chunk.push(t,e,i,r),s}parseLine(t){let{line:e,end:i}=this.nextLine(),s=0,{streamParser:r}=this.lang,o=new vh(e,t?t.state.tabSize:4,t?Le(t.state):2);if(o.eol())r.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=Mh(r.token,o,this.state);if(l&&(s=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,s)),o.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPost.start)return s}throw new Error("Stream parser failed to advance stream.")}const Lr=Object.create(null),Oi=[gt.none],Yd=new Dr(Oi),ul=[],dl=Object.create(null),Dh=Object.create(null);for(let[n,t]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])Dh[n]=Th(Lr,t);class Oh{constructor(t){this.extra=t,this.table=Object.assign(Object.create(null),Dh)}resolve(t){return t?this.table[t]||(this.table[t]=Th(this.extra,t)):0}}const Xd=new Oh(Lr);function fs(n,t){ul.indexOf(n)>-1||(ul.push(n),console.warn(t))}function Th(n,t){let e=[];for(let l of t.split(" ")){let a=[];for(let c of l.split(".")){let h=n[c]||M[c];h?typeof h=="function"?a.length?a=a.map(h):fs(c,`Modifier ${c} used at start of tag`):a.length?fs(c,`Tag ${c} used as modifier`):a=Array.isArray(h)?h:[h]:fs(c,`Unknown highlighting tag ${c}`)}for(let c of a)e.push(c)}if(!e.length)return 0;let i=t.replace(/ /g,"_"),s=i+" "+e.map(l=>l.id),r=dl[s];if(r)return r.id;let o=dl[s]=gt.define({id:Oi.length,name:i,props:[xd({[i]:e})]});return Oi.push(o),o.id}function _d(n,t){let e=gt.define({id:Oi.length,name:"Document",props:[Ce.add(()=>n),mh.add(()=>i=>t.getIndent(i))],top:!0});return Oi.push(e),e}X.RTL,X.LTR;const Qd=n=>{let{state:t}=n,e=t.doc.lineAt(t.selection.main.from),i=Ir(n.state,e.from);return i.line?Zd(n):i.block?ep(n):!1};function Er(n,t){return({state:e,dispatch:i})=>{if(e.readOnly)return!1;let s=n(t,e);return s?(i(e.update(s)),!0):!1}}const Zd=Er(sp,0),tp=Er(Bh,0),ep=Er((n,t)=>Bh(n,t,np(t)),0);function Ir(n,t){let e=n.languageDataAt("commentTokens",t);return e.length?e[0]:{}}const ci=50;function ip(n,{open:t,close:e},i,s){let r=n.sliceDoc(i-ci,i),o=n.sliceDoc(s,s+ci),l=/\s*$/.exec(r)[0].length,a=/^\s*/.exec(o)[0].length,c=r.length-l;if(r.slice(c-t.length,c)==t&&o.slice(a,a+e.length)==e)return{open:{pos:i-l,margin:l&&1},close:{pos:s+a,margin:a&&1}};let h,f;s-i<=2*ci?h=f=n.sliceDoc(i,s):(h=n.sliceDoc(i,i+ci),f=n.sliceDoc(s-ci,s));let u=/^\s*/.exec(h)[0].length,d=/\s*$/.exec(f)[0].length,p=f.length-d-e.length;return h.slice(u,u+t.length)==t&&f.slice(p,p+e.length)==e?{open:{pos:i+u+t.length,margin:/\s/.test(h.charAt(u+t.length))?1:0},close:{pos:s-d-e.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function np(n){let t=[];for(let e of n.selection.ranges){let i=n.doc.lineAt(e.from),s=e.to<=i.to?i:n.doc.lineAt(e.to);s.from>i.from&&s.from==e.to&&(s=e.to==i.to+1?i:n.doc.lineAt(e.to-1));let r=t.length-1;r>=0&&t[r].to>i.from?t[r].to=s.to:t.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:s.to})}return t}function Bh(n,t,e=t.selection.ranges){let i=e.map(r=>Ir(t,r.from).block);if(!i.every(r=>r))return null;let s=e.map((r,o)=>ip(t,i[o],r.from,r.to));if(n!=2&&!s.every(r=>r))return{changes:t.changes(e.map((r,o)=>s[o]?[]:[{from:r.from,insert:i[o].open+" "},{from:r.to,insert:" "+i[o].close}]))};if(n!=1&&s.some(r=>r)){let r=[];for(let o=0,l;os&&(r==o||o>f.from)){s=f.from;let u=/^\s*/.exec(f.text)[0].length,d=u==f.length,p=f.text.slice(u,u+c.length)==c?u:-1;ur.comment<0&&(!r.empty||r.single))){let r=[];for(let{line:l,token:a,indent:c,empty:h,single:f}of i)(f||!h)&&r.push({from:l.from+c,insert:a+" "});let o=t.changes(r);return{changes:o,selection:t.selection.map(o,1)}}else if(n!=1&&i.some(r=>r.comment>=0)){let r=[];for(let{line:o,comment:l,token:a}of i)if(l>=0){let c=o.from+l,h=c+a.length;o.text[h-o.from]==" "&&h++,r.push({from:c,to:h})}return{changes:r}}return null}const or=oe.define(),rp=oe.define(),op=T.define(),Ph=T.define({combine(n){return Ee(n,{minDepth:100,newGroupDelay:500,joinToEvent:(t,e)=>e},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,e)=>(i,s)=>t(i,s)||e(i,s)})}}),Rh=mt.define({create(){return _t.empty},update(n,t){let e=t.state.facet(Ph),i=t.annotation(or);if(i){let a=wt.fromTransaction(t,i.selection),c=i.side,h=c==0?n.undone:n.done;return a?h=Bn(h,h.length,e.minDepth,a):h=Ih(h,t.startState.selection),new _t(c==0?i.rest:h,c==0?h:i.rest)}let s=t.annotation(rp);if((s=="full"||s=="before")&&(n=n.isolate()),t.annotation(Z.addToHistory)===!1)return t.changes.empty?n:n.addMapping(t.changes.desc);let r=wt.fromTransaction(t),o=t.annotation(Z.time),l=t.annotation(Z.userEvent);return r?n=n.addChanges(r,o,l,e,t):t.selection&&(n=n.addSelection(t.startState.selection,o,l,e.newGroupDelay)),(s=="full"||s=="after")&&(n=n.isolate()),n},toJSON(n){return{done:n.done.map(t=>t.toJSON()),undone:n.undone.map(t=>t.toJSON())}},fromJSON(n){return new _t(n.done.map(wt.fromJSON),n.undone.map(wt.fromJSON))}});function $m(n={}){return[Rh,Ph.of(n),O.domEventHandlers({beforeinput(t,e){let i=t.inputType=="historyUndo"?Lh:t.inputType=="historyRedo"?lr:null;return i?(t.preventDefault(),i(e)):!1}})]}function jn(n,t){return function({state:e,dispatch:i}){if(!t&&e.readOnly)return!1;let s=e.field(Rh,!1);if(!s)return!1;let r=s.pop(n,e,t);return r?(i(r),!0):!1}}const Lh=jn(0,!1),lr=jn(1,!1),lp=jn(0,!0),ap=jn(1,!0);class wt{constructor(t,e,i,s,r){this.changes=t,this.effects=e,this.mapped=i,this.startSelection=s,this.selectionsAfter=r}setSelAfter(t){return new wt(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,e,i;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(e=this.mapped)===null||e===void 0?void 0:e.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(t){return new wt(t.changes&&tt.fromJSON(t.changes),[],t.mapped&&Qt.fromJSON(t.mapped),t.startSelection&&b.fromJSON(t.startSelection),t.selectionsAfter.map(b.fromJSON))}static fromTransaction(t,e){let i=Rt;for(let s of t.startState.facet(op)){let r=s(t);r.length&&(i=i.concat(r))}return!i.length&&t.changes.empty?null:new wt(t.changes.invert(t.startState.doc),i,void 0,e||t.startState.selection,Rt)}static selection(t){return new wt(void 0,Rt,void 0,void 0,t)}}function Bn(n,t,e,i){let s=t+1>e+20?t-e-1:0,r=n.slice(s,t);return r.push(i),r}function hp(n,t){let e=[],i=!1;return n.iterChangedRanges((s,r)=>e.push(s,r)),t.iterChangedRanges((s,r,o,l)=>{for(let a=0;a=c&&o<=h&&(i=!0)}}),i}function cp(n,t){return n.ranges.length==t.ranges.length&&n.ranges.filter((e,i)=>e.empty!=t.ranges[i].empty).length===0}function Eh(n,t){return n.length?t.length?n.concat(t):n:t}const Rt=[],fp=200;function Ih(n,t){if(n.length){let e=n[n.length-1],i=e.selectionsAfter.slice(Math.max(0,e.selectionsAfter.length-fp));return i.length&&i[i.length-1].eq(t)?n:(i.push(t),Bn(n,n.length-1,1e9,e.setSelAfter(i)))}else return[wt.selection([t])]}function up(n){let t=n[n.length-1],e=n.slice();return e[n.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),e}function us(n,t){if(!n.length)return n;let e=n.length,i=Rt;for(;e;){let s=dp(n[e-1],t,i);if(s.changes&&!s.changes.empty||s.effects.length){let r=n.slice(0,e);return r[e-1]=s,r}else t=s.mapped,e--,i=s.selectionsAfter}return i.length?[wt.selection(i)]:Rt}function dp(n,t,e){let i=Eh(n.selectionsAfter.length?n.selectionsAfter.map(l=>l.map(t)):Rt,e);if(!n.changes)return wt.selection(i);let s=n.changes.map(t),r=t.mapDesc(n.changes,!0),o=n.mapped?n.mapped.composeDesc(r):r;return new wt(s,N.mapEffects(n.effects,t),o,n.startSelection.map(r),i)}const pp=/^(input\.type|delete)($|\.)/;class _t{constructor(t,e,i=0,s=void 0){this.done=t,this.undone=e,this.prevTime=i,this.prevUserEvent=s}isolate(){return this.prevTime?new _t(this.done,this.undone):this}addChanges(t,e,i,s,r){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&t.changes&&(!i||pp.test(i))&&(!l.selectionsAfter.length&&e-this.prevTime0&&e-this.prevTimee.empty?n.moveByChar(e,t):Un(e,t))}function ut(n){return n.textDirectionAt(n.state.selection.main.head)==X.LTR}const Fh=n=>Nh(n,!ut(n)),Vh=n=>Nh(n,ut(n));function Hh(n,t){return Ht(n,e=>e.empty?n.moveByGroup(e,t):Un(e,t))}const gp=n=>Hh(n,!ut(n)),mp=n=>Hh(n,ut(n));function yp(n,t,e){if(t.type.prop(e))return!0;let i=t.to-t.from;return i&&(i>2||/[^\s,.;:]/.test(n.sliceDoc(t.from,t.to)))||t.firstChild}function Gn(n,t,e){let i=St(n).resolveInner(t.head),s=e?L.closedBy:L.openedBy;for(let a=t.head;;){let c=e?i.childAfter(a):i.childBefore(a);if(!c)break;yp(n,c,s)?i=c:a=e?c.to:c.from}let r=i.type.prop(s),o,l;return r&&(o=e?Xt(n,i.from,1):Xt(n,i.to,-1))&&o.matched?l=e?o.end.to:o.end.from:l=e?i.to:i.from,b.cursor(l,e?-1:1)}const bp=n=>Ht(n,t=>Gn(n.state,t,!ut(n))),xp=n=>Ht(n,t=>Gn(n.state,t,ut(n)));function Wh(n,t){return Ht(n,e=>{if(!e.empty)return Un(e,t);let i=n.moveVertically(e,t);return i.head!=e.head?i:n.moveToLineBoundary(e,t)})}const zh=n=>Wh(n,!1),qh=n=>Wh(n,!0);function Kh(n){let t=n.scrollDOM.clientHeighto.empty?n.moveVertically(o,t,e.height):Un(o,t));if(s.eq(i.selection))return!1;let r;if(e.selfScroll){let o=n.coordsAtPos(i.selection.main.head),l=n.scrollDOM.getBoundingClientRect(),a=l.top+e.marginTop,c=l.bottom-e.marginBottom;o&&o.top>a&&o.bottom$h(n,!1),ar=n=>$h(n,!0);function be(n,t,e){let i=n.lineBlockAt(t.head),s=n.moveToLineBoundary(t,e);if(s.head==t.head&&s.head!=(e?i.to:i.from)&&(s=n.moveToLineBoundary(t,e,!1)),!e&&s.head==i.from&&i.length){let r=/^\s*/.exec(n.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;r&&t.head!=i.from+r&&(s=b.cursor(i.from+r))}return s}const wp=n=>Ht(n,t=>be(n,t,!0)),Sp=n=>Ht(n,t=>be(n,t,!1)),kp=n=>Ht(n,t=>be(n,t,!ut(n))),vp=n=>Ht(n,t=>be(n,t,ut(n))),Cp=n=>Ht(n,t=>b.cursor(n.lineBlockAt(t.head).from,1)),Ap=n=>Ht(n,t=>b.cursor(n.lineBlockAt(t.head).to,-1));function Mp(n,t,e){let i=!1,s=ii(n.selection,r=>{let o=Xt(n,r.head,-1)||Xt(n,r.head,1)||r.head>0&&Xt(n,r.head-1,1)||r.headMp(n,t);function Nt(n,t){let e=ii(n.state.selection,i=>{let s=t(i);return b.range(i.anchor,s.head,s.goalColumn,s.bidiLevel||void 0)});return e.eq(n.state.selection)?!1:(n.dispatch(te(n.state,e)),!0)}function jh(n,t){return Nt(n,e=>n.moveByChar(e,t))}const Uh=n=>jh(n,!ut(n)),Gh=n=>jh(n,ut(n));function Jh(n,t){return Nt(n,e=>n.moveByGroup(e,t))}const Op=n=>Jh(n,!ut(n)),Tp=n=>Jh(n,ut(n)),Bp=n=>Nt(n,t=>Gn(n.state,t,!ut(n))),Pp=n=>Nt(n,t=>Gn(n.state,t,ut(n)));function Yh(n,t){return Nt(n,e=>n.moveVertically(e,t))}const Xh=n=>Yh(n,!1),_h=n=>Yh(n,!0);function Qh(n,t){return Nt(n,e=>n.moveVertically(e,t,Kh(n).height))}const gl=n=>Qh(n,!1),ml=n=>Qh(n,!0),Rp=n=>Nt(n,t=>be(n,t,!0)),Lp=n=>Nt(n,t=>be(n,t,!1)),Ep=n=>Nt(n,t=>be(n,t,!ut(n))),Ip=n=>Nt(n,t=>be(n,t,ut(n))),Np=n=>Nt(n,t=>b.cursor(n.lineBlockAt(t.head).from)),Fp=n=>Nt(n,t=>b.cursor(n.lineBlockAt(t.head).to)),yl=({state:n,dispatch:t})=>(t(te(n,{anchor:0})),!0),bl=({state:n,dispatch:t})=>(t(te(n,{anchor:n.doc.length})),!0),xl=({state:n,dispatch:t})=>(t(te(n,{anchor:n.selection.main.anchor,head:0})),!0),wl=({state:n,dispatch:t})=>(t(te(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),Vp=({state:n,dispatch:t})=>(t(n.update({selection:{anchor:0,head:n.doc.length},userEvent:"select"})),!0),Hp=({state:n,dispatch:t})=>{let e=Jn(n).map(({from:i,to:s})=>b.range(i,Math.min(s+1,n.doc.length)));return t(n.update({selection:b.create(e),userEvent:"select"})),!0},Wp=({state:n,dispatch:t})=>{let e=ii(n.selection,i=>{let s=St(n),r=s.resolveStack(i.from,1);if(i.empty){let o=s.resolveStack(i.from,-1);o.node.from>=r.node.from&&o.node.to<=r.node.to&&(r=o)}for(let o=r;o;o=o.next){let{node:l}=o;if((l.from=i.to||l.to>i.to&&l.from<=i.from)&&o.next)return b.range(l.to,l.from)}return i});return e.eq(n.selection)?!1:(t(te(n,e)),!0)},zp=({state:n,dispatch:t})=>{let e=n.selection,i=null;return e.ranges.length>1?i=b.create([e.main]):e.main.empty||(i=b.create([b.cursor(e.main.head)])),i?(t(te(n,i)),!0):!1};function Fi(n,t){if(n.state.readOnly)return!1;let e="delete.selection",{state:i}=n,s=i.changeByRange(r=>{let{from:o,to:l}=r;if(o==l){let a=t(r);ao&&(e="delete.forward",a=sn(n,a,!0)),o=Math.min(o,a),l=Math.max(l,a)}else o=sn(n,o,!1),l=sn(n,l,!0);return o==l?{range:r}:{changes:{from:o,to:l},range:b.cursor(o,os(n)))i.between(t,t,(s,r)=>{st&&(t=e?r:s)});return t}const Zh=(n,t,e)=>Fi(n,i=>{let s=i.from,{state:r}=n,o=r.doc.lineAt(s),l,a;if(e&&!t&&s>o.from&&sZh(n,!1,!0),tc=n=>Zh(n,!0,!1),ec=(n,t)=>Fi(n,e=>{let i=e.head,{state:s}=n,r=s.doc.lineAt(i),o=s.charCategorizer(i);for(let l=null;;){if(i==(t?r.to:r.from)){i==e.head&&r.number!=(t?s.doc.lines:1)&&(i+=t?1:-1);break}let a=rt(r.text,i-r.from,t)+r.from,c=r.text.slice(Math.min(i,a)-r.from,Math.max(i,a)-r.from),h=o(c);if(l!=null&&h!=l)break;(c!=" "||i!=e.head)&&(l=h),i=a}return i}),ic=n=>ec(n,!1),qp=n=>ec(n,!0),Kp=n=>Fi(n,t=>{let e=n.lineBlockAt(t.head).to;return t.headFi(n,t=>{let e=n.moveToLineBoundary(t,!1).head;return t.head>e?e:Math.max(0,t.head-1)}),jp=n=>Fi(n,t=>{let e=n.moveToLineBoundary(t,!0).head;return t.head{if(n.readOnly)return!1;let e=n.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:F.of(["",""])},range:b.cursor(i.from)}));return t(n.update(e,{scrollIntoView:!0,userEvent:"input"})),!0},Gp=({state:n,dispatch:t})=>{if(n.readOnly)return!1;let e=n.changeByRange(i=>{if(!i.empty||i.from==0||i.from==n.doc.length)return{range:i};let s=i.from,r=n.doc.lineAt(s),o=s==r.from?s-1:rt(r.text,s-r.from,!1)+r.from,l=s==r.to?s+1:rt(r.text,s-r.from,!0)+r.from;return{changes:{from:o,to:l,insert:n.doc.slice(s,l).append(n.doc.slice(o,s))},range:b.cursor(l)}});return e.changes.empty?!1:(t(n.update(e,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Jn(n){let t=[],e=-1;for(let i of n.selection.ranges){let s=n.doc.lineAt(i.from),r=n.doc.lineAt(i.to);if(!i.empty&&i.to==r.from&&(r=n.doc.lineAt(i.to-1)),e>=s.number){let o=t[t.length-1];o.to=r.to,o.ranges.push(i)}else t.push({from:s.from,to:r.to,ranges:[i]});e=r.number+1}return t}function nc(n,t,e){if(n.readOnly)return!1;let i=[],s=[];for(let r of Jn(n)){if(e?r.to==n.doc.length:r.from==0)continue;let o=n.doc.lineAt(e?r.to+1:r.from-1),l=o.length+1;if(e){i.push({from:r.to,to:o.to},{from:r.from,insert:o.text+n.lineBreak});for(let a of r.ranges)s.push(b.range(Math.min(n.doc.length,a.anchor+l),Math.min(n.doc.length,a.head+l)))}else{i.push({from:o.from,to:r.from},{from:r.to,insert:n.lineBreak+o.text});for(let a of r.ranges)s.push(b.range(a.anchor-l,a.head-l))}}return i.length?(t(n.update({changes:i,scrollIntoView:!0,selection:b.create(s,n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const Jp=({state:n,dispatch:t})=>nc(n,t,!1),Yp=({state:n,dispatch:t})=>nc(n,t,!0);function sc(n,t,e){if(n.readOnly)return!1;let i=[];for(let s of Jn(n))e?i.push({from:s.from,insert:n.doc.slice(s.from,s.to)+n.lineBreak}):i.push({from:s.to,insert:n.lineBreak+n.doc.slice(s.from,s.to)});return t(n.update({changes:i,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Xp=({state:n,dispatch:t})=>sc(n,t,!1),_p=({state:n,dispatch:t})=>sc(n,t,!0),Qp=n=>{if(n.state.readOnly)return!1;let{state:t}=n,e=t.changes(Jn(t).map(({from:s,to:r})=>(s>0?s--:r{let r;if(n.lineWrapping){let o=n.lineBlockAt(s.head),l=n.coordsAtPos(s.head,s.assoc||1);l&&(r=o.bottom+n.documentTop-l.bottom+n.defaultLineHeight/2)}return n.moveVertically(s,!0,r)}).map(e);return n.dispatch({changes:e,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function Zp(n,t){if(/\(\)|\[\]|\{\}/.test(n.sliceDoc(t-1,t+1)))return{from:t,to:t};let e=St(n).resolveInner(t),i=e.childBefore(t),s=e.childAfter(t),r;return i&&s&&i.to<=t&&s.from>=t&&(r=i.type.prop(L.closedBy))&&r.indexOf(s.name)>-1&&n.doc.lineAt(i.to).from==n.doc.lineAt(s.from).from&&!/\S/.test(n.sliceDoc(i.to,s.from))?{from:i.to,to:s.from}:null}const Sl=rc(!1),tg=rc(!0);function rc(n){return({state:t,dispatch:e})=>{if(t.readOnly)return!1;let i=t.changeByRange(s=>{let{from:r,to:o}=s,l=t.doc.lineAt(r),a=!n&&r==o&&Zp(t,r);n&&(r=o=(o<=l.to?l:t.doc.lineAt(o)).to);let c=new Kn(t,{simulateBreak:r,simulateDoubleBreak:!!a}),h=gh(c,r);for(h==null&&(h=ei(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize));ol.from&&r{let s=[];for(let o=i.from;o<=i.to;){let l=n.doc.lineAt(o);l.number>e&&(i.empty||i.to>l.from)&&(t(l,s,i),e=l.number),o=l.to+1}let r=n.changes(s);return{changes:s,range:b.range(r.mapPos(i.anchor,1),r.mapPos(i.head,1))}})}const eg=({state:n,dispatch:t})=>{if(n.readOnly)return!1;let e=Object.create(null),i=new Kn(n,{overrideIndentation:r=>{let o=e[r];return o??-1}}),s=Nr(n,(r,o,l)=>{let a=gh(i,r.from);if(a==null)return;/\S/.test(r.text)||(a=0);let c=/^\s*/.exec(r.text)[0],h=Tn(n,a);(c!=h||l.fromn.readOnly?!1:(t(n.update(Nr(n,(e,i)=>{i.push({from:e.from,insert:n.facet(qn)})}),{userEvent:"input.indent"})),!0),lc=({state:n,dispatch:t})=>n.readOnly?!1:(t(n.update(Nr(n,(e,i)=>{let s=/^\s*/.exec(e.text)[0];if(!s)return;let r=ei(s,n.tabSize),o=0,l=Tn(n,Math.max(0,r-Le(n)));for(;o(n.setTabFocusMode(),!0),ng=[{key:"Ctrl-b",run:Fh,shift:Uh,preventDefault:!0},{key:"Ctrl-f",run:Vh,shift:Gh},{key:"Ctrl-p",run:zh,shift:Xh},{key:"Ctrl-n",run:qh,shift:_h},{key:"Ctrl-a",run:Cp,shift:Np},{key:"Ctrl-e",run:Ap,shift:Fp},{key:"Ctrl-d",run:tc},{key:"Ctrl-h",run:hr},{key:"Ctrl-k",run:Kp},{key:"Ctrl-Alt-h",run:ic},{key:"Ctrl-o",run:Up},{key:"Ctrl-t",run:Gp},{key:"Ctrl-v",run:ar}],sg=[{key:"ArrowLeft",run:Fh,shift:Uh,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:gp,shift:Op,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:kp,shift:Ep,preventDefault:!0},{key:"ArrowRight",run:Vh,shift:Gh,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:mp,shift:Tp,preventDefault:!0},{mac:"Cmd-ArrowRight",run:vp,shift:Ip,preventDefault:!0},{key:"ArrowUp",run:zh,shift:Xh,preventDefault:!0},{mac:"Cmd-ArrowUp",run:yl,shift:xl},{mac:"Ctrl-ArrowUp",run:pl,shift:gl},{key:"ArrowDown",run:qh,shift:_h,preventDefault:!0},{mac:"Cmd-ArrowDown",run:bl,shift:wl},{mac:"Ctrl-ArrowDown",run:ar,shift:ml},{key:"PageUp",run:pl,shift:gl},{key:"PageDown",run:ar,shift:ml},{key:"Home",run:Sp,shift:Lp,preventDefault:!0},{key:"Mod-Home",run:yl,shift:xl},{key:"End",run:wp,shift:Rp,preventDefault:!0},{key:"Mod-End",run:bl,shift:wl},{key:"Enter",run:Sl,shift:Sl},{key:"Mod-a",run:Vp},{key:"Backspace",run:hr,shift:hr},{key:"Delete",run:tc},{key:"Mod-Backspace",mac:"Alt-Backspace",run:ic},{key:"Mod-Delete",mac:"Alt-Delete",run:qp},{mac:"Mod-Backspace",run:$p},{mac:"Mod-Delete",run:jp}].concat(ng.map(n=>({mac:n.key,run:n.run,shift:n.shift}))),Um=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:bp,shift:Bp},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:xp,shift:Pp},{key:"Alt-ArrowUp",run:Jp},{key:"Shift-Alt-ArrowUp",run:Xp},{key:"Alt-ArrowDown",run:Yp},{key:"Shift-Alt-ArrowDown",run:_p},{key:"Escape",run:zp},{key:"Mod-Enter",run:tg},{key:"Alt-l",mac:"Ctrl-l",run:Hp},{key:"Mod-i",run:Wp,preventDefault:!0},{key:"Mod-[",run:lc},{key:"Mod-]",run:oc},{key:"Mod-Alt-\\",run:eg},{key:"Shift-Mod-k",run:Qp},{key:"Shift-Mod-\\",run:Dp},{key:"Mod-/",run:Qd},{key:"Alt-A",run:tp},{key:"Ctrl-m",mac:"Shift-Alt-m",run:ig}].concat(sg),Gm={key:"Tab",run:oc,shift:lc};function ot(){var n=arguments[0];typeof n=="string"&&(n=document.createElement(n));var t=1,e=arguments[1];if(e&&typeof e=="object"&&e.nodeType==null&&!Array.isArray(e)){for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var s=e[i];typeof s=="string"?n.setAttribute(i,s):s!=null&&(n[i]=s)}t++}for(;tn.normalize("NFKD"):n=>n;class ti{constructor(t,e,i=0,s=t.length,r,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(i,s),this.bufferStart=i,this.normalize=r?l=>r(kl(l)):kl,this.query=this.normalize(e)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return yt(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let e=ur(t),i=this.bufferStart+this.bufferPos;this.bufferPos+=Gt(t);let s=this.normalize(e);if(s.length)for(let r=0,o=i;;r++){let l=s.charCodeAt(r),a=this.match(l,o,this.bufferPos+this.bufferStart);if(r==s.length-1){if(a)return this.value=a,this;break}o==i&&rthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let e=this.matchPos<=this.to&&this.re.exec(this.curLine);if(e){let i=this.curLineStart+e.index,s=i+e[0].length;if(this.matchPos=Pn(this.text,s+(i==s?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(ithis.value.to)&&(!this.test||this.test(i,s,e)))return this.value={from:i,to:s,match:e},this;t=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=i||s.to<=e){let l=new $e(e,t.sliceString(e,i));return ds.set(t,l),l}if(s.from==e&&s.to==i)return s;let{text:r,from:o}=s;return o>e&&(r=t.sliceString(e,o)+r,o=e),s.to=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,e=this.re.exec(this.flat.text);if(e&&!e[0]&&e.index==t&&(this.re.lastIndex=t+1,e=this.re.exec(this.flat.text)),e){let i=this.flat.from+e.index,s=i+e[0].length;if((this.flat.to>=this.to||e.index+e[0].length<=this.flat.text.length-10)&&(!this.test||this.test(i,s,e)))return this.value={from:i,to:s,match:e},this.matchPos=Pn(this.text,s+(i==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=$e.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(cc.prototype[Symbol.iterator]=fc.prototype[Symbol.iterator]=function(){return this});function rg(n){try{return new RegExp(n,Fr),!0}catch{return!1}}function Pn(n,t){if(t>=n.length)return t;let e=n.lineAt(t),i;for(;t=56320&&i<57344;)t++;return t}function cr(n){let t=String(n.state.doc.lineAt(n.state.selection.main.head).number),e=ot("input",{class:"cm-textfield",name:"line",value:t}),i=ot("form",{class:"cm-gotoLine",onkeydown:r=>{r.keyCode==27?(r.preventDefault(),n.dispatch({effects:Rn.of(!1)}),n.focus()):r.keyCode==13&&(r.preventDefault(),s())},onsubmit:r=>{r.preventDefault(),s()}},ot("label",n.state.phrase("Go to line"),": ",e)," ",ot("button",{class:"cm-button",type:"submit"},n.state.phrase("go")));function s(){let r=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(e.value);if(!r)return;let{state:o}=n,l=o.doc.lineAt(o.selection.main.head),[,a,c,h,f]=r,u=h?+h.slice(1):0,d=c?+c:l.number;if(c&&f){let m=d/100;a&&(m=m*(a=="-"?-1:1)+l.number/o.doc.lines),d=Math.round(o.doc.lines*m)}else c&&a&&(d=d*(a=="-"?-1:1)+l.number);let p=o.doc.line(Math.max(1,Math.min(o.doc.lines,d))),g=b.cursor(p.from+Math.max(0,Math.min(u,p.length)));n.dispatch({effects:[Rn.of(!1),O.scrollIntoView(g.from,{y:"center"})],selection:g}),n.focus()}return{dom:i}}const Rn=N.define(),vl=mt.define({create(){return!0},update(n,t){for(let e of t.effects)e.is(Rn)&&(n=e.value);return n},provide:n=>An.from(n,t=>t?cr:null)}),og=n=>{let t=Cn(n,cr);if(!t){let e=[Rn.of(!0)];n.state.field(vl,!1)==null&&e.push(N.appendConfig.of([vl,lg])),n.dispatch({effects:e}),t=Cn(n,cr)}return t&&t.dom.querySelector("input").select(),!0},lg=O.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),ag={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},hg=T.define({combine(n){return Ee(n,ag,{highlightWordAroundCursor:(t,e)=>t||e,minSelectionLength:Math.min,maxMatches:Math.min})}});function Jm(n){return[pg,dg]}const cg=P.mark({class:"cm-selectionMatch"}),fg=P.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Cl(n,t,e,i){return(e==0||n(t.sliceDoc(e-1,e))!=J.Word)&&(i==t.doc.length||n(t.sliceDoc(i,i+1))!=J.Word)}function ug(n,t,e,i){return n(t.sliceDoc(e,e+1))==J.Word&&n(t.sliceDoc(i-1,i))==J.Word}const dg=ft.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.selectionSet||n.docChanged||n.viewportChanged)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let t=n.state.facet(hg),{state:e}=n,i=e.selection;if(i.ranges.length>1)return P.none;let s=i.main,r,o=null;if(s.empty){if(!t.highlightWordAroundCursor)return P.none;let a=e.wordAt(s.head);if(!a)return P.none;o=e.charCategorizer(s.head),r=e.sliceDoc(a.from,a.to)}else{let a=s.to-s.from;if(a200)return P.none;if(t.wholeWords){if(r=e.sliceDoc(s.from,s.to),o=e.charCategorizer(s.head),!(Cl(o,e,s.from,s.to)&&ug(o,e,s.from,s.to)))return P.none}else if(r=e.sliceDoc(s.from,s.to),!r)return P.none}let l=[];for(let a of n.visibleRanges){let c=new ti(e.doc,r,a.from,a.to);for(;!c.next().done;){let{from:h,to:f}=c.value;if((!o||Cl(o,e,h,f))&&(s.empty&&h<=s.from&&f>=s.to?l.push(fg.range(h,f)):(h>=s.to||f<=s.from)&&l.push(cg.range(h,f)),l.length>t.maxMatches))return P.none}}return P.set(l)}},{decorations:n=>n.decorations}),pg=O.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),gg=({state:n,dispatch:t})=>{let{selection:e}=n,i=b.create(e.ranges.map(s=>n.wordAt(s.head)||b.cursor(s.head)),e.mainIndex);return i.eq(e)?!1:(t(n.update({selection:i})),!0)};function mg(n,t){let{main:e,ranges:i}=n.selection,s=n.wordAt(e.head),r=s&&s.from==e.from&&s.to==e.to;for(let o=!1,l=new ti(n.doc,t,i[i.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new ti(n.doc,t,0,Math.max(0,i[i.length-1].from-1)),o=!0}else{if(o&&i.some(a=>a.from==l.value.from))continue;if(r){let a=n.wordAt(l.value.from);if(!a||a.from!=l.value.from||a.to!=l.value.to)continue}return l.value}}const yg=({state:n,dispatch:t})=>{let{ranges:e}=n.selection;if(e.some(r=>r.from===r.to))return gg({state:n,dispatch:t});let i=n.sliceDoc(e[0].from,e[0].to);if(n.selection.ranges.some(r=>n.sliceDoc(r.from,r.to)!=i))return!1;let s=mg(n,i);return s?(t(n.update({selection:n.selection.addRange(b.range(s.from,s.to),!1),effects:O.scrollIntoView(s.to)})),!0):!1},ni=T.define({combine(n){return Ee(n,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new Og(t),scrollToMatch:t=>O.scrollIntoView(t)})}});class uc{constructor(t){this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||rg(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,(e,i)=>i=="n"?` +`:i=="r"?"\r":i=="t"?" ":"\\")}eq(t){return this.search==t.search&&this.replace==t.replace&&this.caseSensitive==t.caseSensitive&&this.regexp==t.regexp&&this.wholeWord==t.wholeWord}create(){return this.regexp?new Sg(this):new xg(this)}getCursor(t,e=0,i){let s=t.doc?t:H.create({doc:t});return i==null&&(i=s.doc.length),this.regexp?He(this,s,e,i):Ve(this,s,e,i)}}class dc{constructor(t){this.spec=t}}function Ve(n,t,e,i){return new ti(t.doc,n.unquoted,e,i,n.caseSensitive?void 0:s=>s.toLowerCase(),n.wholeWord?bg(t.doc,t.charCategorizer(t.selection.main.head)):void 0)}function bg(n,t){return(e,i,s,r)=>((r>e||r+s.length=e)return null;s.push(i.value)}return s}highlight(t,e,i,s){let r=Ve(this.spec,t,Math.max(0,e-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,t.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}function He(n,t,e,i){return new cc(t.doc,n.search,{ignoreCase:!n.caseSensitive,test:n.wholeWord?wg(t.charCategorizer(t.selection.main.head)):void 0},e,i)}function Ln(n,t){return n.slice(rt(n,t,!1),t)}function En(n,t){return n.slice(t,rt(n,t))}function wg(n){return(t,e,i)=>!i[0].length||(n(Ln(i.input,i.index))!=J.Word||n(En(i.input,i.index))!=J.Word)&&(n(En(i.input,i.index+i[0].length))!=J.Word||n(Ln(i.input,i.index+i[0].length))!=J.Word)}class Sg extends dc{nextMatch(t,e,i){let s=He(this.spec,t,i,t.doc.length).next();return s.done&&(s=He(this.spec,t,0,e).next()),s.done?null:s.value}prevMatchInRange(t,e,i){for(let s=1;;s++){let r=Math.max(e,i-s*1e4),o=He(this.spec,t,r,i),l=null;for(;!o.next().done;)l=o.value;if(l&&(r==e||l.from>r+10))return l;if(r==e)return null}}prevMatch(t,e,i){return this.prevMatchInRange(t,0,e)||this.prevMatchInRange(t,i,t.doc.length)}getReplacement(t){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,(e,i)=>i=="$"?"$":i=="&"?t.match[0]:i!="0"&&+i=e)return null;s.push(i.value)}return s}highlight(t,e,i,s){let r=He(this.spec,t,Math.max(0,e-250),Math.min(i+250,t.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}const Ti=N.define(),Vr=N.define(),ue=mt.define({create(n){return new ps(fr(n).create(),null)},update(n,t){for(let e of t.effects)e.is(Ti)?n=new ps(e.value.create(),n.panel):e.is(Vr)&&(n=new ps(n.query,e.value?Hr:null));return n},provide:n=>An.from(n,t=>t.panel)});class ps{constructor(t,e){this.query=t,this.panel=e}}const kg=P.mark({class:"cm-searchMatch"}),vg=P.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Cg=ft.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(ue))}update(n){let t=n.state.field(ue);(t!=n.startState.field(ue)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:n,panel:t}){if(!t||!n.spec.valid)return P.none;let{view:e}=this,i=new Oe;for(let s=0,r=e.visibleRanges,o=r.length;sr[s+1].from-2*250;)a=r[++s].to;n.highlight(e.state,l,a,(c,h)=>{let f=e.state.selection.ranges.some(u=>u.from==c&&u.to==h);i.add(c,h,f?vg:kg)})}return i.finish()}},{decorations:n=>n.decorations});function Vi(n){return t=>{let e=t.state.field(ue,!1);return e&&e.query.spec.valid?n(t,e):mc(t)}}const In=Vi((n,{query:t})=>{let{to:e}=n.state.selection.main,i=t.nextMatch(n.state,e,e);if(!i)return!1;let s=b.single(i.from,i.to),r=n.state.facet(ni);return n.dispatch({selection:s,effects:[Wr(n,i),r.scrollToMatch(s.main,n)],userEvent:"select.search"}),gc(n),!0}),Nn=Vi((n,{query:t})=>{let{state:e}=n,{from:i}=e.selection.main,s=t.prevMatch(e,i,i);if(!s)return!1;let r=b.single(s.from,s.to),o=n.state.facet(ni);return n.dispatch({selection:r,effects:[Wr(n,s),o.scrollToMatch(r.main,n)],userEvent:"select.search"}),gc(n),!0}),Ag=Vi((n,{query:t})=>{let e=t.matchAll(n.state,1e3);return!e||!e.length?!1:(n.dispatch({selection:b.create(e.map(i=>b.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),Mg=({state:n,dispatch:t})=>{let e=n.selection;if(e.ranges.length>1||e.main.empty)return!1;let{from:i,to:s}=e.main,r=[],o=0;for(let l=new ti(n.doc,n.sliceDoc(i,s));!l.next().done;){if(r.length>1e3)return!1;l.value.from==i&&(o=r.length),r.push(b.range(l.value.from,l.value.to))}return t(n.update({selection:b.create(r,o),userEvent:"select.search.matches"})),!0},Al=Vi((n,{query:t})=>{let{state:e}=n,{from:i,to:s}=e.selection.main;if(e.readOnly)return!1;let r=t.nextMatch(e,i,i);if(!r)return!1;let o=r,l=[],a,c,h=[];if(o.from==i&&o.to==s&&(c=e.toText(t.getReplacement(o)),l.push({from:o.from,to:o.to,insert:c}),o=t.nextMatch(e,o.from,o.to),h.push(O.announce.of(e.phrase("replaced match on line $",e.doc.lineAt(i).number)+"."))),o){let f=l.length==0||l[0].from>=r.to?0:r.to-r.from-c.length;a=b.single(o.from-f,o.to-f),h.push(Wr(n,o)),h.push(e.facet(ni).scrollToMatch(a.main,n))}return n.dispatch({changes:l,selection:a,effects:h,userEvent:"input.replace"}),!0}),Dg=Vi((n,{query:t})=>{if(n.state.readOnly)return!1;let e=t.matchAll(n.state,1e9).map(s=>{let{from:r,to:o}=s;return{from:r,to:o,insert:t.getReplacement(s)}});if(!e.length)return!1;let i=n.state.phrase("replaced $ matches",e.length)+".";return n.dispatch({changes:e,effects:O.announce.of(i),userEvent:"input.replace.all"}),!0});function Hr(n){return n.state.facet(ni).createPanel(n)}function fr(n,t){var e,i,s,r,o;let l=n.selection.main,a=l.empty||l.to>l.from+100?"":n.sliceDoc(l.from,l.to);if(t&&!a)return t;let c=n.facet(ni);return new uc({search:((e=t==null?void 0:t.literal)!==null&&e!==void 0?e:c.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:(i=t==null?void 0:t.caseSensitive)!==null&&i!==void 0?i:c.caseSensitive,literal:(s=t==null?void 0:t.literal)!==null&&s!==void 0?s:c.literal,regexp:(r=t==null?void 0:t.regexp)!==null&&r!==void 0?r:c.regexp,wholeWord:(o=t==null?void 0:t.wholeWord)!==null&&o!==void 0?o:c.wholeWord})}function pc(n){let t=Cn(n,Hr);return t&&t.dom.querySelector("[main-field]")}function gc(n){let t=pc(n);t&&t==n.root.activeElement&&t.select()}const mc=n=>{let t=n.state.field(ue,!1);if(t&&t.panel){let e=pc(n);if(e&&e!=n.root.activeElement){let i=fr(n.state,t.query.spec);i.valid&&n.dispatch({effects:Ti.of(i)}),e.focus(),e.select()}}else n.dispatch({effects:[Vr.of(!0),t?Ti.of(fr(n.state,t.query.spec)):N.appendConfig.of(Bg)]});return!0},yc=n=>{let t=n.state.field(ue,!1);if(!t||!t.panel)return!1;let e=Cn(n,Hr);return e&&e.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:Vr.of(!1)}),!0},Ym=[{key:"Mod-f",run:mc,scope:"editor search-panel"},{key:"F3",run:In,shift:Nn,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:In,shift:Nn,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:yc,scope:"editor search-panel"},{key:"Mod-Shift-l",run:Mg},{key:"Mod-Alt-g",run:og},{key:"Mod-d",run:yg,preventDefault:!0}];class Og{constructor(t){this.view=t;let e=this.query=t.state.field(ue).query.spec;this.commit=this.commit.bind(this),this.searchField=ot("input",{value:e.search,placeholder:vt(t,"Find"),"aria-label":vt(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=ot("input",{value:e.replace,placeholder:vt(t,"Replace"),"aria-label":vt(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=ot("input",{type:"checkbox",name:"case",form:"",checked:e.caseSensitive,onchange:this.commit}),this.reField=ot("input",{type:"checkbox",name:"re",form:"",checked:e.regexp,onchange:this.commit}),this.wordField=ot("input",{type:"checkbox",name:"word",form:"",checked:e.wholeWord,onchange:this.commit});function i(s,r,o){return ot("button",{class:"cm-button",name:s,onclick:r,type:"button"},o)}this.dom=ot("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,i("next",()=>In(t),[vt(t,"next")]),i("prev",()=>Nn(t),[vt(t,"previous")]),i("select",()=>Ag(t),[vt(t,"all")]),ot("label",null,[this.caseField,vt(t,"match case")]),ot("label",null,[this.reField,vt(t,"regexp")]),ot("label",null,[this.wordField,vt(t,"by word")]),...t.state.readOnly?[]:[ot("br"),this.replaceField,i("replace",()=>Al(t),[vt(t,"replace")]),i("replaceAll",()=>Dg(t),[vt(t,"replace all")])],ot("button",{name:"close",onclick:()=>yc(t),"aria-label":vt(t,"close"),type:"button"},["×"])])}commit(){let t=new uc({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});t.eq(this.query)||(this.query=t,this.view.dispatch({effects:Ti.of(t)}))}keydown(t){Cu(this.view,t,"search-panel")?t.preventDefault():t.keyCode==13&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?Nn:In)(this.view)):t.keyCode==13&&t.target==this.replaceField&&(t.preventDefault(),Al(this.view))}update(t){for(let e of t.transactions)for(let i of e.effects)i.is(Ti)&&!i.value.eq(this.query)&&this.setQuery(i.value)}setQuery(t){this.query=t,this.searchField.value=t.search,this.replaceField.value=t.replace,this.caseField.checked=t.caseSensitive,this.reField.checked=t.regexp,this.wordField.checked=t.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(ni).top}}function vt(n,t){return n.state.phrase(t)}const rn=30,on=/[\s\.,:;?!]/;function Wr(n,{from:t,to:e}){let i=n.state.doc.lineAt(t),s=n.state.doc.lineAt(e).to,r=Math.max(i.from,t-rn),o=Math.min(s,e+rn),l=n.state.sliceDoc(r,o);if(r!=i.from){for(let a=0;al.length-rn;a--)if(!on.test(l[a-1])&&on.test(l[a])){l=l.slice(0,a);break}}return O.announce.of(`${n.state.phrase("current match")}. ${l} ${n.state.phrase("on line")} ${i.number}.`)}const Tg=O.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),Bg=[ue,ye.low(Cg),Tg];class bc{constructor(t,e,i,s){this.state=t,this.pos=e,this.explicit=i,this.view=s,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(t){let e=St(this.state).resolveInner(this.pos,-1);for(;e&&t.indexOf(e.name)<0;)e=e.parent;return e?{from:e.from,to:this.pos,text:this.state.sliceDoc(e.from,this.pos),type:e.type}:null}matchBefore(t){let e=this.state.doc.lineAt(this.pos),i=Math.max(e.from,this.pos-250),s=e.text.slice(i-e.from,this.pos-e.from),r=s.search(xc(t,!1));return r<0?null:{from:i+r,to:this.pos,text:s.slice(r)}}get aborted(){return this.abortListeners==null}addEventListener(t,e,i){t=="abort"&&this.abortListeners&&(this.abortListeners.push(e),i&&i.onDocChange&&(this.abortOnDocChange=!0))}}function Ml(n){let t=Object.keys(n).join(""),e=/\w/.test(t);return e&&(t=t.replace(/\w/g,"")),`[${e?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function Pg(n){let t=Object.create(null),e=Object.create(null);for(let{label:s}of n){t[s[0]]=!0;for(let r=1;rtypeof s=="string"?{label:s}:s),[e,i]=t.every(s=>/^\w+$/.test(s.label))?[/\w*$/,/\w+$/]:Pg(t);return s=>{let r=s.matchBefore(i);return r||s.explicit?{from:r?r.from:s.pos,options:t,validFor:e}:null}}function Xm(n,t){return e=>{for(let i=St(e.state).resolveInner(e.pos,-1);i;i=i.parent){if(n.indexOf(i.name)>-1)return null;if(i.type.isTop)break}return t(e)}}class Dl{constructor(t,e,i,s){this.completion=t,this.source=e,this.match=i,this.score=s}}function Me(n){return n.selection.main.from}function xc(n,t){var e;let{source:i}=n,s=t&&i[0]!="^",r=i[i.length-1]!="$";return!s&&!r?n:new RegExp(`${s?"^":""}(?:${i})${r?"$":""}`,(e=n.flags)!==null&&e!==void 0?e:n.ignoreCase?"i":"")}const zr=oe.define();function Lg(n,t,e,i){let{main:s}=n.selection,r=e-s.from,o=i-s.from;return Object.assign(Object.assign({},n.changeByRange(l=>{if(l!=s&&e!=i&&n.sliceDoc(l.from+r,l.from+o)!=n.sliceDoc(e,i))return{range:l};let a=n.toText(t);return{changes:{from:l.from+r,to:i==s.from?l.to:l.from+o,insert:a},range:b.cursor(l.from+r+a.length)}})),{scrollIntoView:!0,userEvent:"input.complete"})}const Ol=new WeakMap;function Eg(n){if(!Array.isArray(n))return n;let t=Ol.get(n);return t||Ol.set(n,t=Rg(n)),t}const Fn=N.define(),Bi=N.define();class Ig{constructor(t){this.pattern=t,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let e=0;e=48&&w<=57||w>=97&&w<=122?2:w>=65&&w<=90?1:0:(v=ur(w))!=v.toLowerCase()?1:v!=v.toUpperCase()?2:0;(!x||A==1&&m||k==0&&A!=0)&&(e[f]==w||i[f]==w&&(u=!0)?o[f++]=x:o.length&&(y=!1)),k=A,x+=Gt(w)}return f==a&&o[0]==0&&y?this.result(-100+(u?-200:0),o,t):d==a&&p==0?this.ret(-200-t.length+(g==t.length?0:-100),[0,g]):l>-1?this.ret(-700-t.length,[l,l+this.pattern.length]):d==a?this.ret(-900-t.length,[p,g]):f==a?this.result(-100+(u?-200:0)+-700+(y?0:-1100),o,t):e.length==2?null:this.result((s[0]?-700:0)+-200+-1100,s,t)}result(t,e,i){let s=[],r=0;for(let o of e){let l=o+(this.astral?Gt(yt(i,o)):1);r&&s[r-1]==o?s[r-1]=l:(s[r++]=o,s[r++]=l)}return this.ret(t-i.length,s)}}class Ng{constructor(t){this.pattern=t,this.matched=[],this.score=0,this.folded=t.toLowerCase()}match(t){if(t.length!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:Fg,filterStrict:!1,compareCompletions:(t,e)=>t.label.localeCompare(e.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(t,e)=>t&&e,closeOnBlur:(t,e)=>t&&e,icons:(t,e)=>t&&e,tooltipClass:(t,e)=>i=>Tl(t(i),e(i)),optionClass:(t,e)=>i=>Tl(t(i),e(i)),addToOptions:(t,e)=>t.concat(e),filterStrict:(t,e)=>t||e})}});function Tl(n,t){return n?t?n+" "+t:n:t}function Fg(n,t,e,i,s,r){let o=n.textDirection==X.RTL,l=o,a=!1,c="top",h,f,u=t.left-s.left,d=s.right-t.right,p=i.right-i.left,g=i.bottom-i.top;if(l&&u=g||x>t.top?h=e.bottom-t.top:(c="bottom",h=t.bottom-e.top)}let m=(t.bottom-t.top)/r.offsetHeight,y=(t.right-t.left)/r.offsetWidth;return{style:`${c}: ${h/m}px; max-width: ${f/y}px`,class:"cm-completionInfo-"+(a?o?"left-narrow":"right-narrow":l?"left":"right")}}function Vg(n){let t=n.addToOptions.slice();return n.icons&&t.push({render(e){let i=document.createElement("div");return i.classList.add("cm-completionIcon"),e.type&&i.classList.add(...e.type.split(/\s+/g).map(s=>"cm-completionIcon-"+s)),i.setAttribute("aria-hidden","true"),i},position:20}),t.push({render(e,i,s,r){let o=document.createElement("span");o.className="cm-completionLabel";let l=e.displayLabel||e.label,a=0;for(let c=0;ca&&o.appendChild(document.createTextNode(l.slice(a,h)));let u=o.appendChild(document.createElement("span"));u.appendChild(document.createTextNode(l.slice(h,f))),u.className="cm-completionMatchedText",a=f}return ae.position-i.position).map(e=>e.render)}function gs(n,t,e){if(n<=e)return{from:0,to:n};if(t<0&&(t=0),t<=n>>1){let s=Math.floor(t/e);return{from:s*e,to:(s+1)*e}}let i=Math.floor((n-t)/e);return{from:n-(i+1)*e,to:n-i*e}}class Hg{constructor(t,e,i){this.view=t,this.stateField=e,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:a=>this.placeInfo(a),key:this},this.space=null,this.currentClass="";let s=t.state.field(e),{options:r,selected:o}=s.open,l=t.state.facet(et);this.optionContent=Vg(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=gs(r.length,o,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(t.state),this.dom.addEventListener("mousedown",a=>{let{options:c}=t.state.field(e).open;for(let h=a.target,f;h&&h!=this.dom;h=h.parentNode)if(h.nodeName=="LI"&&(f=/-(\d+)$/.exec(h.id))&&+f[1]{let c=t.state.field(this.stateField,!1);c&&c.tooltip&&t.state.facet(et).closeOnBlur&&a.relatedTarget!=t.contentDOM&&t.dispatch({effects:Bi.of(null)})}),this.showOptions(r,s.id)}mount(){this.updateSel()}showOptions(t,e){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t,e,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(t){var e;let i=t.state.field(this.stateField),s=t.startState.field(this.stateField);if(this.updateTooltipClass(t.state),i!=s){let{options:r,selected:o,disabled:l}=i.open;(!s.open||s.open.options!=r)&&(this.range=gs(r.length,o,t.state.facet(et).maxRenderedOptions),this.showOptions(r,i.id)),this.updateSel(),l!=((e=s.open)===null||e===void 0?void 0:e.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(t){let e=this.tooltipClass(t);if(e!=this.currentClass){for(let i of this.currentClass.split(" "))i&&this.dom.classList.remove(i);for(let i of e.split(" "))i&&this.dom.classList.add(i);this.currentClass=e}}positioned(t){this.space=t,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let t=this.view.state.field(this.stateField),e=t.open;if((e.selected>-1&&e.selected=this.range.to)&&(this.range=gs(e.options.length,e.selected,this.view.state.facet(et).maxRenderedOptions),this.showOptions(e.options,t.id)),this.updateSelectedOption(e.selected)){this.destroyInfo();let{completion:i}=e.options[e.selected],{info:s}=i;if(!s)return;let r=typeof s=="string"?document.createTextNode(s):s(i);if(!r)return;"then"in r?r.then(o=>{o&&this.view.state.field(this.stateField,!1)==t&&this.addInfoPane(o,i)}).catch(o=>At(this.view.state,o,"completion info")):this.addInfoPane(r,i)}}addInfoPane(t,e){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",t.nodeType!=null)i.appendChild(t),this.infoDestroy=null;else{let{dom:s,destroy:r}=t;i.appendChild(s),this.infoDestroy=r||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(t){let e=null;for(let i=this.list.firstChild,s=this.range.from;i;i=i.nextSibling,s++)i.nodeName!="LI"||!i.id?s--:s==t?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),e=i):i.hasAttribute("aria-selected")&&i.removeAttribute("aria-selected");return e&&zg(this.list,e),e}measureInfo(){let t=this.dom.querySelector("[aria-selected]");if(!t||!this.info)return null;let e=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),s=t.getBoundingClientRect(),r=this.space;if(!r){let o=this.dom.ownerDocument.defaultView||window;r={left:0,top:0,right:o.innerWidth,bottom:o.innerHeight}}return s.top>Math.min(r.bottom,e.bottom)-10||s.bottomi.from||i.from==0))if(r=u,typeof c!="string"&&c.header)s.appendChild(c.header(c));else{let d=s.appendChild(document.createElement("completion-section"));d.textContent=u}}const h=s.appendChild(document.createElement("li"));h.id=e+"-"+o,h.setAttribute("role","option");let f=this.optionClass(l);f&&(h.className=f);for(let u of this.optionContent){let d=u(l,this.view.state,this.view,a);d&&h.appendChild(d)}}return i.from&&s.classList.add("cm-completionListIncompleteTop"),i.tonew Hg(e,n,t)}function zg(n,t){let e=n.getBoundingClientRect(),i=t.getBoundingClientRect(),s=e.height/n.offsetHeight;i.tope.bottom&&(n.scrollTop+=(i.bottom-e.bottom)/s)}function Bl(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function qg(n,t){let e=[],i=null,s=c=>{e.push(c);let{section:h}=c.completion;if(h){i||(i=[]);let f=typeof h=="string"?h:h.name;i.some(u=>u.name==f)||i.push(typeof h=="string"?{name:f}:h)}},r=t.facet(et);for(let c of n)if(c.hasResult()){let h=c.result.getMatch;if(c.result.filter===!1)for(let f of c.result.options)s(new Dl(f,c.source,h?h(f):[],1e9-e.length));else{let f=t.sliceDoc(c.from,c.to),u,d=r.filterStrict?new Ng(f):new Ig(f);for(let p of c.result.options)if(u=d.match(p.label)){let g=p.displayLabel?h?h(p,u.matched):[]:u.matched;s(new Dl(p,c.source,g,u.score+(p.boost||0)))}}}if(i){let c=Object.create(null),h=0,f=(u,d)=>{var p,g;return((p=u.rank)!==null&&p!==void 0?p:1e9)-((g=d.rank)!==null&&g!==void 0?g:1e9)||(u.namef.score-h.score||a(h.completion,f.completion))){let h=c.completion;!l||l.label!=h.label||l.detail!=h.detail||l.type!=null&&h.type!=null&&l.type!=h.type||l.apply!=h.apply||l.boost!=h.boost?o.push(c):Bl(c.completion)>Bl(l)&&(o[o.length-1]=c),l=c.completion}return o}class We{constructor(t,e,i,s,r,o){this.options=t,this.attrs=e,this.tooltip=i,this.timestamp=s,this.selected=r,this.disabled=o}setSelected(t,e){return t==this.selected||t>=this.options.length?this:new We(this.options,Pl(e,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,e,i,s,r,o){if(s&&!o&&t.some(c=>c.isPending))return s.setDisabled();let l=qg(t,e);if(!l.length)return s&&t.some(c=>c.isPending)?s.setDisabled():null;let a=e.facet(et).selectOnOpen?0:-1;if(s&&s.selected!=a&&s.selected!=-1){let c=s.options[s.selected].completion;for(let h=0;hh.hasResult()?Math.min(c,h.from):c,1e8),create:Jg,above:r.aboveCursor},s?s.timestamp:Date.now(),a,!1)}map(t){return new We(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:t.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}setDisabled(){return new We(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class Vn{constructor(t,e,i){this.active=t,this.id=e,this.open=i}static start(){return new Vn(Ug,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:e}=t,i=e.facet(et),r=(i.override||e.languageDataAt("autocomplete",Me(e)).map(Eg)).map(a=>(this.active.find(h=>h.source==a)||new Lt(a,this.active.some(h=>h.state!=0)?1:0)).update(t,i));r.length==this.active.length&&r.every((a,c)=>a==this.active[c])&&(r=this.active);let o=this.open,l=t.effects.some(a=>a.is(qr));o&&t.docChanged&&(o=o.map(t.changes)),t.selection||r.some(a=>a.hasResult()&&t.changes.touchesRange(a.from,a.to))||!Kg(r,this.active)||l?o=We.build(r,e,this.id,o,i,l):o&&o.disabled&&!r.some(a=>a.isPending)&&(o=null),!o&&r.every(a=>!a.isPending)&&r.some(a=>a.hasResult())&&(r=r.map(a=>a.hasResult()?new Lt(a.source,0):a));for(let a of t.effects)a.is(Sc)&&(o=o&&o.setSelected(a.value,this.id));return r==this.active&&o==this.open?this:new Vn(r,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?$g:jg}}function Kg(n,t){if(n==t)return!0;for(let e=0,i=0;;){for(;e-1&&(e["aria-activedescendant"]=n+"-"+t),e}const Ug=[];function wc(n,t){if(n.isUserEvent("input.complete")){let i=n.annotation(zr);if(i&&t.activateOnCompletion(i))return 12}let e=n.isUserEvent("input.type");return e&&t.activateOnTyping?5:e?1:n.isUserEvent("delete.backward")?2:n.selection?8:n.docChanged?16:0}class Lt{constructor(t,e,i=!1){this.source=t,this.state=e,this.explicit=i}hasResult(){return!1}get isPending(){return this.state==1}update(t,e){let i=wc(t,e),s=this;(i&8||i&16&&this.touches(t))&&(s=new Lt(s.source,0)),i&4&&s.state==0&&(s=new Lt(this.source,1)),s=s.updateFor(t,i);for(let r of t.effects)if(r.is(Fn))s=new Lt(s.source,1,r.value);else if(r.is(Bi))s=new Lt(s.source,0);else if(r.is(qr))for(let o of r.value)o.source==s.source&&(s=o);return s}updateFor(t,e){return this.map(t.changes)}map(t){return this}touches(t){return t.changes.touchesRange(Me(t.state))}}class je extends Lt{constructor(t,e,i,s,r,o){super(t,3,e),this.limit=i,this.result=s,this.from=r,this.to=o}hasResult(){return!0}updateFor(t,e){var i;if(!(e&3))return this.map(t.changes);let s=this.result;s.map&&!t.changes.empty&&(s=s.map(s,t.changes));let r=t.changes.mapPos(this.from),o=t.changes.mapPos(this.to,1),l=Me(t.state);if(l>o||!s||e&2&&(Me(t.startState)==this.from||le.map(t))}}),Sc=N.define(),xt=mt.define({create(){return Vn.start()},update(n,t){return n.update(t)},provide:n=>[sh.from(n,t=>t.tooltip),O.contentAttributes.from(n,t=>t.attrs)]});function Kr(n,t){const e=t.completion.apply||t.completion.label;let i=n.state.field(xt).active.find(s=>s.source==t.source);return i instanceof je?(typeof e=="string"?n.dispatch(Object.assign(Object.assign({},Lg(n.state,e,i.from,i.to)),{annotations:zr.of(t.completion)})):e(n,t.completion,i.from,i.to),!0):!1}const Jg=Wg(xt,Kr);function ln(n,t="option"){return e=>{let i=e.state.field(xt,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp-1?i.open.selected+s*(n?1:-1):n?0:o-1;return l<0?l=t=="page"?0:o-1:l>=o&&(l=t=="page"?o-1:0),e.dispatch({effects:Sc.of(l)}),!0}}const Yg=n=>{let t=n.state.field(xt,!1);return n.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestampn.state.field(xt,!1)?(n.dispatch({effects:Fn.of(!0)}),!0):!1,Xg=n=>{let t=n.state.field(xt,!1);return!t||!t.active.some(e=>e.state!=0)?!1:(n.dispatch({effects:Bi.of(null)}),!0)};class _g{constructor(t,e){this.active=t,this.context=e,this.time=Date.now(),this.updates=[],this.done=void 0}}const Qg=50,Zg=1e3,tm=ft.fromClass(class{constructor(n){this.view=n,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of n.state.field(xt).active)t.isPending&&this.startQuery(t)}update(n){let t=n.state.field(xt),e=n.state.facet(et);if(!n.selectionSet&&!n.docChanged&&n.startState.field(xt)==t)return;let i=n.transactions.some(r=>{let o=wc(r,e);return o&8||(r.selection||r.docChanged)&&!(o&3)});for(let r=0;rQg&&Date.now()-o.time>Zg){for(let l of o.context.abortListeners)try{l()}catch(a){At(this.view.state,a)}o.context.abortListeners=null,this.running.splice(r--,1)}else o.updates.push(...n.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),n.transactions.some(r=>r.effects.some(o=>o.is(Fn)))&&(this.pendingStart=!0);let s=this.pendingStart?50:e.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(r=>r.isPending&&!this.running.some(o=>o.active.source==r.source))?setTimeout(()=>this.startUpdate(),s):-1,this.composing!=0)for(let r of n.transactions)r.isUserEvent("input.type")?this.composing=2:this.composing==2&&r.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:n}=this.view,t=n.field(xt);for(let e of t.active)e.isPending&&!this.running.some(i=>i.active.source==e.source)&&this.startQuery(e);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(et).updateSyncTime))}startQuery(n){let{state:t}=this.view,e=Me(t),i=new bc(t,e,n.explicit,this.view),s=new _g(n,i);this.running.push(s),Promise.resolve(n.source(i)).then(r=>{s.context.aborted||(s.done=r||null,this.scheduleAccept())},r=>{this.view.dispatch({effects:Bi.of(null)}),At(this.view.state,r)})}scheduleAccept(){this.running.every(n=>n.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(et).updateSyncTime))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],e=this.view.state.facet(et),i=this.view.state.field(xt);for(let s=0;sl.source==r.active.source);if(o&&o.isPending)if(r.done==null){let l=new Lt(r.active.source,0);for(let a of r.updates)l=l.update(a,e);l.isPending||t.push(l)}else this.startQuery(o)}(t.length||i.open&&i.open.disabled)&&this.view.dispatch({effects:qr.of(t)})}},{eventHandlers:{blur(n){let t=this.view.state.field(xt,!1);if(t&&t.tooltip&&this.view.state.facet(et).closeOnBlur){let e=t.open&&rh(this.view,t.open.tooltip);(!e||!e.dom.contains(n.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:Bi.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Fn.of(!1)}),20),this.composing=0}}}),em=typeof navigator=="object"&&/Win/.test(navigator.platform),im=ye.highest(O.domEventHandlers({keydown(n,t){let e=t.state.field(xt,!1);if(!e||!e.open||e.open.disabled||e.open.selected<0||n.key.length>1||n.ctrlKey&&!(em&&n.altKey)||n.metaKey)return!1;let i=e.open.options[e.open.selected],s=e.active.find(o=>o.source==i.source),r=i.completion.commitCharacters||s.result.commitCharacters;return r&&r.indexOf(n.key)>-1&&Kr(t,i),!1}})),kc=O.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class nm{constructor(t,e,i,s){this.field=t,this.line=e,this.from=i,this.to=s}}class $r{constructor(t,e,i){this.field=t,this.from=e,this.to=i}map(t){let e=t.mapPos(this.from,-1,at.TrackDel),i=t.mapPos(this.to,1,at.TrackDel);return e==null||i==null?null:new $r(this.field,e,i)}}class jr{constructor(t,e){this.lines=t,this.fieldPositions=e}instantiate(t,e){let i=[],s=[e],r=t.doc.lineAt(e),o=/^\s*/.exec(r.text)[0];for(let a of this.lines){if(i.length){let c=o,h=/^\t*/.exec(a)[0].length;for(let f=0;fnew $r(a.field,s[a.line]+a.from,s[a.line]+a.to));return{text:i,ranges:l}}static parse(t){let e=[],i=[],s=[],r;for(let o of t.split(/\r\n?|\n/)){for(;r=/[#$]\{(?:(\d+)(?::([^}]*))?|((?:\\[{}]|[^}])*))\}/.exec(o);){let l=r[1]?+r[1]:null,a=r[2]||r[3]||"",c=-1,h=a.replace(/\\[{}]/g,f=>f[1]);for(let f=0;f=c&&u.field++}s.push(new nm(c,i.length,r.index,r.index+h.length)),o=o.slice(0,r.index)+a+o.slice(r.index+r[0].length)}o=o.replace(/\\([{}])/g,(l,a,c)=>{for(let h of s)h.line==i.length&&h.from>c&&(h.from--,h.to--);return a}),i.push(o)}return new jr(i,s)}}let sm=P.widget({widget:new class extends Ie{toDOM(){let n=document.createElement("span");return n.className="cm-snippetFieldPosition",n}ignoreEvent(){return!1}}}),rm=P.mark({class:"cm-snippetField"});class si{constructor(t,e){this.ranges=t,this.active=e,this.deco=P.set(t.map(i=>(i.from==i.to?sm:rm).range(i.from,i.to)))}map(t){let e=[];for(let i of this.ranges){let s=i.map(t);if(!s)return null;e.push(s)}return new si(e,this.active)}selectionInsideField(t){return t.ranges.every(e=>this.ranges.some(i=>i.field==this.active&&i.from<=e.from&&i.to>=e.to))}}const Hi=N.define({map(n,t){return n&&n.map(t)}}),om=N.define(),Pi=mt.define({create(){return null},update(n,t){for(let e of t.effects){if(e.is(Hi))return e.value;if(e.is(om)&&n)return new si(n.ranges,e.value)}return n&&t.docChanged&&(n=n.map(t.changes)),n&&t.selection&&!n.selectionInsideField(t.selection)&&(n=null),n},provide:n=>O.decorations.from(n,t=>t?t.deco:P.none)});function Ur(n,t){return b.create(n.filter(e=>e.field==t).map(e=>b.range(e.from,e.to)))}function lm(n){let t=jr.parse(n);return(e,i,s,r)=>{let{text:o,ranges:l}=t.instantiate(e.state,s),a={changes:{from:s,to:r,insert:F.of(o)},scrollIntoView:!0,annotations:i?[zr.of(i),Z.userEvent.of("input.complete")]:void 0};if(l.length&&(a.selection=Ur(l,0)),l.some(c=>c.field>0)){let c=new si(l,0),h=a.effects=[Hi.of(c)];e.state.field(Pi,!1)===void 0&&h.push(N.appendConfig.of([Pi,um,dm,kc]))}e.dispatch(e.state.update(a))}}function vc(n){return({state:t,dispatch:e})=>{let i=t.field(Pi,!1);if(!i||n<0&&i.active==0)return!1;let s=i.active+n,r=n>0&&!i.ranges.some(o=>o.field==s+n);return e(t.update({selection:Ur(i.ranges,s),effects:Hi.of(r?null:new si(i.ranges,s)),scrollIntoView:!0})),!0}}const am=({state:n,dispatch:t})=>n.field(Pi,!1)?(t(n.update({effects:Hi.of(null)})),!0):!1,hm=vc(1),cm=vc(-1),fm=[{key:"Tab",run:hm,shift:cm},{key:"Escape",run:am}],Ll=T.define({combine(n){return n.length?n[0]:fm}}),um=ye.highest(Mr.compute([Ll],n=>n.facet(Ll)));function _m(n,t){return Object.assign(Object.assign({},t),{apply:lm(n)})}const dm=O.domEventHandlers({mousedown(n,t){let e=t.state.field(Pi,!1),i;if(!e||(i=t.posAtCoords({x:n.clientX,y:n.clientY}))==null)return!1;let s=e.ranges.find(r=>r.from<=i&&r.to>=i);return!s||s.field==e.active?!1:(t.dispatch({selection:Ur(e.ranges,s.field),effects:Hi.of(e.ranges.some(r=>r.field>s.field)?new si(e.ranges,s.field):null),scrollIntoView:!0}),!0)}}),Ri={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Ae=N.define({map(n,t){let e=t.mapPos(n,-1,at.TrackAfter);return e??void 0}}),Gr=new class extends De{};Gr.startSide=1;Gr.endSide=-1;const Cc=mt.define({create(){return K.empty},update(n,t){if(n=n.map(t.changes),t.selection){let e=t.state.doc.lineAt(t.selection.main.head);n=n.update({filter:i=>i>=e.from&&i<=e.to})}for(let e of t.effects)e.is(Ae)&&(n=n.update({add:[Gr.range(e.value,e.value+1)]}));return n}});function Qm(){return[gm,Cc]}const ms="()[]{}<>";function Ac(n){for(let t=0;t{if((pm?n.composing:n.compositionStarted)||n.state.readOnly)return!1;let s=n.state.selection.main;if(i.length>2||i.length==2&&Gt(yt(i,0))==1||t!=s.from||e!=s.to)return!1;let r=ym(n.state,i);return r?(n.dispatch(r),!0):!1}),mm=({state:n,dispatch:t})=>{if(n.readOnly)return!1;let i=Mc(n,n.selection.main.head).brackets||Ri.brackets,s=null,r=n.changeByRange(o=>{if(o.empty){let l=bm(n.doc,o.head);for(let a of i)if(a==l&&Yn(n.doc,o.head)==Ac(yt(a,0)))return{changes:{from:o.head-a.length,to:o.head+a.length},range:b.cursor(o.head-a.length)}}return{range:s=o}});return s||t(n.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!s},Zm=[{key:"Backspace",run:mm}];function ym(n,t){let e=Mc(n,n.selection.main.head),i=e.brackets||Ri.brackets;for(let s of i){let r=Ac(yt(s,0));if(t==s)return r==s?Sm(n,s,i.indexOf(s+s+s)>-1,e):xm(n,s,r,e.before||Ri.before);if(t==r&&Dc(n,n.selection.main.from))return wm(n,s,r)}return null}function Dc(n,t){let e=!1;return n.field(Cc).between(0,n.doc.length,i=>{i==t&&(e=!0)}),e}function Yn(n,t){let e=n.sliceString(t,t+2);return e.slice(0,Gt(yt(e,0)))}function bm(n,t){let e=n.sliceString(t-2,t);return Gt(yt(e,0))==e.length?e:e.slice(1)}function xm(n,t,e,i){let s=null,r=n.changeByRange(o=>{if(!o.empty)return{changes:[{insert:t,from:o.from},{insert:e,from:o.to}],effects:Ae.of(o.to+t.length),range:b.range(o.anchor+t.length,o.head+t.length)};let l=Yn(n.doc,o.head);return!l||/\s/.test(l)||i.indexOf(l)>-1?{changes:{insert:t+e,from:o.head},effects:Ae.of(o.head+t.length),range:b.cursor(o.head+t.length)}:{range:s=o}});return s?null:n.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function wm(n,t,e){let i=null,s=n.changeByRange(r=>r.empty&&Yn(n.doc,r.head)==e?{changes:{from:r.head,to:r.head+e.length,insert:e},range:b.cursor(r.head+e.length)}:i={range:r});return i?null:n.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function Sm(n,t,e,i){let s=i.stringPrefixes||Ri.stringPrefixes,r=null,o=n.changeByRange(l=>{if(!l.empty)return{changes:[{insert:t,from:l.from},{insert:t,from:l.to}],effects:Ae.of(l.to+t.length),range:b.range(l.anchor+t.length,l.head+t.length)};let a=l.head,c=Yn(n.doc,a),h;if(c==t){if(El(n,a))return{changes:{insert:t+t,from:a},effects:Ae.of(a+t.length),range:b.cursor(a+t.length)};if(Dc(n,a)){let u=e&&n.sliceDoc(a,a+t.length*3)==t+t+t?t+t+t:t;return{changes:{from:a,to:a+u.length,insert:u},range:b.cursor(a+u.length)}}}else{if(e&&n.sliceDoc(a-2*t.length,a)==t+t&&(h=Il(n,a-2*t.length,s))>-1&&El(n,h))return{changes:{insert:t+t+t+t,from:a},effects:Ae.of(a+t.length),range:b.cursor(a+t.length)};if(n.charCategorizer(a)(c)!=J.Word&&Il(n,a,s)>-1&&!km(n,a,t,s))return{changes:{insert:t+t,from:a},effects:Ae.of(a+t.length),range:b.cursor(a+t.length)}}return{range:r=l}});return r?null:n.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function El(n,t){let e=St(n).resolveInner(t+1);return e.parent&&e.from==t}function km(n,t,e,i){let s=St(n).resolveInner(t,-1),r=i.reduce((o,l)=>Math.max(o,l.length),0);for(let o=0;o<5;o++){let l=n.sliceDoc(s.from,Math.min(s.to,s.from+e.length+r)),a=l.indexOf(e);if(!a||a>-1&&i.indexOf(l.slice(0,a))>-1){let h=s.firstChild;for(;h&&h.from==s.from&&h.to-h.from>e.length+a;){if(n.sliceDoc(h.to-e.length,h.to)==e)return!1;h=h.firstChild}return!0}let c=s.to==t&&s.parent;if(!c)break;s=c}return!1}function Il(n,t,e){let i=n.charCategorizer(t);if(i(n.sliceDoc(t-1,t))!=J.Word)return t;for(let s of e){let r=t-s.length;if(n.sliceDoc(r,t)==s&&i(n.sliceDoc(r-1,r))!=J.Word)return r}return-1}function t0(n={}){return[im,xt,et.of(n),tm,Cm,kc]}const vm=[{key:"Ctrl-Space",run:Rl},{mac:"Alt-`",run:Rl},{key:"Escape",run:Xg},{key:"ArrowDown",run:ln(!0)},{key:"ArrowUp",run:ln(!1)},{key:"PageDown",run:ln(!0,"page")},{key:"PageUp",run:ln(!1,"page")},{key:"Enter",run:Yg}],Cm=ye.highest(Mr.computeN([et],n=>n.facet(et).defaultKeymap?[vm]:[]));export{Lm as A,mh as B,Hn as C,ed as D,O as E,Vm as F,Hm as G,Wm as H,Y as I,Im as J,Rm as K,ir as L,Fm as M,Dr as N,Nm as O,ch as P,Cd as Q,Xm as R,Ch as S,U as T,Rg as U,b as V,_m as W,dh as X,qd as Y,vm as a,H as b,Zm as c,Um as d,Pm as e,Om as f,$m as g,jm as h,Mm as i,Dm as j,zm as k,Km as l,Qm as m,Jm as n,Mr as o,t0 as p,Tm as q,Bm as r,Ym as s,Gm as t,qm as u,St as v,gt as w,L as x,xd as y,M as z}; diff --git a/ui/dist/index.html b/ui/dist/index.html index 7327b060..b29c2864 100644 --- a/ui/dist/index.html +++ b/ui/dist/index.html @@ -37,7 +37,7 @@ window.Prism = window.Prism || {}; window.Prism.manual = true; - + diff --git a/ui/package-lock.json b/ui/package-lock.json index 73f0a28d..5c09d20b 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -22,7 +22,7 @@ "chartjs-adapter-luxon": "^1.2.0", "chartjs-plugin-zoom": "^2.0.1", "luxon": "^3.4.4", - "pocketbase": "^0.22.0-rc", + "pocketbase": "^0.23.0", "sass": "^1.45.0", "svelte": "^4.0.0", "svelte-flatpickr": "^3.3.3", @@ -35,6 +35,7 @@ "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", "dev": true, + "license": "Apache-2.0", "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.24" @@ -48,6 +49,7 @@ "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.18.3.tgz", "integrity": "sha512-1dNIOmiM0z4BIBwxmxEfA1yoxh1MF/6KPBbh20a5vphGV0ictKlgQsbJs6D6SkR6iJpGbpwRsa6PFMNlg9T9pQ==", "dev": true, + "license": "MIT", "dependencies": { "@codemirror/language": "^6.0.0", "@codemirror/state": "^6.0.0", @@ -66,6 +68,7 @@ "resolved": "https://registry.npmjs.org/@codemirror/commands/-/commands-6.7.1.tgz", "integrity": "sha512-llTrboQYw5H4THfhN4U3qCnSZ1SOJ60ohhz+SzU0ADGtwlc533DtklQP0vSFaQuCPDn3BPpOd1GbbnUtwNjsrw==", "dev": true, + "license": "MIT", "dependencies": { "@codemirror/language": "^6.0.0", "@codemirror/state": "^6.4.0", @@ -78,6 +81,7 @@ "resolved": "https://registry.npmjs.org/@codemirror/lang-css/-/lang-css-6.3.1.tgz", "integrity": "sha512-kr5fwBGiGtmz6l0LSJIbno9QrifNMUusivHbnA1H6Dmqy4HZFte3UAICix1VuKo0lMPKQr2rqB+0BkKi/S3Ejg==", "dev": true, + "license": "MIT", "dependencies": { "@codemirror/autocomplete": "^6.0.0", "@codemirror/language": "^6.0.0", @@ -91,6 +95,7 @@ "resolved": "https://registry.npmjs.org/@codemirror/lang-html/-/lang-html-6.4.9.tgz", "integrity": "sha512-aQv37pIMSlueybId/2PVSP6NPnmurFDVmZwzc7jszd2KAF8qd4VBbvNYPXWQq90WIARjsdVkPbw29pszmHws3Q==", "dev": true, + "license": "MIT", "dependencies": { "@codemirror/autocomplete": "^6.0.0", "@codemirror/lang-css": "^6.0.0", @@ -108,6 +113,7 @@ "resolved": "https://registry.npmjs.org/@codemirror/lang-javascript/-/lang-javascript-6.2.2.tgz", "integrity": "sha512-VGQfY+FCc285AhWuwjYxQyUQcYurWlxdKYT4bqwr3Twnd5wP5WSeu52t4tvvuWmljT4EmgEgZCqSieokhtY8hg==", "dev": true, + "license": "MIT", "dependencies": { "@codemirror/autocomplete": "^6.0.0", "@codemirror/language": "^6.6.0", @@ -123,6 +129,7 @@ "resolved": "https://registry.npmjs.org/@codemirror/lang-json/-/lang-json-6.0.1.tgz", "integrity": "sha512-+T1flHdgpqDDlJZ2Lkil/rLiRy684WMLc74xUnjJH48GQdfJo/pudlTRreZmKwzP8/tGdKf83wlbAdOCzlJOGQ==", "dev": true, + "license": "MIT", "dependencies": { "@codemirror/language": "^6.0.0", "@lezer/json": "^1.0.0" @@ -133,6 +140,7 @@ "resolved": "https://registry.npmjs.org/@codemirror/lang-sql/-/lang-sql-6.8.0.tgz", "integrity": "sha512-aGLmY4OwGqN3TdSx3h6QeA1NrvaYtF7kkoWR/+W7/JzB0gQtJ+VJxewlnE3+VImhA4WVlhmkJr109PefOOhjLg==", "dev": true, + "license": "MIT", "dependencies": { "@codemirror/autocomplete": "^6.0.0", "@codemirror/language": "^6.0.0", @@ -147,6 +155,7 @@ "resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.10.6.tgz", "integrity": "sha512-KrsbdCnxEztLVbB5PycWXFxas4EOyk/fPAfruSOnDDppevQgid2XZ+KbJ9u+fDikP/e7MW7HPBTvTb8JlZK9vA==", "dev": true, + "license": "MIT", "dependencies": { "@codemirror/state": "^6.0.0", "@codemirror/view": "^6.23.0", @@ -161,6 +170,7 @@ "resolved": "https://registry.npmjs.org/@codemirror/legacy-modes/-/legacy-modes-6.4.2.tgz", "integrity": "sha512-HsvWu08gOIIk303eZQCal4H4t65O/qp1V4ul4zVa3MHK5FJ0gz3qz3O55FIkm+aQUcshUOjBx38t2hPiJwW5/g==", "dev": true, + "license": "MIT", "dependencies": { "@codemirror/language": "^6.0.0" } @@ -170,6 +180,7 @@ "resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.8.4.tgz", "integrity": "sha512-u4q7PnZlJUojeRe8FJa/njJcMctISGgPQ4PnWsd9268R4ZTtU+tfFYmwkBvgcrK2+QQ8tYFVALVb5fVJykKc5A==", "dev": true, + "license": "MIT", "dependencies": { "@codemirror/state": "^6.0.0", "@codemirror/view": "^6.35.0", @@ -181,6 +192,7 @@ "resolved": "https://registry.npmjs.org/@codemirror/search/-/search-6.5.8.tgz", "integrity": "sha512-PoWtZvo7c1XFeZWmmyaOp2G0XVbOnm+fJzvghqGAktBW3cufwJUWvSCcNG0ppXiBEM05mZu6RhMtXPv2hpllig==", "dev": true, + "license": "MIT", "dependencies": { "@codemirror/state": "^6.0.0", "@codemirror/view": "^6.0.0", @@ -188,18 +200,23 @@ } }, "node_modules/@codemirror/state": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.4.1.tgz", - "integrity": "sha512-QkEyUiLhsJoZkbumGZlswmAhA7CBU02Wrz7zvH4SrcifbsqwlXShVXg65f3v/ts57W3dqyamEriMhij1Z3Zz4A==", - "dev": true + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.5.0.tgz", + "integrity": "sha512-MwBHVK60IiIHDcoMet78lxt6iw5gJOGSbNbOIVBHWVXIH4/Nq1+GQgLLGgI1KlnN86WDXsPudVaqYHKBIx7Eyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@marijn/find-cluster-break": "^1.0.0" + } }, "node_modules/@codemirror/view": { - "version": "6.35.0", - "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.35.0.tgz", - "integrity": "sha512-I0tYy63q5XkaWsJ8QRv5h6ves7kvtrBWjBcnf/bzohFJQc5c14a1AQRdE8QpPF9eMp5Mq2FMm59TCj1gDfE7kw==", + "version": "6.35.3", + "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.35.3.tgz", + "integrity": "sha512-ScY7L8+EGdPl4QtoBiOzE4FELp7JmNUsBvgBcCakXWM2uiv/K89VAzU3BMDscf0DsACLvTKePbd5+cFDTcei6g==", "dev": true, + "license": "MIT", "dependencies": { - "@codemirror/state": "^6.4.0", + "@codemirror/state": "^6.5.0", "style-mod": "^4.1.0", "w3c-keyname": "^2.2.4" } @@ -212,6 +229,7 @@ "ppc64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "aix" @@ -228,6 +246,7 @@ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" @@ -244,6 +263,7 @@ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" @@ -260,6 +280,7 @@ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" @@ -276,6 +297,7 @@ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" @@ -292,6 +314,7 @@ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" @@ -308,6 +331,7 @@ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "freebsd" @@ -324,6 +348,7 @@ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "freebsd" @@ -340,6 +365,7 @@ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -356,6 +382,7 @@ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -372,6 +399,7 @@ "ia32" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -388,6 +416,7 @@ "loong64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -404,6 +433,7 @@ "mips64el" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -420,6 +450,7 @@ "ppc64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -436,6 +467,7 @@ "riscv64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -452,6 +484,7 @@ "s390x" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -468,6 +501,7 @@ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -484,6 +518,7 @@ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "netbsd" @@ -500,6 +535,7 @@ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "openbsd" @@ -516,6 +552,7 @@ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "sunos" @@ -532,6 +569,7 @@ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" @@ -548,6 +586,7 @@ "ia32" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" @@ -564,6 +603,7 @@ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" @@ -573,10 +613,11 @@ } }, "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", - "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz", + "integrity": "sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==", "dev": true, + "license": "MIT", "dependencies": { "@jridgewell/set-array": "^1.2.1", "@jridgewell/sourcemap-codec": "^1.4.10", @@ -591,6 +632,7 @@ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.0.0" } @@ -600,6 +642,7 @@ "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.0.0" } @@ -608,13 +651,15 @@ "version": "1.5.0", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@jridgewell/trace-mapping": { "version": "0.3.25", "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", "dev": true, + "license": "MIT", "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" @@ -624,19 +669,22 @@ "version": "0.3.4", "resolved": "https://registry.npmjs.org/@kurkle/color/-/color-0.3.4.tgz", "integrity": "sha512-M5UknZPHRu3DEDWoipU6sE8PdkZ6Z/S+v4dD+Ke8IaNlpdSQah50lz1KtcFBa2vsdOnwbbnxJwVM4wty6udA5w==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@lezer/common": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.2.3.tgz", "integrity": "sha512-w7ojc8ejBqr2REPsWxJjrMFsA/ysDCFICn8zEOR9mrqzOu2amhITYuLD8ag6XZf0CFXDrhKqw7+tW8cX66NaDA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@lezer/css": { "version": "1.1.9", "resolved": "https://registry.npmjs.org/@lezer/css/-/css-1.1.9.tgz", "integrity": "sha512-TYwgljcDv+YrV0MZFFvYFQHCfGgbPMR6nuqLabBdmZoFH3EP1gvw8t0vae326Ne3PszQkbXfVBjCnf3ZVCr0bA==", "dev": true, + "license": "MIT", "dependencies": { "@lezer/common": "^1.2.0", "@lezer/highlight": "^1.0.0", @@ -648,6 +696,7 @@ "resolved": "https://registry.npmjs.org/@lezer/highlight/-/highlight-1.2.1.tgz", "integrity": "sha512-Z5duk4RN/3zuVO7Jq0pGLJ3qynpxUVsh7IbUbGj88+uV2ApSAn6kWg2au3iJb+0Zi7kKtqffIESgNcRXWZWmSA==", "dev": true, + "license": "MIT", "dependencies": { "@lezer/common": "^1.0.0" } @@ -657,6 +706,7 @@ "resolved": "https://registry.npmjs.org/@lezer/html/-/html-1.3.10.tgz", "integrity": "sha512-dqpT8nISx/p9Do3AchvYGV3qYc4/rKr3IBZxlHmpIKam56P47RSHkSF5f13Vu9hebS1jM0HmtJIwLbWz1VIY6w==", "dev": true, + "license": "MIT", "dependencies": { "@lezer/common": "^1.2.0", "@lezer/highlight": "^1.0.0", @@ -664,10 +714,11 @@ } }, "node_modules/@lezer/javascript": { - "version": "1.4.19", - "resolved": "https://registry.npmjs.org/@lezer/javascript/-/javascript-1.4.19.tgz", - "integrity": "sha512-j44kbR1QL26l6dMunZ1uhKBFteVGLVCBGNUD2sUaMnic+rbTviVuoK0CD1l9FTW31EueWvFFswCKMH7Z+M3JRA==", + "version": "1.4.21", + "resolved": "https://registry.npmjs.org/@lezer/javascript/-/javascript-1.4.21.tgz", + "integrity": "sha512-lL+1fcuxWYPURMM/oFZLEDm0XuLN128QPV+VuGtKpeaOGdcl9F2LYC3nh1S9LkPqx9M0mndZFdXCipNAZpzIkQ==", "dev": true, + "license": "MIT", "dependencies": { "@lezer/common": "^1.2.0", "@lezer/highlight": "^1.1.3", @@ -679,6 +730,7 @@ "resolved": "https://registry.npmjs.org/@lezer/json/-/json-1.0.2.tgz", "integrity": "sha512-xHT2P4S5eeCYECyKNPhr4cbEL9tc8w83SPwRC373o9uEdrvGKTZoJVAGxpOsZckMlEh9W23Pc72ew918RWQOBQ==", "dev": true, + "license": "MIT", "dependencies": { "@lezer/common": "^1.2.0", "@lezer/highlight": "^1.0.0", @@ -690,16 +742,25 @@ "resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.4.2.tgz", "integrity": "sha512-pu0K1jCIdnQ12aWNaAVU5bzi7Bd1w54J3ECgANPmYLtQKP0HBj2cE/5coBD66MT10xbtIuUr7tg0Shbsvk0mDA==", "dev": true, + "license": "MIT", "dependencies": { "@lezer/common": "^1.0.0" } }, + "node_modules/@marijn/find-cluster-break": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@marijn/find-cluster-break/-/find-cluster-break-1.0.2.tgz", + "integrity": "sha512-l0h88YhZFyKdXIFNfSWpyjStDjGHwZ/U7iobcK1cQQD8sejsONdQtTVU+1wVN1PBw40PiiHB1vA5S7VTfQiP9g==", + "dev": true, + "license": "MIT" + }, "node_modules/@parcel/watcher": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.5.0.tgz", "integrity": "sha512-i0GV1yJnm2n3Yq1qw6QrUrd/LI9bE8WEBOTtOkpCXHHdyN3TAGgqAK/DAT05z4fq2x04cARXt2pDmjWjL92iTQ==", "dev": true, "hasInstallScript": true, + "license": "MIT", "optional": true, "dependencies": { "detect-libc": "^1.0.3", @@ -738,6 +799,7 @@ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" @@ -758,6 +820,7 @@ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" @@ -778,6 +841,7 @@ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" @@ -798,6 +862,7 @@ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "freebsd" @@ -818,6 +883,7 @@ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -838,6 +904,7 @@ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -858,6 +925,7 @@ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -878,6 +946,7 @@ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -898,6 +967,7 @@ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -918,6 +988,7 @@ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -938,6 +1009,7 @@ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" @@ -958,6 +1030,7 @@ "ia32" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" @@ -978,6 +1051,7 @@ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" @@ -991,234 +1065,266 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.28.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.28.0.tgz", - "integrity": "sha512-wLJuPLT6grGZsy34g4N1yRfYeouklTgPhH1gWXCYspenKYD0s3cR99ZevOGw5BexMNywkbV3UkjADisozBmpPQ==", + "version": "4.28.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.28.1.tgz", + "integrity": "sha512-2aZp8AES04KI2dy3Ss6/MDjXbwBzj+i0GqKtWXgw2/Ma6E4jJvujryO6gJAghIRVz7Vwr9Gtl/8na3nDUKpraQ==", "cpu": [ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.28.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.28.0.tgz", - "integrity": "sha512-eiNkznlo0dLmVG/6wf+Ifi/v78G4d4QxRhuUl+s8EWZpDewgk7PX3ZyECUXU0Zq/Ca+8nU8cQpNC4Xgn2gFNDA==", + "version": "4.28.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.28.1.tgz", + "integrity": "sha512-EbkK285O+1YMrg57xVA+Dp0tDBRB93/BZKph9XhMjezf6F4TpYjaUSuPt5J0fZXlSag0LmZAsTmdGGqPp4pQFA==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.28.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.28.0.tgz", - "integrity": "sha512-lmKx9yHsppblnLQZOGxdO66gT77bvdBtr/0P+TPOseowE7D9AJoBw8ZDULRasXRWf1Z86/gcOdpBrV6VDUY36Q==", + "version": "4.28.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.28.1.tgz", + "integrity": "sha512-prduvrMKU6NzMq6nxzQw445zXgaDBbMQvmKSJaxpaZ5R1QDM8w+eGxo6Y/jhT/cLoCvnZI42oEqf9KQNYz1fqQ==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.28.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.28.0.tgz", - "integrity": "sha512-8hxgfReVs7k9Js1uAIhS6zq3I+wKQETInnWQtgzt8JfGx51R1N6DRVy3F4o0lQwumbErRz52YqwjfvuwRxGv1w==", + "version": "4.28.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.28.1.tgz", + "integrity": "sha512-WsvbOunsUk0wccO/TV4o7IKgloJ942hVFK1CLatwv6TJspcCZb9umQkPdvB7FihmdxgaKR5JyxDjWpCOp4uZlQ==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" ] }, "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.28.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.28.0.tgz", - "integrity": "sha512-lA1zZB3bFx5oxu9fYud4+g1mt+lYXCoch0M0V/xhqLoGatbzVse0wlSQ1UYOWKpuSu3gyN4qEc0Dxf/DII1bhQ==", + "version": "4.28.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.28.1.tgz", + "integrity": "sha512-HTDPdY1caUcU4qK23FeeGxCdJF64cKkqajU0iBnTVxS8F7H/7BewvYoG+va1KPSL63kQ1PGNyiwKOfReavzvNA==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "freebsd" ] }, "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.28.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.28.0.tgz", - "integrity": "sha512-aI2plavbUDjCQB/sRbeUZWX9qp12GfYkYSJOrdYTL/C5D53bsE2/nBPuoiJKoWp5SN78v2Vr8ZPnB+/VbQ2pFA==", + "version": "4.28.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.28.1.tgz", + "integrity": "sha512-m/uYasxkUevcFTeRSM9TeLyPe2QDuqtjkeoTpP9SW0XxUWfcYrGDMkO/m2tTw+4NMAF9P2fU3Mw4ahNvo7QmsQ==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "freebsd" ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.28.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.28.0.tgz", - "integrity": "sha512-WXveUPKtfqtaNvpf0iOb0M6xC64GzUX/OowbqfiCSXTdi/jLlOmH0Ba94/OkiY2yTGTwteo4/dsHRfh5bDCZ+w==", + "version": "4.28.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.28.1.tgz", + "integrity": "sha512-QAg11ZIt6mcmzpNE6JZBpKfJaKkqTm1A9+y9O+frdZJEuhQxiugM05gnCWiANHj4RmbgeVJpTdmKRmH/a+0QbA==", "cpu": [ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.28.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.28.0.tgz", - "integrity": "sha512-yLc3O2NtOQR67lI79zsSc7lk31xjwcaocvdD1twL64PK1yNaIqCeWI9L5B4MFPAVGEVjH5k1oWSGuYX1Wutxpg==", + "version": "4.28.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.28.1.tgz", + "integrity": "sha512-dRP9PEBfolq1dmMcFqbEPSd9VlRuVWEGSmbxVEfiq2cs2jlZAl0YNxFzAQS2OrQmsLBLAATDMb3Z6MFv5vOcXg==", "cpu": [ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.28.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.28.0.tgz", - "integrity": "sha512-+P9G9hjEpHucHRXqesY+3X9hD2wh0iNnJXX/QhS/J5vTdG6VhNYMxJ2rJkQOxRUd17u5mbMLHM7yWGZdAASfcg==", + "version": "4.28.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.28.1.tgz", + "integrity": "sha512-uGr8khxO+CKT4XU8ZUH1TTEUtlktK6Kgtv0+6bIFSeiSlnGJHG1tSFSjm41uQ9sAO/5ULx9mWOz70jYLyv1QkA==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.28.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.28.0.tgz", - "integrity": "sha512-1xsm2rCKSTpKzi5/ypT5wfc+4bOGa/9yI/eaOLW0oMs7qpC542APWhl4A37AENGZ6St6GBMWhCCMM6tXgTIplw==", + "version": "4.28.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.28.1.tgz", + "integrity": "sha512-QF54q8MYGAqMLrX2t7tNpi01nvq5RI59UBNx+3+37zoKX5KViPo/gk2QLhsuqok05sSCRluj0D00LzCwBikb0A==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loongarch64-gnu": { + "version": "4.28.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.28.1.tgz", + "integrity": "sha512-vPul4uodvWvLhRco2w0GcyZcdyBfpfDRgNKU+p35AWEbJ/HPs1tOUrkSueVbBS0RQHAf/A+nNtDpvw95PeVKOA==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.28.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.28.0.tgz", - "integrity": "sha512-zgWxMq8neVQeXL+ouSf6S7DoNeo6EPgi1eeqHXVKQxqPy1B2NvTbaOUWPn/7CfMKL7xvhV0/+fq/Z/J69g1WAQ==", + "version": "4.28.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.28.1.tgz", + "integrity": "sha512-pTnTdBuC2+pt1Rmm2SV7JWRqzhYpEILML4PKODqLz+C7Ou2apEV52h19CR7es+u04KlqplggmN9sqZlekg3R1A==", "cpu": [ "ppc64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.28.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.28.0.tgz", - "integrity": "sha512-VEdVYacLniRxbRJLNtzwGt5vwS0ycYshofI7cWAfj7Vg5asqj+pt+Q6x4n+AONSZW/kVm+5nklde0qs2EUwU2g==", + "version": "4.28.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.28.1.tgz", + "integrity": "sha512-vWXy1Nfg7TPBSuAncfInmAI/WZDd5vOklyLJDdIRKABcZWojNDY0NJwruY2AcnCLnRJKSaBgf/GiJfauu8cQZA==", "cpu": [ "riscv64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.28.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.28.0.tgz", - "integrity": "sha512-LQlP5t2hcDJh8HV8RELD9/xlYtEzJkm/aWGsauvdO2ulfl3QYRjqrKW+mGAIWP5kdNCBheqqqYIGElSRCaXfpw==", + "version": "4.28.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.28.1.tgz", + "integrity": "sha512-/yqC2Y53oZjb0yz8PVuGOQQNOTwxcizudunl/tFs1aLvObTclTwZ0JhXF2XcPT/zuaymemCDSuuUPXJJyqeDOg==", "cpu": [ "s390x" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.28.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.28.0.tgz", - "integrity": "sha512-Nl4KIzteVEKE9BdAvYoTkW19pa7LR/RBrT6F1dJCV/3pbjwDcaOq+edkP0LXuJ9kflW/xOK414X78r+K84+msw==", + "version": "4.28.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.28.1.tgz", + "integrity": "sha512-fzgeABz7rrAlKYB0y2kSEiURrI0691CSL0+KXwKwhxvj92VULEDQLpBYLHpF49MSiPG4sq5CK3qHMnb9tlCjBw==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.28.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.28.0.tgz", - "integrity": "sha512-eKpJr4vBDOi4goT75MvW+0dXcNUqisK4jvibY9vDdlgLx+yekxSm55StsHbxUsRxSTt3JEQvlr3cGDkzcSP8bw==", + "version": "4.28.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.28.1.tgz", + "integrity": "sha512-xQTDVzSGiMlSshpJCtudbWyRfLaNiVPXt1WgdWTwWz9n0U12cI2ZVtWe/Jgwyv/6wjL7b66uu61Vg0POWVfz4g==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.28.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.28.0.tgz", - "integrity": "sha512-Vi+WR62xWGsE/Oj+mD0FNAPY2MEox3cfyG0zLpotZdehPFXwz6lypkGs5y38Jd/NVSbOD02aVad6q6QYF7i8Bg==", + "version": "4.28.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.28.1.tgz", + "integrity": "sha512-wSXmDRVupJstFP7elGMgv+2HqXelQhuNf+IS4V+nUpNVi/GUiBgDmfwD0UGN3pcAnWsgKG3I52wMOBnk1VHr/A==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.28.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.28.0.tgz", - "integrity": "sha512-kN/Vpip8emMLn/eOza+4JwqDZBL6MPNpkdaEsgUtW1NYN3DZvZqSQrbKzJcTL6hd8YNmFTn7XGWMwccOcJBL0A==", + "version": "4.28.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.28.1.tgz", + "integrity": "sha512-ZkyTJ/9vkgrE/Rk9vhMXhf8l9D+eAhbAVbsGsXKy2ohmJaWg0LPQLnIxRdRp/bKyr8tXuPlXhIoGlEB5XpJnGA==", "cpu": [ "ia32" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.28.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.28.0.tgz", - "integrity": "sha512-Bvno2/aZT6usSa7lRDL2+hMjVAGjuqaymF1ApZm31JXzniR/hvr14jpU+/z4X6Gt5BPlzosscyJZGUvguXIqeQ==", + "version": "4.28.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.28.1.tgz", + "integrity": "sha512-ZvK2jBafvttJjoIdKm/Q/Bh7IJ1Ose9IBOwpOXcOvW3ikGTQGmKDgxTC6oCAzW6PynbkKP8+um1du81XJHZ0JA==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" @@ -1229,6 +1335,7 @@ "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-3.1.2.tgz", "integrity": "sha512-Txsm1tJvtiYeLUVRNqxZGKR/mI+CzuIQuc2gn+YCs9rMTowpNZ2Nqt53JdL8KF9bLhAf2ruR/dr9eZCwdTriRA==", "dev": true, + "license": "MIT", "dependencies": { "@sveltejs/vite-plugin-svelte-inspector": "^2.1.0", "debug": "^4.3.4", @@ -1251,6 +1358,7 @@ "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte-inspector/-/vite-plugin-svelte-inspector-2.1.0.tgz", "integrity": "sha512-9QX28IymvBlSCqsCll5t0kQVxipsfhFFL+L2t3nTWfXnddYwxBuAEtTtlaVQpRz9c37BhJjltSeY4AJSC03SSg==", "dev": true, + "license": "MIT", "dependencies": { "debug": "^4.3.4" }, @@ -1267,19 +1375,22 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/hammerjs": { "version": "2.0.46", "resolved": "https://registry.npmjs.org/@types/hammerjs/-/hammerjs-2.0.46.tgz", "integrity": "sha512-ynRvcq6wvqexJ9brDMS4BnBLzmr0e14d6ZJTEShTBWKymQiHwlAyGu0ZPEFI2Fh1U53F7tN9ufClWM5KvqkKOw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/acorn": { "version": "8.14.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", "dev": true, + "license": "MIT", "bin": { "acorn": "bin/acorn" }, @@ -1292,6 +1403,7 @@ "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.2.tgz", "integrity": "sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==", "dev": true, + "license": "Apache-2.0", "engines": { "node": ">= 0.4" } @@ -1301,6 +1413,7 @@ "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.1.0.tgz", "integrity": "sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==", "dev": true, + "license": "Apache-2.0", "engines": { "node": ">= 0.4" } @@ -1310,6 +1423,7 @@ "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, + "license": "MIT", "optional": true, "dependencies": { "fill-range": "^7.1.1" @@ -1323,6 +1437,7 @@ "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-4.4.7.tgz", "integrity": "sha512-pwkcKfdzTMAU/+jNosKhNL2bHtJc/sSmYgVbuGTEDhzkrhmyihmP7vUc/5ZK9WopidMDHNe3Wm7jOd/WhuHWuw==", "dev": true, + "license": "MIT", "dependencies": { "@kurkle/color": "^0.3.0" }, @@ -1335,6 +1450,7 @@ "resolved": "https://registry.npmjs.org/chartjs-adapter-luxon/-/chartjs-adapter-luxon-1.3.1.tgz", "integrity": "sha512-yxHov3X8y+reIibl1o+j18xzrcdddCLqsXhriV2+aQ4hCR66IYFchlRXUvrJVoxglJ380pgytU7YWtoqdIgqhg==", "dev": true, + "license": "MIT", "peerDependencies": { "chart.js": ">=3.0.0", "luxon": ">=1.0.0" @@ -1345,6 +1461,7 @@ "resolved": "https://registry.npmjs.org/chartjs-plugin-zoom/-/chartjs-plugin-zoom-2.2.0.tgz", "integrity": "sha512-in6kcdiTlP6npIVLMd4zXZ08PDUXC52gZ4FAy5oyjk1zX3gKarXMAof7B9eFiisf9WOC3bh2saHg+J5WtLXZeA==", "dev": true, + "license": "MIT", "dependencies": { "@types/hammerjs": "^2.0.45", "hammerjs": "^2.0.8" @@ -1358,6 +1475,7 @@ "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.1.tgz", "integrity": "sha512-n8enUVCED/KVRQlab1hr3MVpcVMvxtZjmEa956u+4YijlmQED223XMSYj2tLuKvr4jcCTzNNMpQDUer72MMmzA==", "dev": true, + "license": "MIT", "dependencies": { "readdirp": "^4.0.1" }, @@ -1373,6 +1491,7 @@ "resolved": "https://registry.npmjs.org/code-red/-/code-red-1.0.4.tgz", "integrity": "sha512-7qJWqItLA8/VPVlKJlFXU+NBlo/qyfs39aJcuMT/2ere32ZqvF5OSxgdM5xOfJJ7O429gg2HM47y8v9P+9wrNw==", "dev": true, + "license": "MIT", "dependencies": { "@jridgewell/sourcemap-codec": "^1.4.15", "@types/estree": "^1.0.1", @@ -1385,13 +1504,15 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/crelt/-/crelt-1.0.6.tgz", "integrity": "sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/css-tree": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.3.1.tgz", "integrity": "sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==", "dev": true, + "license": "MIT", "dependencies": { "mdn-data": "2.0.30", "source-map-js": "^1.0.1" @@ -1401,10 +1522,11 @@ } }, "node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, + "license": "MIT", "dependencies": { "ms": "^2.1.3" }, @@ -1422,6 +1544,7 @@ "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -1431,6 +1554,7 @@ "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", "integrity": "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==", "dev": true, + "license": "Apache-2.0", "optional": true, "bin": { "detect-libc": "bin/detect-libc.js" @@ -1445,6 +1569,7 @@ "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", "dev": true, "hasInstallScript": true, + "license": "MIT", "bin": { "esbuild": "bin/esbuild" }, @@ -1482,6 +1607,7 @@ "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", "dev": true, + "license": "MIT", "dependencies": { "@types/estree": "^1.0.0" } @@ -1491,6 +1617,7 @@ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, + "license": "MIT", "optional": true, "dependencies": { "to-regex-range": "^5.0.1" @@ -1503,7 +1630,8 @@ "version": "4.6.13", "resolved": "https://registry.npmjs.org/flatpickr/-/flatpickr-4.6.13.tgz", "integrity": "sha512-97PMG/aywoYpB4IvbvUJi0RQi8vearvU0oov1WW3k0WZPBMrTQVqekSX5CjSG/M4Q3i6A/0FKXC7RyAoAUUSPw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/fsevents": { "version": "2.3.3", @@ -1511,6 +1639,7 @@ "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", "dev": true, "hasInstallScript": true, + "license": "MIT", "optional": true, "os": [ "darwin" @@ -1524,6 +1653,7 @@ "resolved": "https://registry.npmjs.org/hammerjs/-/hammerjs-2.0.8.tgz", "integrity": "sha512-tSQXBXS/MWQOn/RKckawJ61vvsDpCom87JgxiYdGwHdOa0ht0vzUWDlfioofFCRU0L+6NGDt6XzbgoJvZkMeRQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.8.0" } @@ -1532,13 +1662,15 @@ "version": "5.0.3", "resolved": "https://registry.npmjs.org/immutable/-/immutable-5.0.3.tgz", "integrity": "sha512-P8IdPQHq3lA1xVeBRi5VPqUm5HDgKnx0Ru51wZz5mjxHr5n3RWhjIpOFU7ybkUxfB+5IToy+OLaHYDBIWsv+uw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true, + "license": "MIT", "optional": true, "engines": { "node": ">=0.10.0" @@ -1549,6 +1681,7 @@ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, + "license": "MIT", "optional": true, "dependencies": { "is-extglob": "^2.1.1" @@ -1562,6 +1695,7 @@ "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true, + "license": "MIT", "optional": true, "engines": { "node": ">=0.12.0" @@ -1572,6 +1706,7 @@ "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-3.0.3.tgz", "integrity": "sha512-ixkJoqQvAP88E6wLydLGGqCJsrFUnqoH6HnaczB8XmDH1oaWU+xxdptvikTgaEhtZ53Ky6YXiBuUI2WXLMCwjw==", "dev": true, + "license": "MIT", "dependencies": { "@types/estree": "^1.0.6" } @@ -1581,6 +1716,7 @@ "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } @@ -1589,22 +1725,25 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/locate-character/-/locate-character-3.0.0.tgz", "integrity": "sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/luxon": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.5.0.tgz", "integrity": "sha512-rh+Zjr6DNfUYR3bPwJEnuwDdqMbxZW7LOQfUN4B54+Cl+0o5zaU9RJ6bcidfDtC1cWCZXQ+nvX8bf6bAji37QQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=12" } }, "node_modules/magic-string": { - "version": "0.30.14", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.14.tgz", - "integrity": "sha512-5c99P1WKTed11ZC0HMJOj6CDIue6F8ySu+bJL+85q1zBEIY8IklrJ1eiKC2NDRh3Ct3FcvmJPyQHb9erXMTJNw==", + "version": "0.30.17", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.17.tgz", + "integrity": "sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==", "dev": true, + "license": "MIT", "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.0" } @@ -1613,13 +1752,15 @@ "version": "2.0.30", "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz", "integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==", - "dev": true + "dev": true, + "license": "CC0-1.0" }, "node_modules/micromatch": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, + "license": "MIT", "optional": true, "dependencies": { "braces": "^3.0.3", @@ -1633,7 +1774,8 @@ "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/nanoid": { "version": "3.3.8", @@ -1646,6 +1788,7 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "bin": { "nanoid": "bin/nanoid.cjs" }, @@ -1658,6 +1801,7 @@ "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.1.tgz", "integrity": "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==", "dev": true, + "license": "MIT", "optional": true }, "node_modules/periscopic": { @@ -1665,6 +1809,7 @@ "resolved": "https://registry.npmjs.org/periscopic/-/periscopic-3.1.0.tgz", "integrity": "sha512-vKiQ8RRtkl9P+r/+oefh25C3fhybptkHKCZSPlcXiJux2tJF55GnEj3BVn4A5gKfq9NWWXXrxkHBwVPUfH0opw==", "dev": true, + "license": "MIT", "dependencies": { "@types/estree": "^1.0.0", "estree-walker": "^3.0.0", @@ -1675,13 +1820,15 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true, + "license": "MIT", "optional": true, "engines": { "node": ">=8.6" @@ -1691,10 +1838,11 @@ } }, "node_modules/pocketbase": { - "version": "0.22.1", - "resolved": "https://registry.npmjs.org/pocketbase/-/pocketbase-0.22.1.tgz", - "integrity": "sha512-hnzpDcIx5kbkUJXz6IkiTox6R4nb706u4rPSMy2FYCaI2OqBnFxbY0qwWBSqx1ERz/Xi61Uguf17Gb9bWZ8+kw==", - "dev": true + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/pocketbase/-/pocketbase-0.23.0.tgz", + "integrity": "sha512-S9b/QSKGXsRyL55m8MoXMucPTpMvpOLlOLTSduraIOzwVt8Epp0j7V53a1qW7VbF2pL7PC579DOruxJBWqBYTg==", + "dev": true, + "license": "MIT" }, "node_modules/postcss": { "version": "8.4.49", @@ -1715,6 +1863,7 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "dependencies": { "nanoid": "^3.3.7", "picocolors": "^1.1.1", @@ -1729,6 +1878,7 @@ "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.0.2.tgz", "integrity": "sha512-yDMz9g+VaZkqBYS/ozoBJwaBhTbZo3UNYQHNRw1D3UFQB8oHB4uS/tAODO+ZLjGWmUbKnIlOWO+aaIiAxrUWHA==", "dev": true, + "license": "MIT", "engines": { "node": ">= 14.16.0" }, @@ -1742,15 +1892,17 @@ "resolved": "https://registry.npmjs.org/regexparam/-/regexparam-2.0.2.tgz", "integrity": "sha512-A1PeDEYMrkLrfyOwv2jwihXbo9qxdGD3atBYQA9JJgreAx8/7rC6IUkWOw2NQlOxLp2wL0ifQbh1HuidDfYA6w==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/rollup": { - "version": "4.28.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.28.0.tgz", - "integrity": "sha512-G9GOrmgWHBma4YfCcX8PjH0qhXSdH8B4HDE2o4/jaxj93S4DPCIDoLcXz99eWMji4hB29UFCEd7B2gwGJDR9cQ==", + "version": "4.28.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.28.1.tgz", + "integrity": "sha512-61fXYl/qNVinKmGSTHAZ6Yy8I3YIJC/r2m9feHo6SwVAVcLT5MPwOUFe7EuURA/4m0NR8lXG4BBXuo/IZEsjMg==", "dev": true, + "license": "MIT", "dependencies": { "@types/estree": "1.0.6" }, @@ -1762,32 +1914,34 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.28.0", - "@rollup/rollup-android-arm64": "4.28.0", - "@rollup/rollup-darwin-arm64": "4.28.0", - "@rollup/rollup-darwin-x64": "4.28.0", - "@rollup/rollup-freebsd-arm64": "4.28.0", - "@rollup/rollup-freebsd-x64": "4.28.0", - "@rollup/rollup-linux-arm-gnueabihf": "4.28.0", - "@rollup/rollup-linux-arm-musleabihf": "4.28.0", - "@rollup/rollup-linux-arm64-gnu": "4.28.0", - "@rollup/rollup-linux-arm64-musl": "4.28.0", - "@rollup/rollup-linux-powerpc64le-gnu": "4.28.0", - "@rollup/rollup-linux-riscv64-gnu": "4.28.0", - "@rollup/rollup-linux-s390x-gnu": "4.28.0", - "@rollup/rollup-linux-x64-gnu": "4.28.0", - "@rollup/rollup-linux-x64-musl": "4.28.0", - "@rollup/rollup-win32-arm64-msvc": "4.28.0", - "@rollup/rollup-win32-ia32-msvc": "4.28.0", - "@rollup/rollup-win32-x64-msvc": "4.28.0", + "@rollup/rollup-android-arm-eabi": "4.28.1", + "@rollup/rollup-android-arm64": "4.28.1", + "@rollup/rollup-darwin-arm64": "4.28.1", + "@rollup/rollup-darwin-x64": "4.28.1", + "@rollup/rollup-freebsd-arm64": "4.28.1", + "@rollup/rollup-freebsd-x64": "4.28.1", + "@rollup/rollup-linux-arm-gnueabihf": "4.28.1", + "@rollup/rollup-linux-arm-musleabihf": "4.28.1", + "@rollup/rollup-linux-arm64-gnu": "4.28.1", + "@rollup/rollup-linux-arm64-musl": "4.28.1", + "@rollup/rollup-linux-loongarch64-gnu": "4.28.1", + "@rollup/rollup-linux-powerpc64le-gnu": "4.28.1", + "@rollup/rollup-linux-riscv64-gnu": "4.28.1", + "@rollup/rollup-linux-s390x-gnu": "4.28.1", + "@rollup/rollup-linux-x64-gnu": "4.28.1", + "@rollup/rollup-linux-x64-musl": "4.28.1", + "@rollup/rollup-win32-arm64-msvc": "4.28.1", + "@rollup/rollup-win32-ia32-msvc": "4.28.1", + "@rollup/rollup-win32-x64-msvc": "4.28.1", "fsevents": "~2.3.2" } }, "node_modules/sass": { - "version": "1.81.0", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.81.0.tgz", - "integrity": "sha512-Q4fOxRfhmv3sqCLoGfvrC9pRV8btc0UtqL9mN6Yrv6Qi9ScL55CVH1vlPP863ISLEEMNLLuu9P+enCeGHlnzhA==", + "version": "1.83.0", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.83.0.tgz", + "integrity": "sha512-qsSxlayzoOjdvXMVLkzF84DJFc2HZEL/rFyGIKbbilYtAvlCxyuzUeff9LawTn4btVnLKg75Z8MMr1lxU1lfGw==", "dev": true, + "license": "MIT", "dependencies": { "chokidar": "^4.0.0", "immutable": "^5.0.2", @@ -1808,6 +1962,7 @@ "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } @@ -1816,13 +1971,15 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/style-mod/-/style-mod-4.1.2.tgz", "integrity": "sha512-wnD1HyVqpJUI2+eKZ+eo1UwghftP6yuFheBqqe+bWCotBjC2K1YnteJILRMs3SM4V/0dLEW1SC27MWP5y+mwmw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/svelte": { "version": "4.2.19", "resolved": "https://registry.npmjs.org/svelte/-/svelte-4.2.19.tgz", "integrity": "sha512-IY1rnGr6izd10B0A8LqsBfmlT5OILVuZ7XsI0vdGPEvuonFV7NYEUK4dAkm9Zg2q0Um92kYjTpS1CAP3Nh/KWw==", "dev": true, + "license": "MIT", "dependencies": { "@ampproject/remapping": "^2.2.1", "@jridgewell/sourcemap-codec": "^1.4.15", @@ -1848,6 +2005,7 @@ "resolved": "https://registry.npmjs.org/svelte-flatpickr/-/svelte-flatpickr-3.3.5.tgz", "integrity": "sha512-D2uVdQi5jn/mMS3AK4gI/30Ho80fBYM0ZfZ44pHg8L4bMZq4c0mjajExZU4WF1EoOf7Qt8njQ9DBtkjJwfl3Cg==", "dev": true, + "license": "MIT", "dependencies": { "flatpickr": "^4.5.2" }, @@ -1860,6 +2018,7 @@ "resolved": "https://registry.npmjs.org/svelte-hmr/-/svelte-hmr-0.16.0.tgz", "integrity": "sha512-Gyc7cOS3VJzLlfj7wKS0ZnzDVdv3Pn2IuVeJPk9m2skfhcu5bq3wtIZyQGggr7/Iim5rH5cncyQft/kRLupcnA==", "dev": true, + "license": "ISC", "engines": { "node": "^12.20 || ^14.13.1 || >= 16" }, @@ -1872,6 +2031,7 @@ "resolved": "https://registry.npmjs.org/svelte-spa-router/-/svelte-spa-router-4.0.1.tgz", "integrity": "sha512-2JkmUQ2f9jRluijL58LtdQBIpynSbem2eBGp4zXdi7aDY1znbR6yjw0KsonD0aq2QLwf4Yx4tBJQjxIjgjXHKg==", "dev": true, + "license": "MIT", "dependencies": { "regexparam": "2.0.2" }, @@ -1884,6 +2044,7 @@ "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, + "license": "MIT", "optional": true, "dependencies": { "is-number": "^7.0.0" @@ -1897,6 +2058,7 @@ "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.11.tgz", "integrity": "sha512-c7jFQRklXua0mTzneGW9QVyxFjUgwcihC4bXEtujIo2ouWCe1Ajt/amn2PCxYnhYfd5k09JX3SB7OYWFKYqj8Q==", "dev": true, + "license": "MIT", "dependencies": { "esbuild": "^0.21.3", "postcss": "^8.4.43", @@ -1956,6 +2118,7 @@ "resolved": "https://registry.npmjs.org/vitefu/-/vitefu-0.2.5.tgz", "integrity": "sha512-SgHtMLoqaeeGnd2evZ849ZbACbnwQCIwRH57t18FxcXoZop0uQu0uzlIhJBlF/eWVzuce0sHeqPcDo+evVcg8Q==", "dev": true, + "license": "MIT", "peerDependencies": { "vite": "^3.0.0 || ^4.0.0 || ^5.0.0" }, @@ -1969,7 +2132,8 @@ "version": "2.2.8", "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.8.tgz", "integrity": "sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==", - "dev": true + "dev": true, + "license": "MIT" } } } diff --git a/ui/package.json b/ui/package.json index 1b914faa..b382f907 100644 --- a/ui/package.json +++ b/ui/package.json @@ -29,7 +29,7 @@ "chartjs-adapter-luxon": "^1.2.0", "chartjs-plugin-zoom": "^2.0.1", "luxon": "^3.4.4", - "pocketbase": "^0.22.0-rc", + "pocketbase": "^0.23.0", "sass": "^1.45.0", "svelte": "^4.0.0", "svelte-flatpickr": "^3.3.3",