diff --git a/README.md b/README.md
index 11db2eff..2833c026 100644
--- a/README.md
+++ b/README.md
@@ -16,7 +16,7 @@
## Introduction
Seekr is a multi-purpose toolkit for gathering and managing OSINT-data with a sleek web interface. Our desktop view enables you to have all of your favourite OSINT tools integrated in one. The backend is written in Go with BadgerDB as database and it offers a wide range of features for data collection, organization, and analysis. Whether you're a researcher, investigator, or just someone looking to gather information, seekr makes it easy to find and manage the data you need. Give it a try and see how it can streamline your OSINT workflow!
-Check the wiki for setup guide, etc.
+Check the wiki for setup guide, API-docs, etc.
diff --git a/flake.nix b/flake.nix
index afd6b5e4..8186a634 100644
--- a/flake.nix
+++ b/flake.nix
@@ -102,7 +102,7 @@
#"-X main.version=${version}"
];
- vendorSha256 = "sha256-KB9T++h6cvOvPmnDauE/r882E9qs4aNt8T7tKjlVrIE=";
+ vendorSha256 = "sha256-6/oUypEcri/TulwNVllB9Z8HxTxj+0pNLJ8Hqsb2NsQ=";
};
});
diff --git a/generate/generate.go b/generate/generate.go
index b0157bd8..b9c8bfd3 100644
--- a/generate/generate.go
+++ b/generate/generate.go
@@ -10,13 +10,14 @@ import (
"sync"
//"github.com/seekr-osint/seekr/api"
+ "github.com/seekr-osint/seekr/api"
"github.com/seekr-osint/seekr/api/config"
"github.com/tkrajina/typescriptify-golang-structs/typescriptify"
)
func main() {
wg := &sync.WaitGroup{}
- //GenType(api.Person{}, wg)
+ GenType(api.Person{}, wg)
GenType(config.Config{}, wg)
wg.Wait()
diff --git a/go.mod b/go.mod
index d4dd435c..f044d161 100644
--- a/go.mod
+++ b/go.mod
@@ -20,11 +20,11 @@ require (
github.com/pelletier/go-toml v1.9.5
github.com/pemistahl/lingua-go v1.3.4
github.com/projectdiscovery/subfinder/v2 v2.5.9
- github.com/rocketlaunchr/google-search v1.1.5
+ github.com/rocketlaunchr/google-search v1.1.6
github.com/src-d/enry/v2 v2.1.0
- github.com/sundowndev/phoneinfoga/v2 v2.10.5
+ github.com/sundowndev/phoneinfoga/v2 v2.10.7
github.com/tkrajina/typescriptify-golang-structs v0.1.10
- golang.org/x/oauth2 v0.8.0
+ golang.org/x/oauth2 v0.10.0
)
require (
@@ -155,16 +155,16 @@ require (
go.uber.org/multierr v1.11.0 // indirect
go4.org v0.0.0-20200411211856-f5505b9728dd // indirect
golang.org/x/arch v0.3.0 // indirect
- golang.org/x/crypto v0.9.0 // indirect
+ golang.org/x/crypto v0.11.0 // indirect
golang.org/x/exp v0.0.0-20230420155640-133eef4313cb // indirect
golang.org/x/mod v0.10.0 // indirect
- golang.org/x/net v0.10.0 // indirect
- golang.org/x/sys v0.8.0 // indirect
- golang.org/x/text v0.9.0 // indirect
+ golang.org/x/net v0.12.0 // indirect
+ golang.org/x/sys v0.10.0 // indirect
+ golang.org/x/text v0.11.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.8.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
- google.golang.org/protobuf v1.30.0 // indirect
+ google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/djherbis/times.v1 v1.3.0 // indirect
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
gopkg.in/toqueteos/substring.v1 v1.0.2 // indirect
diff --git a/go.sum b/go.sum
index 8e11a731..17c2ebe9 100644
--- a/go.sum
+++ b/go.sum
@@ -393,8 +393,8 @@ github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJ
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
-github.com/rocketlaunchr/google-search v1.1.5 h1:C4TsvRJ/MnBqqObs7iOjDllQYr78Tzwqq0W7GZWpO+8=
-github.com/rocketlaunchr/google-search v1.1.5/go.mod h1:/IXrZI7HaBmdh75AoBpOnewFfg70ufG7KcA82Y7C6Mw=
+github.com/rocketlaunchr/google-search v1.1.6 h1:DcSluQWDWEMqo6jp6OGllMTI9SBECpSmUZFntAX4j/o=
+github.com/rocketlaunchr/google-search v1.1.6/go.mod h1:fk5J/qPpaRDjLWdFxT+dmuiqG7kxXArC7K8A+gj88Nk=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE=
@@ -431,8 +431,8 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
-github.com/sundowndev/phoneinfoga/v2 v2.10.5 h1:+SRR7IfV19O+ctnFtShA+1ffwyMrhNxCfOK2fv38+2Y=
-github.com/sundowndev/phoneinfoga/v2 v2.10.5/go.mod h1:iJy1IgGZfZErQ4JgRqh6cwJ4Ds1vqikc/Ez9LtlA+9U=
+github.com/sundowndev/phoneinfoga/v2 v2.10.7 h1:RMYC4GRRVV0I7dnLln+UZ85MAdKwqpri0wqyM5FkRgQ=
+github.com/sundowndev/phoneinfoga/v2 v2.10.7/go.mod h1:iJy1IgGZfZErQ4JgRqh6cwJ4Ds1vqikc/Ez9LtlA+9U=
github.com/temoto/robotstxt v1.1.1/go.mod h1:+1AmkuG3IYkh1kv0d2qEB9Le88ehNO0zwOr3ujewlOo=
github.com/temoto/robotstxt v1.1.2 h1:W2pOjSJ6SWvldyEuiFXNxz3xZ8aiWX5LbfDiOFd7Fxg=
github.com/temoto/robotstxt v1.1.2/go.mod h1:+1AmkuG3IYkh1kv0d2qEB9Le88ehNO0zwOr3ujewlOo=
@@ -497,8 +497,8 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y
golang.org/x/crypto v0.0.0-20211209193657-4570a0811e8b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
-golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g=
-golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0=
+golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA=
+golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
@@ -561,15 +561,16 @@ golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
-golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M=
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
+golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50=
+golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
-golang.org/x/oauth2 v0.8.0 h1:6dkIjl3j3LtZ/O3sTgZTMsLKSftL/B8Zgq4huOIIUu8=
-golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE=
+golang.org/x/oauth2 v0.10.0 h1:zHCpF2Khkwy4mMB4bv0U37YtJdTGW8jI0glAApi0Kh8=
+golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -617,8 +618,9 @@ golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA=
+golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
@@ -626,7 +628,8 @@ golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U=
golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY=
-golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols=
+golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
+golang.org/x/term v0.10.0 h1:3R7pNqamzBraeqj/Tj8qt1aQ2HpmlC+Cx/qL/7hn4/c=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@@ -637,11 +640,11 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
-golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE=
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
+golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4=
+golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
-golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
@@ -730,8 +733,9 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
-google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng=
google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
+google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
+google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
diff --git a/web/ts/framework.ts b/web/ts/framework.ts
index 6374367d..ce934b9f 100644
--- a/web/ts/framework.ts
+++ b/web/ts/framework.ts
@@ -167,10 +167,10 @@ function checkDropdownValue(windowType: "edit" | "create", dropdownType: "gender
ethnicity[translateText("indigenous_slash_native_american")!] = "Indigenous/Native American";
ethnicity[translateText("multiracial_slash_mixed")!] = "Multiracial/Mixed";
}
- console.log(ethnicity[selectedEthnicity])
+
return ethnicity[selectedEthnicity];
} else if (dropdownType == "religion") {
- const selectedReligion = document.querySelector("body > div." + windowType + "-container > div > div.scroll-box > div:nth-child(14) > div > div.select-selected")?.innerHTML ?? "";
+ const selectedReligion = document.querySelector("body > div." + windowType + "-container > div > div.scroll-box > div:nth-child(15) > div > div.select-selected")!.innerHTML ?? "";
const religion: { [key: string]: string } = {};
// English
@@ -201,7 +201,7 @@ function checkDropdownValue(windowType: "edit" | "create", dropdownType: "gender
return religion[selectedReligion];
} else if (dropdownType == "civilstatus") {
- const selectedCivilstatus = document.querySelector("body > div." + windowType + "-container > div > div.scroll-box > div:nth-child(6) > div > div.select-selected")?.innerHTML ?? "";
+ const selectedCivilstatus = document.querySelector("body > div." + windowType + "-container > div > div.scroll-box > div:nth-child(7) > div > div.select-selected")?.innerHTML ?? "";
const civilstatus: { [key: string]: string } = {};
// English
diff --git a/web/ts/script.ts b/web/ts/script.ts
index 496d682e..95b40b6e 100644
--- a/web/ts/script.ts
+++ b/web/ts/script.ts
@@ -1,1818 +1,1734 @@
import { saveAsFile, checkDropdownValue, getDropdownElementIndex, apiCall } from "./framework.js";
-//import * as person from "../ts-gen/person.js";
+import * as person from "../ts-gen/person.js";
-const searchBar = document.getElementById("searchbar");
+class Person extends person.Person {
+ Post(loadingSpinner?: HTMLDivElement): void {
+ const requestOptions = {
+ method: "POST",
+ body: JSON.stringify(this),
+ };
+ fetch(apiCall("/person"), requestOptions)
+ .then(() => {
+ if (loadingSpinner) {
+ loadingSpinner.style.display = "none";
+ }
+ location.reload();
+ })
+ .catch((error) => {
+ console.error("Error:", error);
+ });
+ }
-// Listen for messages on the broadcast channel
-const channel = new BroadcastChannel("seekr-channel");
+ Edit(): void {
+ let obj = this;
+ mainContainer.style.display = "none";
+ editContainer.style.display = "flex";
-channel.addEventListener("message", (event) => {
- if (event.data.type === "theme") {
- const theme = event.data.theme;
-
- document.documentElement.setAttribute("data-theme", theme);
- } else if (event.data.type === "language") {
- translate()
- }
-});
+ editShowID.innerHTML = obj.id;
-if (!localStorage.getItem("language")) {
- setLanguage("en"); // Default language
-}
+ editNameTag.value = obj.name;
-// Interface for IonIcons
-interface IonIconElement extends HTMLElement {
- name: string;
-}
+ if (obj.gender != "") {
+ const genderSelect = document.querySelector(".edit-container > .components > .scroll-box > div:nth-child(1) > .gender-select") as HTMLElement;
+ const selectItems = genderSelect.querySelector(".select-items") as HTMLElement;
+ const selectSelected = genderSelect.querySelector(".select-selected") as HTMLElement;
-// Variables for HTML elements
+ const genderIndex: string | undefined = getDropdownElementIndex("gender", obj.gender);
- // General
+ if (genderIndex != undefined) {
+ const genderElement = selectItems.children[parseInt(genderIndex)];
-const mainContainer = document.querySelector(".main") as HTMLDivElement;
-const container = document.querySelector(".container") as HTMLDivElement;
-const editContainer = document.querySelector(".edit-container") as HTMLDivElement;
-const createContainer = document.querySelector(".create-container") as HTMLDivElement;
+ selectSelected.innerHTML = translateRawWord(obj.gender)!;
+ genderElement.className = "same-as-selected";
+ }
+ }
-// View
+ if (obj.ethnicity != "") {
+ const ethnicitySelect = document.querySelector(".edit-container > .components > .scroll-box > div:nth-child(2) > .ethnicity-select") as HTMLElement;
+ const selectItems = ethnicitySelect.querySelector(".select-items") as HTMLElement;
+ const selectSelected = ethnicitySelect.querySelector(".select-selected") as HTMLElement;
-const viewShowId = document.querySelector("#v-showid") as HTMLParagraphElement;
-const viewNameTag = document.querySelector(".name-tag") as HTMLInputElement;
+ const ethnicityIndex: string | undefined = getDropdownElementIndex("ethnicity", obj.ethnicity);
-const viewGender = document.querySelector(".gender") as HTMLParagraphElement;
-const viewEthnicity = document.querySelector(".ethnicity") as HTMLParagraphElement;
-const viewAge = document.querySelector(".age") as HTMLParagraphElement;
-const viewBday = document.querySelector(".bday") as HTMLParagraphElement;
-const viewAddress = document.querySelector(".address") as HTMLParagraphElement;
-const viewCivilStatus = document.querySelector(".civilstatus") as HTMLParagraphElement;
-const viewKids = document.querySelector(".kids") as HTMLParagraphElement;
-const viewOccupation = document.querySelector(".occupation") as HTMLParagraphElement;
-const viewPrevOccupation = document.querySelector(".prevoccupation") as HTMLParagraphElement;
-const viewEducation = document.querySelector(".education") as HTMLParagraphElement;
-const viewReligion = document.querySelector(".religion") as HTMLParagraphElement;
-const viewPets = document.querySelector(".pets") as HTMLParagraphElement;
-const viewLegal = document.querySelector(".legal") as HTMLParagraphElement;
-const viewPolitical = document.querySelector(".political") as HTMLParagraphElement;
-const viewNotes = document.getElementById("notes") as HTMLDivElement;
+ if (ethnicityIndex != undefined) {
+ const ethnicityElement = selectItems.children[parseInt(ethnicityIndex)];
-// Edit
+ selectSelected.innerHTML = translateRawWord(obj.ethnicity)!;
-const editShowID = document.querySelector("#e-showid") as HTMLParagraphElement;
-const editNameTag = document.querySelector(".e-name-tag") as HTMLInputElement;
+ ethnicityElement.className = "same-as-selected";
+ }
+ }
-const editAge = document.querySelector(".e-age") as HTMLInputElement;
-const editBday = document.querySelector(".e-bday") as HTMLInputElement;
-const editAddress = document.querySelector(".e-address") as HTMLInputElement;
-const editKids = document.querySelector(".e-kids") as HTMLInputElement;
-const editOccupation = document.querySelector(".e-occupation") as HTMLInputElement;
-const editPrevOccupation = document.querySelector(".e-prevoccupation") as HTMLInputElement;
-const editEducation = document.querySelector(".e-education") as HTMLInputElement;
-const editPets = document.querySelector(".e-pets") as HTMLInputElement;
-const editLegal = document.querySelector(".e-legal") as HTMLInputElement;
-const editPolitical = document.querySelector(".e-political") as HTMLInputElement;
-const editNotes = document.getElementById("e-notes") as HTMLDivElement;
+ editAge.innerHTML = obj.age.toString() || "";
+ editBday.innerHTML = obj.bday;
+ editAddress.innerHTML = obj.address;
-// Create
+ // Phone
-const createNameTag = document.querySelector(".c-name-tag") as HTMLInputElement;
+ const phoneBase = document.querySelector(".phone-base") as HTMLDivElement;
-// Accs
+ if (Object.keys(obj.phone).length >= 1) {
+ for (const [_, phone] of Object.entries(obj.phone)) {
+ const phoneVar = (phone as { number: string, valid: boolean, phoneinfoga: { Country: string } })
-const accNameTag = document.getElementById("acc-name-tag") as HTMLInputElement;
-const accContainer = document.querySelector(".acc-container") as HTMLDivElement;
-const accSearchChip = document.getElementById("acc-search-chip") as HTMLDivElement;
-const accNoResults = document.getElementById("acc-no-results") as HTMLDivElement;
-const accScrollBox = document.getElementById("acc-scroll-box") as HTMLDivElement;
-const accAccounts = document.getElementById("accounts") as HTMLDivElement;
+ const container = document.createElement("div");
+ container.className = "phone-container";
-const accLoadingSpinner = document.getElementById("loading-spinner") as HTMLDivElement;
+ const subContainer = document.createElement("div");
+ subContainer.className = "phone-subcontainer";
-async function getData(): Promise