12 lines
36 KiB
Go
Raw Normal View History

2021-03-16 20:51:18 +00:00
//
// Copyright 2020 FoxyUtils ehf. All rights reserved.
//
// This is a commercial product and requires a license to operate.
// A trial license can be obtained at https://unidoc.io
//
// DO NOT EDIT: generated by unitwist Go source code obfuscator.
//
// Use of this source code is governed by the UniDoc End User License Agreement
// terms that can be accessed at https://unidoc.io/eula/
package license ;import (_ged "bytes";_c "compress/gzip";_ef "crypto";_dd "crypto/aes";_gec "crypto/cipher";_cfb "crypto/rand";_dfc "crypto/rsa";_cea "crypto/sha256";_eg "crypto/sha512";_cb "crypto/x509";_fd "encoding/base64";_a "encoding/binary";_bd "encoding/hex";_ab "encoding/json";_gg "encoding/pem";_efd "errors";_fa "fmt";_ad "github.com/unidoc/unioffice";_cd "github.com/unidoc/unioffice/common";_b "io";_g "io/ioutil";_ge "log";_ed "net";_dg "net/http";_ce "os";_df "path/filepath";_d "regexp";_cf "sort";_dc "strings";_f "sync";_ba "time";);var _gdbb =&_f .Mutex {};type LicenseKey struct{LicenseId string `json:"license_id"`;CustomerId string `json:"customer_id"`;CustomerName string `json:"customer_name"`;Tier string `json:"tier"`;CreatedAt _ba .Time `json:"-"`;CreatedAtInt int64 `json:"created_at"`;ExpiresAt _ba .Time `json:"-"`;ExpiresAtInt int64 `json:"expires_at"`;CreatedBy string `json:"created_by"`;CreatorName string `json:"creator_name"`;CreatorEmail string `json:"creator_email"`;UniPDF bool `json:"unipdf"`;UniOffice bool `json:"unioffice"`;UniHTML bool `json:"unihtml"`;Trial bool `json:"trial"`;_cbd bool ;_cfd string ;};var _cgb map[string ]struct{};const _cacg ="\u0055\u004e\u0049OF\u0046\u0049\u0043\u0045\u005f\u0043\u0055\u0053\u0054\u004f\u004d\u0045\u0052\u005f\u004e\u0041\u004d\u0045";type defaultStateHolder struct{};func Track (docKey string ,useKey string )error {return _ddb (docKey ,useKey ,false )};var _ee =_ba .Date (2010,1,1,0,0,0,0,_ba .UTC );func _gdade ()*meteredClient {_eee :=meteredClient {_gbd :"h\u0074\u0074\u0070\u0073\u003a\u002f/\u0063\u006c\u006f\u0075\u0064\u002e\u0075\u006e\u0069d\u006f\u0063\u002ei\u006f/\u0061\u0070\u0069",_cad :&_dg .Client {Timeout :30*_ba .Second }};if _cfc :=_ce .Getenv ("\u0055N\u0049\u0044\u004f\u0043_\u004c\u0049\u0043\u0045\u004eS\u0045_\u0053E\u0052\u0056\u0045\u0052\u005f\u0055\u0052L");_dc .HasPrefix (_cfc ,"\u0068\u0074\u0074\u0070"){_eee ._gbd =_cfc ;};return &_eee ;};func (_dbef *LicenseKey )TypeToString ()string {if _dbef ._cbd {return "M\u0065t\u0065\u0072\u0065\u0064\u0020\u0073\u0075\u0062s\u0063\u0072\u0069\u0070ti\u006f\u006e";};if _dbef .Tier ==LicenseTierUnlicensed {return "\u0055\u006e\u006c\u0069\u0063\u0065\u006e\u0073\u0065\u0064";};if _dbef .Tier ==LicenseTierCommunity {return "\u0041\u0047PL\u0076\u0033\u0020O\u0070\u0065\u006e\u0020Sou\u0072ce\u0020\u0043\u006f\u006d\u006d\u0075\u006eit\u0079\u0020\u004c\u0069\u0063\u0065\u006es\u0065";};if _dbef .Tier ==LicenseTierIndividual ||_dbef .Tier =="\u0069\u006e\u0064i\u0065"{return "\u0043\u006f\u006dm\u0065\u0072\u0063\u0069a\u006c\u0020\u004c\u0069\u0063\u0065\u006es\u0065\u0020\u002d\u0020\u0049\u006e\u0064\u0069\u0076\u0069\u0064\u0075\u0061\u006c";};return "\u0043\u006fm\u006d\u0065\u0072\u0063\u0069\u0061\u006c\u0020\u004c\u0069\u0063\u0065\u006e\u0073\u0065\u0020\u002d\u0020\u0042\u0075\u0073\u0069ne\u0073\u0073";};func (_da *LicenseKey )isExpired ()bool {return _da .getExpiryDateToCompare ().After (_da .ExpiresAt )};var _gbf =false ;type stateLoader interface{loadState (_gbe string )(reportState ,error );updateState (_fgb ,_beg ,_bfc string ,_faa int ,_cdc bool ,_bda int ,_ece int ,_bgf _ba .Time ,_gdg map[string ]int )error ;};func SetMeteredKey (apiKey string )error {if _aag !=nil &&(_aag ._cbd ||_aag .Tier !=LicenseTierUnlicensed ){_ad .Log ("\u0045\u0052R\u004f\u0052\u003a\u0020\u0043\u0061\u006e\u006e\u006f\u0074\u0020\u0073\u0065\u0074\u0020\u006c\u0069\u0063\u0065n\u0073\u0065\u0020\u006b\u0065\u0079 \u0074\u0077\u0069\u0063\u0065\u0020\u002d\u0020\u0053\u0068\u006f\u0075\u006c\u0064 \u006a\u0075s\u0074\u0020\u0069\u006ei\u0074\u0069\u0061\u006c\u0069z\u0065\u0020\u006f\u006e\u0063\u0065\u000a");return _efd .New ("\u006c\u0069\u0063en\u0073\u0065\u0020\u006b\u0065\u0079\u0020\u0061\u006c\u0072\u0065\u0061\u0064\u0079\u0020\u0073\u0065\u0074");};_bge :=_gdade ();_bge ._cde =apiKey ;_gdb ,_aaf :=_bge .getStatus ();if _aaf !=nil {return _aaf ;};if !_gdb .Valid {return _efd .New ("\u006b\u0065\u0079\u0020\u006e\u006f\u0074\u0020\u0076\u0061\u006c\u0069\u0064");};_egg :=&LicenseKey {