passbolt-styleguide 5.18.2 → 5.19.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/RELEASE_NOTES.md +7 -2
- package/build/css/themes/default/api_authentication.min.css +4 -4
- package/build/css/themes/default/api_main.min.css +4 -4
- package/build/css/themes/default/ext_app.min.css +4 -4
- package/build/css/themes/default/ext_authentication.min.css +4 -4
- package/build/css/themes/default/ext_external.min.css +2 -2
- package/build/css/themes/default/ext_in_form_cta.min.css +4 -4
- package/build/css/themes/default/ext_in_form_menu.min.css +4 -4
- package/build/css/themes/default/ext_quickaccess.min.css +4 -4
- package/build/css/themes/layette/api_authentication.min.css +4 -4
- package/build/css/themes/layette/api_main.min.css +4 -4
- package/build/css/themes/layette/ext_app.min.css +4 -4
- package/build/css/themes/layette/ext_authentication.min.css +4 -4
- package/build/css/themes/layette/ext_in_form_cta.min.css +4 -4
- package/build/css/themes/layette/ext_in_form_menu.min.css +4 -4
- package/build/css/themes/layette/ext_quickaccess.min.css +4 -4
- package/build/css/themes/midgar/api_authentication.min.css +4 -4
- package/build/css/themes/midgar/api_main.min.css +4 -4
- package/build/css/themes/midgar/ext_app.min.css +4 -4
- package/build/css/themes/midgar/ext_authentication.min.css +4 -4
- package/build/css/themes/midgar/ext_in_form_cta.min.css +4 -4
- package/build/css/themes/midgar/ext_in_form_menu.min.css +4 -4
- package/build/css/themes/midgar/ext_quickaccess.min.css +4 -4
- package/build/css/themes/sakura/api_authentication.min.css +4 -4
- package/build/css/themes/sakura/api_main.min.css +4 -4
- package/build/css/themes/sakura/ext_app.min.css +4 -4
- package/build/css/themes/sakura/ext_authentication.min.css +4 -4
- package/build/css/themes/sakura/ext_in_form_cta.min.css +4 -4
- package/build/css/themes/sakura/ext_in_form_menu.min.css +4 -4
- package/build/css/themes/sakura/ext_quickaccess.min.css +4 -4
- package/build/css/themes/solarized_dark/api_authentication.min.css +4 -4
- package/build/css/themes/solarized_dark/api_main.min.css +4 -4
- package/build/css/themes/solarized_dark/ext_app.min.css +4 -4
- package/build/css/themes/solarized_dark/ext_authentication.min.css +4 -4
- package/build/css/themes/solarized_dark/ext_in_form_cta.min.css +4 -4
- package/build/css/themes/solarized_dark/ext_in_form_menu.min.css +4 -4
- package/build/css/themes/solarized_dark/ext_quickaccess.min.css +4 -4
- package/build/css/themes/solarized_light/api_authentication.min.css +4 -4
- package/build/css/themes/solarized_light/api_main.min.css +4 -4
- package/build/css/themes/solarized_light/ext_app.min.css +4 -4
- package/build/css/themes/solarized_light/ext_authentication.min.css +4 -4
- package/build/css/themes/solarized_light/ext_in_form_cta.min.css +4 -4
- package/build/css/themes/solarized_light/ext_in_form_menu.min.css +4 -4
- package/build/css/themes/solarized_light/ext_quickaccess.min.css +4 -4
- package/build/css/themes/themes.json +1 -0
- package/build/js/dist/api-account-recovery.js +1 -1
- package/build/js/dist/api-app.js +1 -1
- package/build/js/dist/api-feedback.js +1 -1
- package/build/js/dist/api-mfa-verify-delegated.js +1 -1
- package/build/js/dist/api-mfa-verify.js +1 -1
- package/build/js/dist/api-recover.js +1 -1
- package/build/js/dist/api-setup.js +1 -1
- package/build/js/dist/api-triage.js +1 -1
- package/build/locales/cs-CZ/common.json +167 -13
- package/build/locales/de-DE/common.json +165 -13
- package/build/locales/es-ES/common.json +165 -13
- package/build/locales/fr-FR/common.json +165 -13
- package/build/locales/it-IT/common.json +165 -13
- package/build/locales/ja-JP/common.json +164 -13
- package/build/locales/ko-KR/common.json +164 -13
- package/build/locales/lt-LT/common.json +167 -13
- package/build/locales/nl-NL/common.json +165 -13
- package/build/locales/pl-PL/common.json +167 -13
- package/build/locales/pt-BR/common.json +165 -13
- package/build/locales/ro-RO/common.json +166 -13
- package/build/locales/ru-RU/common.json +167 -13
- package/build/locales/sl-SI/common.json +167 -13
- package/build/locales/sv-SE/common.json +165 -13
- package/build/locales/uk-UA/common.json +167 -13
- package/package.json +2 -2
- package/src/img/svg/logo.svg +2 -2
- package/src/locales/cs-CZ/common.json +167 -13
- package/src/locales/de-DE/common.json +165 -13
- package/src/locales/es-ES/common.json +165 -13
- package/src/locales/fr-FR/common.json +165 -13
- package/src/locales/it-IT/common.json +165 -13
- package/src/locales/ja-JP/common.json +164 -13
- package/src/locales/ko-KR/common.json +164 -13
- package/src/locales/lt-LT/common.json +167 -13
- package/src/locales/nl-NL/common.json +165 -13
- package/src/locales/pl-PL/common.json +167 -13
- package/src/locales/pt-BR/common.json +165 -13
- package/src/locales/ro-RO/common.json +166 -13
- package/src/locales/ru-RU/common.json +167 -13
- package/src/locales/sl-SI/common.json +167 -13
- package/src/locales/sv-SE/common.json +165 -13
- package/src/locales/uk-UA/common.json +167 -13
- package/src/react-extension/ExtAuthenticationLogin.js +1 -0
- package/src/react-extension/components/Administration/DisplayHealthcheckAdministration/DisplayHealthcheckAdministration.js +14 -23
- package/src/react-extension/components/UserSetting/DisplayUserTheme/DisplayUserTheme.js +2 -1
- package/src/react-extension/components/UserSetting/DisplayUserTheme/DisplayUserTheme.test.data.js +5 -0
- package/src/react-extension/components/UserSetting/DisplayUserTheme/DisplayUserTheme.test.js +13 -1
- package/src/react-extension/contexts/ResourceWorkspaceContext.js +3 -1
- package/src/react-extension/contexts/ResourceWorkspaceContext.test.js +8 -0
- package/src/react-web-integration/lib/Dom/DomUtils.js +1 -1
- package/src/react-web-integration/lib/Dom/DomUtils.test.js +19 -0
- package/src/react-web-integration/lib/InForm/InFormCallToActionField.js +5 -1
- package/src/react-web-integration/lib/InForm/InFormCallToActionField.test.js +39 -0
- package/src/react-web-integration/lib/InForm/InFormManager.js +36 -13
- package/src/react-web-integration/lib/InForm/InformManager.test.js +255 -6
- package/src/react-web-integration/lib/InForm/InformManager.test.page.js +7 -7
- package/src/react-web-integration/lib/InForm/ScrapingDictionary.js +1 -1
- package/src/react-web-integration/services/Scraping/FieldScraperService.js +7 -4
- package/src/react-web-integration/services/Scraping/LabelIndex.js +86 -0
- package/src/react-web-integration/services/Scraping/LabelIndex.test.js +111 -0
- package/src/react-web-integration/services/Scraping/LabelScraperService.js +18 -14
- package/src/react-web-integration/services/Scraping/LabelScraperService.test.js +5 -5
- package/src/react-web-integration/services/Scraping/PageScraperHelpers.js +21 -5
- package/src/react-web-integration/services/Scraping/PageScraperHelpers.test.js +116 -0
- package/src/react-web-integration/services/Scraping/PageScraperService.js +6 -3
- package/src/react-web-integration/services/classification/FieldClassificationService.js +46 -40
- package/src/react-web-integration/services/classification/FieldClassificationService.test.data.js +3 -2
- package/src/react-web-integration/services/classification/FieldClassificationService.test.js +72 -0
- package/src/react-web-integration/services/classification/FieldFeatureService.js +12 -14
- package/src/react-web-integration/services/classification/FieldFeatureService.test.js +25 -11
- package/src/react-web-integration/services/classification/FieldsRationalizationService.js +1 -1
- package/src/react-web-integration/services/classification/KeywordMatchingService.js +18 -4
- package/src/react-web-integration/services/classification/KeywordMatchingService.test.js +35 -0
- package/src/react-web-integration/services/classification/KeywordsDictionary.js +21 -1
- package/src/react-web-integration/services/classification/PasswordRoleResolutionService.js +2 -2
- package/src/react-web-integration/services/classification/SegmentedOtpResolutionService.js +2 -2
- package/src/shared/utils/filterUtils.js +3 -2
- package/src/shared/utils/filterUtils.test.js +15 -0
- package/build/css/help.min.css +0 -9
- package/build/css/public.min.css +0 -8
- package/build/css/themes/default/api_cloud.min.css +0 -8
- package/build/css/themes/default/api_reports.min.css +0 -9
- package/build/css/themes/default/api_webinstaller.min.css +0 -9
- package/build/css/themes/layette/api_reports.min.css +0 -9
- package/build/css/themes/midgar/api_reports.min.css +0 -9
- package/build/css/themes/sakura/api_reports.min.css +0 -9
- package/build/css/themes/solarized_dark/api_reports.min.css +0 -9
- package/build/css/themes/solarized_light/api_reports.min.css +0 -9
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see api-setup.js.LICENSE.txt */
|
|
2
|
-
(()=>{"use strict";var e={19375(e,t,s){var n=s(96540),i=s(5338);const r=n.createContext({user:null,users:null,roles:null,rememberMeOptions:{},resources:null,resource:null,shareResources:null,selectedResources:null,selectedUser:null,folders:null,resourceCommentId:null,mustRefreshComments:!1,siteSettings:null,userSettings:null,onCheckIsAuthenticatedRequested:null});function a(e){return class extends n.Component{render(){return n.createElement(r.Consumer,null,t=>n.createElement(e,{context:t,...this.props}))}}}const o=r;var l=s(5556),c=s.n(l);class d extends Error{constructor(e,t){super(e),this.name="PassboltApiFetchError",this.data=t||{}}}const h=d;class p extends Error{constructor(){super("An internal error occurred. The server response could not be parsed. Please contact your administrator."),this.name="PassboltBadResponseError"}}const u=p;class m extends Error{constructor(e){super(e=e||"The service is unavailable"),this.name="PassboltServiceUnavailableError"}}const g=m,E=["GET","POST","PUT","DELETE"];class y{constructor(e){if(this.options=e,!this.options.getBaseUrl())throw new TypeError("ApiClient constructor error: baseUrl is required.");if(!this.options.getResourceName())throw new TypeError("ApiClient constructor error: resourceName is required.");try{let e=this.options.getBaseUrl().toString();e.endsWith("/")&&(e=e.slice(0,-1));let t=this.options.getResourceName();t.startsWith("/")&&(t=t.slice(1)),t.endsWith("/")&&(t=t.slice(0,-1)),this.baseUrl=`${e}/${t}`,this.baseUrl=new URL(this.baseUrl)}catch(e){throw new TypeError("ApiClient constructor error: b.",{cause:e})}this.apiVersion="api-version=v2"}setApiVersion(e){if("string"!=typeof e)throw new TypeError("ApiClient.setApiVersion error: apiVersion should be a string.");this.apiVersion=`api-version=${e}`}getDefaultHeaders(){return{Accept:"application/json","content-type":"application/json"}}async buildFetchOptions(){const e=await this.options.getHeaders();return{credentials:"include",headers:{...this.getDefaultHeaders(),...e}}}async get(e,t){this.assertValidId(e);const s=this.buildUrl(`${this.baseUrl}/${e}`,t||{});return this.fetchAndHandleResponse("GET",s)}async delete(e,t,s,n){let i;this.assertValidId(e),void 0===n&&(n=!1),i=n?this.buildUrl(`${this.baseUrl}/${e}/dry-run`,s||{}):this.buildUrl(`${this.baseUrl}/${e}`,s||{});let r=null;return t&&(r=this.buildBody(t)),this.fetchAndHandleResponse("DELETE",i,r)}async findAll(e){const t=this.buildUrl(this.baseUrl.toString(),e||{});return this.fetchAndHandleResponse("GET",t)}async create(e,t){const s=this.buildUrl(this.baseUrl.toString(),t||{}),n=this.buildBody(e);return this.fetchAndHandleResponse("POST",s,n)}async update(e,t,s,n){let i;this.assertValidId(e),void 0===n&&(n=!1),i=n?this.buildUrl(`${this.baseUrl}/${e}/dry-run`,s||{}):this.buildUrl(`${this.baseUrl}/${e}`,s||{});let r=null;return t&&(r=this.buildBody(t)),this.fetchAndHandleResponse("PUT",i,r)}async updateAll(e,t={}){const s=this.buildUrl(this.baseUrl.toString(),t),n=e?this.buildBody(e):null;return this.fetchAndHandleResponse("PUT",s,n)}assertValidId(e){if(!e)throw new TypeError("ApiClient.assertValidId error: id cannot be empty");if("string"!=typeof e)throw new TypeError("ApiClient.assertValidId error: id should be a string")}assertMethod(e){if("string"!=typeof e)throw new TypeError("ApiClient.assertValidMethod method should be a string.");if(E.indexOf(e.toUpperCase())<0)throw new TypeError(`ApiClient.assertValidMethod error: method ${e} is not supported.`)}assertUrl(e){if(!e)throw new TypeError("ApliClient.assertUrl error: url is required.");if(!(e instanceof URL))throw new TypeError("ApliClient.assertUrl error: url should be a valid URL object.");if("https:"!==e.protocol&&"http:"!==e.protocol)throw new TypeError("ApliClient.assertUrl error: url protocol should only be https or http.")}assertBody(e){if(!(e instanceof FormData)&&"string"!=typeof e)throw new TypeError("ApiClient.assertBody error: body should be a string or a FormData.")}buildBody(e){return JSON.stringify(e)}buildUrl(e,t){if("string"!=typeof e)throw new TypeError("ApiClient.buildUrl error: url should be a string.");const s=new URL(`${e}.json?${this.apiVersion}`);t=t||{};for(const[e,n]of Object.entries(t)){if("string"!=typeof e)throw new TypeError("ApiClient.buildUrl error: urlOptions key should be a string.");if("string"==typeof n)s.searchParams.append(e,n);else{if(!Array.isArray(n))throw new TypeError("ApiClient.buildUrl error: urlOptions value should be a string or array.");n.forEach(t=>{s.searchParams.append(e,t)})}}return s}async sendRequest(e,t,s,n){this.assertUrl(t),this.assertMethod(e),s&&this.assertBody(s);const i="undefined"!=typeof customApiClientFetch?customApiClientFetch:fetch,r={...await this.buildFetchOptions(),...n};r.method=e,s&&(r.body=s);try{return await i(t.toString(),r)}catch(e){throw console.error(e),navigator.onLine?new g("Unable to reach the server, an unexpected error occurred"):new g("Unable to reach the server, you are not connected to the network")}}async fetchAndHandleResponse(e,t,s,n){const i=await this.sendRequest(e,t,s,n);return this.parseResponseJson(i)}async parseResponseJson(e){let t;try{t=await e.json()}catch(t){throw console.debug(e.url.toString(),t),new u(t,e)}if(!e.ok){const s=t.header.message;throw new h(s,{header:t.header,code:e.status,body:t.body})}return t}}const f="chrome",b="edge",v="firefox",S="safari";function T(){const e=window.navigator.userAgent.toLowerCase();let t;return t=e.indexOf("firefox")>-1?v:e.indexOf("samsungbrowser")>-1?"samsung":e.indexOf("opera")>-1||e.indexOf("opr")>-1?"opera":e.indexOf("trident")>-1?"internet-explorer":e.indexOf("edg")>-1?b:e.indexOf("chrome")>-1?f:e.indexOf("safari")>-1?S:"unknown",t}const w=class{constructor(e){e.setResourceName("auth"),this.apiClient=new y(e)}async logout(){const e=this.apiClient.buildUrl(`${this.apiClient.baseUrl}/logout`,{}),t=await this.apiClient.sendRequest("POST",e,null,{redirect:"manual"});if(!t.ok&&0!==t.status)return this._logoutLegacy()}async _logoutLegacy(){const e=this.apiClient.buildUrl(`${this.apiClient.baseUrl}/logout`,{}),t=await this.apiClient.sendRequest("GET",e,null,{redirect:"manual"});if(!t.ok&&0!==t.status)throw new h("An unexpected error happened during the legacy logout process",{code:t.status})}};class x{static reload(){window.location.reload()}static assign(e){window.location.assign(e)}static getHostname(){return window.location.hostname}}const A=n.createContext({userId:null,token:null,state:null,unexpectedError:null,onInitializeSetupRequested:()=>{},logoutUserAndRefresh:()=>{}});class C extends n.Component{constructor(e){super(e),this.state=Object.assign(this.defaultState,e.value),this.authLogoutService=new w(e.context.getApiClientOptions())}get defaultState(){return{userId:null,token:null,state:N.INITIAL_STATE,unexpectedError:null,onInitializeSetupRequested:this.onInitializeSetupRequested.bind(this),logoutUserAndRefresh:this.logoutUserAndRefresh.bind(this),handleSafariExtensionDownloading:this.handleSafariExtensionDownloading.bind(this),handleSafariExtensionNotDownloaded:this.handleSafariExtensionNotDownloaded.bind(this),handleExtensionAlreadyInstalled:this.handleExtensionAlreadyInstalled.bind(this)}}async onInitializeSetupRequested(){return this.state.userId&&this.state.token?this.isBrowserSupported()?void await this.startSetup().then(this.handleStartSetupSuccess.bind(this)).catch(this.handleStartSetupError.bind(this)):this.setState({state:N.DOWNLOAD_SUPPORTED_BROWSER_STATE}):this.setState({state:N.REQUEST_INVITATION_ERROR})}handleStartSetupSuccess(){const e=T()===S?N.INSTALL_SAFARI_EXTENSION_STATE:N.INSTALL_EXTENSION_STATE;this.setState({state:e})}handleSafariExtensionDownloading(){const e=N.CONFIGURE_SAFARI_EXTENSION_STATE;this.setState({state:e})}handleSafariExtensionNotDownloaded(){const e=N.INSTALL_SAFARI_EXTENSION_STATE;this.setState({state:e})}handleExtensionAlreadyInstalled(){const e=N.CONFIGURE_SAFARI_EXTENSION_STATE;this.setState({state:e})}async logoutUserAndRefresh(){try{await this.authLogoutService.logout()}catch(e){const t=new g(e.message);return this.setState({unexpectedError:t,state:N.UNEXPECTED_ERROR_STATE})}x.reload()}handleStartSetupError(e){if(e instanceof h){if(403===e.data.code)return this.setState({state:N.ERROR_ALREADY_SIGNED_IN_STATE});const t=Boolean(e.data.body?.token?.expired),s=Boolean(e.data.body?.token?.isActive);if(t||s)return this.setState({state:N.TOKEN_EXPIRED_STATE});if(400===e?.data?.code)return this.setState({state:N.REQUEST_INVITATION_ERROR})}return this.setState({state:N.UNEXPECTED_ERROR_STATE})}isBrowserSupported(){const e=T(),t=[f,v,b];return this.props.context.siteSettings.canIUse("safari")&&t.push(S),t.includes(e)}async startSetup(){const e=this.props.context.getApiClientOptions();e.setResourceName("setup");const t=new y(e),{body:s}=await t.get(`install/${this.state.userId}/${this.state.token}`);return s}render(){return n.createElement(A.Provider,{value:this.state},this.props.children)}}C.propTypes={context:c().any,value:c().any,children:c().any};const R=a(C);function q(e){return class extends n.Component{render(){return n.createElement(A.Consumer,null,t=>n.createElement(e,{apiSetupContext:t,...this.props}))}}}const N={INITIAL_STATE:"Initial state",DOWNLOAD_SUPPORTED_BROWSER_STATE:"Download supported browser state",INSTALL_EXTENSION_STATE:"Install extension state",INSTALL_SAFARI_EXTENSION_STATE:"Install Safari extension state",CONFIGURE_SAFARI_EXTENSION_STATE:"Configure Safari extension state",TOKEN_EXPIRED_STATE:"Token expired state",ERROR_ALREADY_SIGNED_IN_STATE:"Error, already signed in state",REQUEST_INVITATION_ERROR:"Request inviration error state",UNEXPECTED_ERROR_STATE:"Unexpected error state"};class k{setBaseUrl(e){if(!e)throw new TypeError("ApiClientOption baseUrl is required.");if("string"==typeof e)try{this.baseUrl=new URL(e)}catch(e){throw new TypeError("ApiClientOption baseUrl is invalid.",{cause:e})}else{if(!(e instanceof URL))throw new TypeError("ApiClientOptions baseurl should be a string or URL");this.baseUrl=e}return this}setResourceName(e){if(!e)throw new TypeError("ApiClientOptions.setResourceName resourceName is required.");if("string"!=typeof e)throw new TypeError("ApiClientOptions.setResourceName resourceName should be a valid string.");return this.resourceName=e,this}getBaseUrl(){return this.baseUrl}getResourceName(){return this.resourceName}async getHeaders(){const e=await this.getCsrfToken();if(e)return{"X-CSRF-Token":e}}async getCsrfToken(){if("undefined"==typeof browser||void 0===browser.cookies){const e=document?.cookie?.split("; ")?.find(e=>e.startsWith("csrfToken"))?.split("=");return e&&2===e.length?e[1]:null}const e=this.baseUrl.toString(),t="/"===e.slice(-1)?e:`${e}/`,s=await browser.cookies.get({name:"csrfToken",url:t});return s?.value||null}}var _,O,I=s(91352),P=s(13279);function D(){return D=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)({}).hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},D.apply(null,arguments)}const U=function(e){return n.createElement("svg",D({width:18,height:18,fill:"none",className:"svg-icon spinner",viewBox:"0 0 18 18"},e),_||(_=n.createElement("circle",{id:"background",cx:8,cy:8,r:8,fill:"none",stroke:"var(--spinner-background)",strokeWidth:"var(--spinner-stroke-width)",transform:"translate(1 1)"})),O||(O=n.createElement("circle",{id:"loading",r:8,fill:"none",stroke:"var(--spinner-color)",strokeLinecap:"round",strokeWidth:"var(--spinner-stroke-width)",transform:"translate(9 9)"})))};class G extends n.Component{render(){return n.createElement("div",{className:"login-processing"},n.createElement("h1",null,this.props.title),n.createElement("div",{className:"processing-wrapper"},n.createElement(U,null)))}}G.propTypes={title:c().oneOfType([c().arrayOf(c().node),c().node,c().string])},G.defaultProps={title:n.createElement(I.x,null,"Please wait...")};const L=(0,P.C)("common")(G),M="https://download.passbolt.com/extension/chrome";class F extends n.Component{constructor(e){super(e),this.state=this.getDefaultState(),this.bindCallbacks()}getDefaultState(){const e=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";return{browserName:T(),theme:e}}bindCallbacks(){this.handleRefreshClick=this.handleRefreshClick.bind(this)}get browserStoreThumbnailUrl(){const e="dark"===this.state.theme?"white":"black";switch(this.state.browserName){case v:return`${this.props.context.trustedDomain}/img/third_party/FirefoxAMO_${e}.svg`;case b:return`${this.props.context.trustedDomain}/img/third_party/edge-addon-${e}.svg`;default:return`${this.props.context.trustedDomain}/img/third_party/ChromeWebStore_${e}.svg`}}get storeUrl(){switch(this.state.browserName){case f:return M;case v:return"https://addons.mozilla.org/firefox/addon/passbolt";case b:return"https://microsoftedge.microsoft.com/addons/detail/passbolt-extension/ljeppgjhohmhpbdhjjjbiflabdgfkhpo";default:return M}}get storeClassName(){return`browser-webstore ${this.state.browserName}`}handleRefreshClick(){x.reload()}render(){return n.createElement("div",{className:"install-extension"},n.createElement("h1",null,n.createElement(I.x,null,"Please install the browser extension.")),n.createElement("p",null,n.createElement(I.x,null,"Please download the browser extension and refresh this page to continue.")),this.state.browserName&&n.createElement("a",{href:this.storeUrl,className:this.storeClassName,target:"_blank",rel:"noopener noreferrer"},n.createElement("img",{src:this.browserStoreThumbnailUrl,alt:"browser store thumbnail"})),n.createElement("div",{className:"form-actions"},n.createElement("a",{href:this.storeUrl,className:"button primary big full-width",role:"button",target:"_blank",rel:"noopener noreferrer"},n.createElement(I.x,null,"Download extension")),n.createElement("button",{className:"link",type:"button",onClick:this.handleRefreshClick},n.createElement(I.x,null,"Refresh to detect extension"))))}}F.propTypes={context:c().any};const $=a((0,P.C)("common")(F));class V extends n.Component{constructor(e){super(e),this.state=this.getDefaultState()}getDefaultState(){return{selectedBrowser:this.compatibleBrowserList[0]}}handleBrowserButtonClick(e){this.setState({selectedBrowser:e})}get compatibleBrowserList(){const e=[{name:"Mozilla Firefox",img:"firefox.svg",url:"https://www.mozilla.org/"},{name:"Google Chrome",img:"chrome.svg",url:"https://www.google.com/chrome/"},{name:"Microsoft Edge",img:"edge.svg",url:"https://www.microsoft.com/edge"},{name:"Brave",img:"brave.svg",url:"https://www.brave.com/"},{name:"Vivaldi",img:"vivaldi.svg",url:"https://www.vivaldi.com/"}];return this.props.context.siteSettings.canIUse("safari")&&e.push({name:"Safari",img:"safari.svg",url:"https://www.apple.com/safari/"}),e}render(){return n.createElement("div",{className:"browser-not-supported"},n.createElement("h1",null,n.createElement(I.x,null,"Sorry, your browser is not supported.")),n.createElement("p",null,n.createElement(I.x,null,"Please download one of these browsers to get started with passbolt:")),n.createElement("div",{className:"browser-button-list"},this.compatibleBrowserList.map((e,t)=>n.createElement("button",{key:t,className:"browser"+(e.name===this.state.selectedBrowser.name?" focused":""),target:"_blank",onClick:()=>this.handleBrowserButtonClick(e)},n.createElement("img",{src:`${this.props.context.trustedDomain}/img/third_party/${e.img}`})))),n.createElement("div",{className:"form-actions"},n.createElement("a",{href:this.state.selectedBrowser.url,rel:"noopener noreferrer",className:"button primary big full-width",role:"button",target:"_blank"},n.createElement(I.x,null,"Download ",{browserName:this.state.selectedBrowser.name}))))}}V.propTypes={context:c().any};const K=a((0,P.C)("common")(V));class B extends n.Component{render(){return n.createElement("div",{className:"setup-error"},n.createElement("h1",null,n.createElement(I.x,null,"Access to this service requires an invitation.")),n.createElement("p",null,n.createElement(I.x,null,"This email is not associated with any approved users on this domain.")," ",n.createElement(I.x,null,"Please contact your administrator to request an invitation link.")),n.createElement("div",{className:"form-actions"},n.createElement("a",{href:`${this.props.context.trustedDomain}/users/recover`,className:"button primary big full-width",role:"button",rel:"noopener noreferrer"},n.createElement(I.x,null,"Try with another email"))))}}B.propTypes={context:c().any};const j=a((0,P.C)("common")(B));class z extends n.Component{render(){return n.createElement("div",{className:"setup-error"},n.createElement("h1",null,n.createElement(I.x,null,"The invitation is expired.")),n.createElement("p",null,n.createElement(I.x,null,"You can request another invitation email by clicking on the button below.")),n.createElement("div",{className:"form-actions"},n.createElement("a",{href:`${this.props.context.trustedDomain}/users/recover`,className:"button primary big full-width",role:"button",rel:"noopener noreferrer"},n.createElement(I.x,null,"Request invitation"))))}}z.propTypes={context:c().any};const H=a((0,P.C)("common")(z)),W="setup",Y="recover",Z="account-recovery";class X extends n.Component{render(){return n.createElement("div",{className:"setup-error"},n.createElement("h1",null,n.createElement(I.x,null,"Cannot perform the action while being logged in")),n.createElement("p",null,{[W]:n.createElement(I.x,null,"It is not possible to perform a setup of a new account as you are still logged in. You need to log out first before continuing."),[Y]:n.createElement(I.x,null,"It is not possible to perform the recovery of your account as you are still logged in. You need to log out first before continuing."),[Z]:n.createElement(I.x,null,"It is not possible to recover your private key of your account as you are still logged in. You need to log out first before continuing.")}[this.props.displayAs]),n.createElement("div",{className:"form-actions"},n.createElement("button",{onClick:this.props.onLogoutButtonClick.bind(this),className:"button primary big full-width",role:"button"},n.createElement(I.x,null,"Sign out"))))}}X.propTypes={displayAs:c().oneOf([W,Y,Z]).isRequired,onLogoutButtonClick:c().func.isRequired};const J=(0,P.C)("common")(X);var Q;function ee(){return ee=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)({}).hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},ee.apply(null,arguments)}const te=function(e){return n.createElement("svg",ee({xmlns:"http://www.w3.org/2000/svg",width:10,height:8,fill:"none",viewBox:"0 0 10 8"},e),Q||(Q=n.createElement("path",{stroke:"var(--icon-color)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m1 2 4 4 4-4"})))};var se;function ne(){return ne=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)({}).hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},ne.apply(null,arguments)}const ie=function(e){return n.createElement("svg",ne({xmlns:"http://www.w3.org/2000/svg",width:8,height:10,fill:"none",viewBox:"0 0 8 10"},e),se||(se=n.createElement("path",{stroke:"var(--icon-color)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m2 9 4-4-4-4"})))};class re extends n.Component{constructor(e){super(e),this.state=this.defaultState,this.bindCallbacks()}get defaultState(){return{showErrorDetails:!1}}bindCallbacks(){this.handleErrorDetailsToggle=this.handleErrorDetailsToggle.bind(this)}onClick(){this.props.context.port?this.props.context.port.request("passbolt.tab.reload"):x.reload()}handleErrorDetailsToggle(){this.setState({showErrorDetails:!this.state.showErrorDetails})}get hasErrorDetails(){const e=this.props?.error;return Boolean(e?.details)||Boolean(e?.data?.body)}formatErrors(){const e=this.props.error?.details||this.props.error?.data;return JSON.stringify(e,null,4)}render(){return n.createElement("div",{className:"setup-error"},n.createElement("h1",null,this.props.title),n.createElement("p",null,this.props.message),n.createElement("p",null,this.props.error&&this.props.error.message),this.hasErrorDetails&&n.createElement("div",{className:"accordion error-details"},n.createElement("div",{className:"accordion-header"},n.createElement("button",{className:"no-border",type:"button",onClick:this.handleErrorDetailsToggle},this.state.showErrorDetails?n.createElement(te,{className:"caret-down"}):n.createElement(ie,{className:"caret-right"}),n.createElement("span",null,n.createElement(I.x,null,"Error details")))),this.state.showErrorDetails&&n.createElement("div",{className:"accordion-content"},n.createElement("div",{className:"input text"},n.createElement("label",{htmlFor:"js_field_debug",className:"visuallyhidden"},n.createElement(I.x,null,"Error details")),n.createElement("textarea",{id:"js_field_debug",defaultValue:`${this.formatErrors()}`,readOnly:!0})))),n.createElement("div",{className:"form-actions"},n.createElement("button",{onClick:this.onClick.bind(this),className:"button primary big full-width",role:"button"},n.createElement(I.x,null,"Try again"))))}}re.defaultProps={title:n.createElement(I.x,null,"Something went wrong!"),message:n.createElement(I.x,null,"The operation failed with the following error:")},re.propTypes={context:c().any,title:c().oneOfType([c().arrayOf(c().node),c().node,c().string]),message:c().oneOfType([c().arrayOf(c().node),c().node,c().string]),error:c().any};const ae=a((0,P.C)("common")(re));var oe,le;function ce(){return ce=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)({}).hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},ce.apply(null,arguments)}const de=function(e){return n.createElement("svg",ce({xmlns:"http://www.w3.org/2000/svg",id:"livetype",viewBox:"0 0 119.664 40"},e),oe||(oe=n.createElement("title",null,"Download_on_the_App_Store_Badge_US-UK_RGB_blk_4SVG_092917")),n.createElement("path",{d:"M110.135 0H9.535Q8.986 0 8.44.002q-.457.004-.919.013A13 13 0 0 0 5.517.19a6.7 6.7 0 0 0-1.9.627 6.4 6.4 0 0 0-1.62 1.18A6.3 6.3 0 0 0 .82 3.617a6.6 6.6 0 0 0-.625 1.903 13 13 0 0 0-.179 2.002c-.01.307-.01.615-.015.921V31.56c.005.31.006.61.015.921a13 13 0 0 0 .18 2.002 6.6 6.6 0 0 0 .624 1.905A6.2 6.2 0 0 0 1.998 38a6.3 6.3 0 0 0 1.618 1.179 6.7 6.7 0 0 0 1.901.63 13.5 13.5 0 0 0 2.004.177c.31.007.613.011.919.011.366.002.728.002 1.095.002h100.6c.36 0 .724 0 1.084-.002.304 0 .617-.004.922-.01a13 13 0 0 0 2-.178 6.8 6.8 0 0 0 1.908-.63A6.3 6.3 0 0 0 117.666 38a6.4 6.4 0 0 0 1.182-1.614 6.6 6.6 0 0 0 .619-1.905 13.5 13.5 0 0 0 .185-2.002c.004-.31.004-.61.004-.921.008-.364.008-.725.008-1.094V9.536q.002-.549-.008-1.092.001-.46-.004-.92a13.5 13.5 0 0 0-.185-2.003 6.6 6.6 0 0 0-.62-1.903 6.47 6.47 0 0 0-2.798-2.8 6.8 6.8 0 0 0-1.908-.627 13 13 0 0 0-2-.176c-.305-.005-.618-.011-.922-.013-.36-.002-.725-.002-1.084-.002Z",style:{fill:"#a6a6a6"}}),le||(le=n.createElement("path",{d:"M8.445 39.125c-.305 0-.602-.004-.904-.01a13 13 0 0 1-1.87-.164 5.9 5.9 0 0 1-1.656-.548 5.4 5.4 0 0 1-1.397-1.016 5.3 5.3 0 0 1-1.02-1.397 5.7 5.7 0 0 1-.544-1.657 12.4 12.4 0 0 1-.166-1.875c-.007-.21-.015-.913-.015-.913v-23.1s.009-.692.015-.895a12.4 12.4 0 0 1 .165-1.872 5.8 5.8 0 0 1 .544-1.662 5.4 5.4 0 0 1 1.015-1.398 5.6 5.6 0 0 1 1.402-1.023 5.8 5.8 0 0 1 1.653-.544A12.6 12.6 0 0 1 7.543.887l.902-.012h102.769l.913.013a12.4 12.4 0 0 1 1.858.162 6 6 0 0 1 1.671.548 5.6 5.6 0 0 1 2.415 2.42 5.8 5.8 0 0 1 .535 1.649 13 13 0 0 1 .174 1.887c.003.283.003.588.003.89.008.375.008.732.008 1.092v20.929c0 .363 0 .718-.008 1.075 0 .325 0 .623-.004.93a13 13 0 0 1-.17 1.853 5.7 5.7 0 0 1-.54 1.67 5.5 5.5 0 0 1-1.016 1.386 5.4 5.4 0 0 1-1.4 1.022 5.9 5.9 0 0 1-1.668.55 12.5 12.5 0 0 1-1.869.163c-.293.007-.6.011-.897.011l-1.084.002Z"})),n.createElement("g",{id:"_Group_","data-name":"<Group>"},n.createElement("g",{id:"_Group_2","data-name":"<Group>"},n.createElement("g",{id:"_Group_3","data-name":"<Group>"},n.createElement("path",{id:"_Path_",d:"M24.769 20.3a4.95 4.95 0 0 1 2.356-4.151 5.07 5.07 0 0 0-3.99-2.158c-1.68-.176-3.308 1.005-4.164 1.005-.872 0-2.19-.988-3.608-.958a5.32 5.32 0 0 0-4.473 2.728c-1.934 3.348-.491 8.269 1.361 10.976.927 1.325 2.01 2.805 3.428 2.753 1.387-.058 1.905-.885 3.58-.885 1.658 0 2.144.885 3.59.852 1.489-.025 2.426-1.332 3.32-2.67a11 11 0 0 0 1.52-3.092 4.78 4.78 0 0 1-2.92-4.4","data-name":"<Path>",style:{fill:"#fff"}}),n.createElement("path",{id:"_Path_2",d:"M22.037 12.21a4.87 4.87 0 0 0 1.115-3.49 4.96 4.96 0 0 0-3.208 1.66A4.64 4.64 0 0 0 18.8 13.74a4.1 4.1 0 0 0 3.237-1.53","data-name":"<Path>",style:{fill:"#fff"}}))),n.createElement("path",{d:"M42.302 27.14H37.57l-1.137 3.356h-2.005l4.484-12.418h2.083l4.483 12.418h-2.039Zm-4.243-1.55h3.752l-1.85-5.446h-.051ZM55.16 25.97c0 2.813-1.506 4.62-3.779 4.62a3.07 3.07 0 0 1-2.848-1.583h-.043v4.484H46.63V21.442h1.8v1.506h.033a3.21 3.21 0 0 1 2.883-1.6c2.298 0 3.813 1.816 3.813 4.622m-1.91 0c0-1.833-.948-3.038-2.393-3.038-1.42 0-2.375 1.23-2.375 3.038 0 1.824.955 3.046 2.375 3.046 1.445 0 2.393-1.197 2.393-3.046M65.125 25.97c0 2.813-1.506 4.62-3.779 4.62a3.07 3.07 0 0 1-2.848-1.583h-.043v4.484h-1.859V21.442h1.799v1.506h.034a3.21 3.21 0 0 1 2.883-1.6c2.298 0 3.813 1.816 3.813 4.622m-1.91 0c0-1.833-.948-3.038-2.393-3.038-1.42 0-2.375 1.23-2.375 3.038 0 1.824.955 3.046 2.375 3.046 1.445 0 2.392-1.197 2.392-3.046M71.71 27.036c.138 1.232 1.334 2.04 2.97 2.04 1.566 0 2.693-.808 2.693-1.919 0-.964-.68-1.54-2.29-1.936l-1.609-.388c-2.28-.55-3.339-1.617-3.339-3.348 0-2.142 1.867-3.614 4.519-3.614 2.624 0 4.423 1.472 4.483 3.614h-1.876c-.112-1.239-1.136-1.987-2.634-1.987s-2.521.757-2.521 1.858c0 .878.654 1.395 2.255 1.79l1.368.336c2.548.603 3.606 1.626 3.606 3.443 0 2.323-1.85 3.778-4.793 3.778-2.754 0-4.614-1.42-4.734-3.667ZM83.346 19.3v2.142h1.722v1.472h-1.722v4.991c0 .776.345 1.137 1.102 1.137a6 6 0 0 0 .611-.043v1.463a5 5 0 0 1-1.032.086c-1.833 0-2.548-.689-2.548-2.445v-5.189h-1.316v-1.472h1.316V19.3ZM86.065 25.97c0-2.849 1.678-4.639 4.294-4.639 2.625 0 4.295 1.79 4.295 4.639 0 2.856-1.661 4.638-4.295 4.638s-4.294-1.782-4.294-4.638m6.695 0c0-1.954-.895-3.108-2.401-3.108s-2.4 1.162-2.4 3.108c0 1.962.894 3.106 2.4 3.106s2.401-1.144 2.401-3.106M96.186 21.442h1.773v1.541h.043a2.16 2.16 0 0 1 2.177-1.635 3 3 0 0 1 .637.069v1.738a2.6 2.6 0 0 0-.835-.112 1.873 1.873 0 0 0-1.937 2.083v5.37h-1.858ZM109.384 27.837c-.25 1.643-1.85 2.771-3.898 2.771-2.634 0-4.269-1.764-4.269-4.595 0-2.84 1.644-4.682 4.19-4.682 2.506 0 4.08 1.72 4.08 4.466v.637h-6.394v.112a2.358 2.358 0 0 0 2.436 2.564 2.05 2.05 0 0 0 2.09-1.273Zm-6.282-2.702h4.526a2.177 2.177 0 0 0-2.22-2.298 2.29 2.29 0 0 0-2.306 2.298",style:{fill:"#fff"}})),n.createElement("g",{id:"_Group_4","data-name":"<Group>"},n.createElement("path",{d:"M37.826 8.731a2.64 2.64 0 0 1 2.808 2.965c0 1.906-1.03 3.002-2.808 3.002h-2.155V8.73Zm-1.228 5.123h1.125a1.876 1.876 0 0 0 1.967-2.146 1.88 1.88 0 0 0-1.967-2.134h-1.125ZM41.68 12.444a2.133 2.133 0 1 1 4.248 0 2.134 2.134 0 1 1-4.247 0m3.334 0c0-.976-.439-1.547-1.208-1.547-.773 0-1.207.571-1.207 1.547 0 .984.434 1.55 1.207 1.55.77 0 1.208-.57 1.208-1.55M51.573 14.698h-.922l-.93-3.317h-.07l-.927 3.317h-.913l-1.242-4.503h.902l.806 3.436h.067l.926-3.436h.852l.926 3.436h.07l.803-3.436h.889ZM53.854 10.195h.855v.715h.066a1.35 1.35 0 0 1 1.344-.802 1.465 1.465 0 0 1 1.559 1.675v2.915h-.889v-2.692c0-.724-.314-1.084-.972-1.084a1.033 1.033 0 0 0-1.075 1.141v2.635h-.888ZM59.094 8.437h.888v6.26h-.888ZM61.218 12.444a2.133 2.133 0 1 1 4.247 0 2.134 2.134 0 1 1-4.247 0m3.333 0c0-.976-.439-1.547-1.208-1.547-.773 0-1.207.571-1.207 1.547 0 .984.434 1.55 1.207 1.55.77 0 1.208-.57 1.208-1.55M66.4 13.424c0-.81.604-1.278 1.676-1.344l1.22-.07v-.389c0-.475-.315-.744-.922-.744-.497 0-.84.182-.939.5h-.86c.09-.773.818-1.27 1.84-1.27 1.128 0 1.765.563 1.765 1.514v3.077h-.855v-.633h-.07a1.52 1.52 0 0 1-1.353.707 1.36 1.36 0 0 1-1.501-1.348m2.895-.384v-.377l-1.1.07c-.62.042-.9.253-.9.65 0 .405.351.64.834.64a1.06 1.06 0 0 0 1.166-.983M71.348 12.444c0-1.423.732-2.324 1.87-2.324a1.48 1.48 0 0 1 1.38.79h.067V8.437h.888v6.26h-.851v-.71h-.07a1.56 1.56 0 0 1-1.415.785c-1.145 0-1.869-.901-1.869-2.328m.918 0c0 .955.45 1.53 1.203 1.53.75 0 1.212-.583 1.212-1.526 0-.938-.468-1.53-1.212-1.53-.748 0-1.203.58-1.203 1.526M79.23 12.444a2.133 2.133 0 1 1 4.247 0 2.134 2.134 0 1 1-4.247 0m3.333 0c0-.976-.438-1.547-1.208-1.547-.772 0-1.207.571-1.207 1.547 0 .984.435 1.55 1.207 1.55.77 0 1.208-.57 1.208-1.55M84.67 10.195h.855v.715h.066a1.35 1.35 0 0 1 1.344-.802 1.465 1.465 0 0 1 1.559 1.675v2.915h-.889v-2.692c0-.724-.314-1.084-.972-1.084a1.033 1.033 0 0 0-1.075 1.141v2.635h-.889ZM93.515 9.074v1.141h.976v.749h-.976v2.315c0 .472.194.679.637.679a3 3 0 0 0 .339-.021v.74a3 3 0 0 1-.484.046c-.988 0-1.381-.348-1.381-1.216v-2.543h-.715v-.749h.715V9.074ZM95.705 8.437h.88v2.481h.07a1.39 1.39 0 0 1 1.374-.806 1.483 1.483 0 0 1 1.55 1.679v2.907h-.889V12.01c0-.72-.335-1.084-.963-1.084a1.052 1.052 0 0 0-1.134 1.142v2.63h-.888ZM104.761 13.482a1.83 1.83 0 0 1-1.95 1.303 2.045 2.045 0 0 1-2.081-2.325 2.077 2.077 0 0 1 2.076-2.352c1.253 0 2.009.856 2.009 2.27v.31h-3.18v.05a1.19 1.19 0 0 0 1.2 1.29 1.08 1.08 0 0 0 1.07-.546Zm-3.126-1.451h2.275a1.086 1.086 0 0 0-1.109-1.167 1.15 1.15 0 0 0-1.166 1.167",style:{fill:"#fff"}})))},he="https://apps.apple.com/app/6754879299";class pe extends n.Component{constructor(e){super(e),this.bindCallbacks()}bindCallbacks(){this.handleInstallExtensionClick=this.handleInstallExtensionClick.bind(this),this.handleAlreadyInstalledClick=this.handleAlreadyInstalledClick.bind(this)}handleAlreadyInstalledClick(){this.props.onExtensionAlreadyInstalled()}handleInstallExtensionClick(){this.props.onExtensionDownloading()}render(){return n.createElement("div",{className:"install-extension"},n.createElement("h1",null,n.createElement(I.x,null,"Please install the browser extension (BETA).")),n.createElement("p",null,n.createElement(I.x,null,"Please download the browser extension and refresh this page to continue.")),n.createElement("a",{href:he,className:"browser-webstore safari",target:"_blank",rel:"noopener noreferrer",onClick:this.handleInstallExtensionClick},n.createElement(de,null)),n.createElement("div",{className:"form-actions"},n.createElement("a",{href:he,className:"button primary big full-width",role:"button",target:"_blank",rel:"noopener noreferrer",onClick:this.handleInstallExtensionClick},n.createElement(I.x,null,"Download extension")),n.createElement("button",{className:"link",type:"button",onClick:this.handleAlreadyInstalledClick},n.createElement(I.x,null,"I already installed the extension"))))}}pe.propTypes={context:c().any,onExtensionDownloading:c().func,onExtensionAlreadyInstalled:c().func};const ue=a((0,P.C)("common")(pe));var me,ge,Ee,ye,fe,be,ve,Se,Te,we,xe,Ae,Ce,Re,qe,Ne,ke,_e,Oe,Ie,Pe,De;function Ue(){return Ue=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)({}).hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},Ue.apply(null,arguments)}const Ge=function(e){return n.createElement("svg",Ue({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 484 307"},e),me||(me=n.createElement("rect",{width:483,height:306,x:.5,y:.5,fill:"#EBEBEB",rx:16.3})),ge||(ge=n.createElement("rect",{width:483,height:306,x:.5,y:.5,stroke:"#F5F5F5",rx:16.3})),Ee||(Ee=n.createElement("circle",{cx:21.613,cy:18.2,r:4.594,fill:"#EE6B5F",stroke:"#E93F30",strokeWidth:.438})),ye||(ye=n.createElement("circle",{cx:36.487,cy:18.2,r:4.594,fill:"#F5BE50",stroke:"#F2AD21",strokeWidth:.438})),fe||(fe=n.createElement("circle",{cx:51.362,cy:18.2,r:4.594,fill:"#62C655",stroke:"#47AC3A",strokeWidth:.438})),be||(be=n.createElement("rect",{width:25.106,height:24.105,x:146.275,y:6.147,fill:"#FDFDFD",rx:12.053})),ve||(ve=n.createElement("rect",{width:25.106,height:24.105,x:146.275,y:6.147,stroke:"#FEFEFE",rx:12.053})),Se||(Se=n.createElement("path",{fill:"#272727",d:"m165.841 17.203-6.06-5.592a1.42 1.42 0 0 0-.951-.364c-.352 0-.691.13-.95.364l-3.803 3.524a3.4 3.4 0 0 1 1.306.858c.361.382.624.843.768 1.344h5.134a.49.49 0 0 1 .337.137.47.47 0 0 1 .138.33v.768a.47.47 0 0 1-.475.467h-.593v1.085a.46.46 0 0 1-.292.432.5.5 0 0 1-.182.036h-1.301a.48.48 0 0 1-.439-.289.5.5 0 0 1-.035-.178v-1.086h-2.292a3.2 3.2 0 0 1-.759 1.36 3.3 3.3 0 0 1-1.315.86l3.82 3.53a1.42 1.42 0 0 0 1.901 0l6.05-5.59a1.364 1.364 0 0 0-.007-1.996"})),Te||(Te=n.createElement("path",{fill:"#272727",d:"M152.951 16.66a1.7 1.7 0 0 0-.712.169c-.248.12-.459.304-.61.531a1.5 1.5 0 0 0-.076 1.543c.129.24.321.442.556.586a1.577 1.577 0 0 0 2.161-.518c.141-.234.216-.5.216-.772a1.47 1.47 0 0 0-.436-1.086 1.56 1.56 0 0 0-1.099-.453"})),we||(we=n.createElement("rect",{width:185.694,height:24.2,x:186.381,y:6.1,fill:"#FDFDFD",rx:12.1})),xe||(xe=n.createElement("rect",{width:185.694,height:24.2,x:186.381,y:6.1,stroke:"#FEFEFE",rx:12.1})),Ae||(Ae=n.createElement("mask",{id:"a",fill:"#fff"},n.createElement("path",{d:"M172.799 44.954a5.6 5.6 0 0 0 3.245 1.036h74.14c12.372 0 22.401 10.03 22.401 22.4v178.137c0 12.371-10.029 22.401-22.401 22.401H68.307c-12.372 0-22.4-10.03-22.4-22.401V68.391c0-12.372 10.028-22.4 22.4-22.4h74.139a5.6 5.6 0 0 0 3.245-1.037L156 37.625a5.6 5.6 0 0 1 6.49 0z"}))),Ce||(Ce=n.createElement("path",{fill:"#F8F8F8",d:"M172.799 44.954a5.6 5.6 0 0 0 3.245 1.036h74.14c12.372 0 22.401 10.03 22.401 22.4v178.137c0 12.371-10.029 22.401-22.401 22.401H68.307c-12.372 0-22.4-10.03-22.4-22.401V68.391c0-12.372 10.028-22.4 22.4-22.4h74.139a5.6 5.6 0 0 0 3.245-1.037L156 37.625a5.6 5.6 0 0 1 6.49 0z"})),Re||(Re=n.createElement("path",{fill:"#A9A9A9",d:"m145.691 44.954-.405-.57zm27.108 0 .405-.57zm3.245 1.036v.7h74.14v-1.4h-74.14zm74.14 0v.7c11.985 0 21.701 9.716 21.701 21.7h1.4c0-12.757-10.343-23.1-23.101-23.1zm22.401 22.4h-.7v178.137h1.4V68.391h-.7Zm0 178.137h-.7c0 11.985-9.716 21.701-21.701 21.701v1.4c12.758 0 23.101-10.343 23.101-23.101zm-22.401 22.401v-.7H68.307v1.4h181.877zm-181.877 0v-.7c-11.985 0-21.7-9.716-21.7-21.701h-1.4c0 12.758 10.342 23.101 23.1 23.101zm-22.4-22.401h.7V68.391h-1.4v178.136zm0-178.136h.7c0-11.985 9.715-21.7 21.7-21.7v-1.4c-12.758 0-23.1 10.342-23.1 23.1zm22.4-22.4v.7h74.139v-1.4h-74.14zm77.384-1.037.406.57 10.309-7.328-.406-.57-.405-.571-10.309 7.329zm16.799-7.329-.406.57 10.309 7.33.406-.57.405-.571-10.309-7.33zm-20.044 8.365v.7a6.3 6.3 0 0 0 3.651-1.165l-.406-.57-.405-.571a4.9 4.9 0 0 1-2.84.906zM156 37.625l.406.57a4.9 4.9 0 0 1 5.678 0l.406-.57.405-.57a6.3 6.3 0 0 0-7.3 0zm20.044 8.365v-.7a4.9 4.9 0 0 1-2.84-.906l-.405.57-.406.57a6.3 6.3 0 0 0 3.651 1.166z",mask:"url(#safari_quickaccess_configuration_light_svg__a)"})),qe||(qe=n.createElement("path",{stroke:"#000",strokeLinecap:"round",strokeOpacity:.1,strokeWidth:7.388,d:"M72.024 63.89h174.452m-164.46 11.2h154.467m-127.822 11.2h101.178"})),Ne||(Ne=n.createElement("path",{stroke:"#000",strokeLinecap:"round",strokeOpacity:.1,strokeWidth:3.694,d:"M72.024 108.689h174.452M108.661 119.89h101.178M72.024 131.089h174.452M82.016 142.29h154.467m-127.822 11.199h101.178"})),ke||(ke=n.createElement("g",{opacity:.5},n.createElement("rect",{width:191.8,height:22.4,x:63.35,y:175.89,fill:"#3D76F9",rx:11.2}),n.createElement("path",{stroke:"#000",strokeLinecap:"round",strokeOpacity:.25,strokeWidth:2.8,d:"M130.051 187.089h58.398"}))),_e||(_e=n.createElement("g",{opacity:.5},n.createElement("rect",{width:191.8,height:22.4,x:63.35,y:203.89,fill:"#C5C5C5",rx:11.2}),n.createElement("path",{stroke:"#000",strokeLinecap:"round",strokeOpacity:.25,strokeWidth:2.8,d:"M130.051 215.089h58.398"}))),Oe||(Oe=n.createElement("rect",{width:191.8,height:22,x:63.35,y:231.89,fill:"#E4E4E4",rx:11})),Ie||(Ie=n.createElement("rect",{width:191.8,height:22,x:63.35,y:231.89,stroke:"#D40101",strokeWidth:3,rx:11})),Pe||(Pe=n.createElement("path",{fill:"#000",d:"M82.929 246.89h-.923l2.67-7.273h.91l2.67 7.273h-.924l-2.173-6.123h-.057zm.34-2.841h3.722v.781H83.27zm6.844-4.432v7.273h-.838v-7.273zm2.77 7.273-1.661-5.455h.88l1.18 4.176h.056l1.165-4.176h.895l1.15 4.162h.057l1.18-4.162h.88l-1.662 5.455h-.824l-1.193-4.191h-.085l-1.193 4.191h-.824Zm8.495.127q-.519 0-.941-.195a1.6 1.6 0 0 1-.671-.572q-.249-.377-.249-.909 0-.468.185-.76.185-.294.493-.461.31-.167.682-.249.376-.085.757-.135.497-.063.806-.096.312-.034.454-.117.146-.081.146-.284v-.028q0-.526-.288-.817-.284-.291-.863-.291-.6 0-.941.263-.34.262-.479.561l-.795-.285q.212-.496.568-.774.358-.28.781-.39a3.2 3.2 0 0 1 .838-.114q.262 0 .604.064.344.06.664.252.323.192.536.579t.213 1.037v3.594h-.838v-.739h-.043a1.5 1.5 0 0 1-.284.38q-.198.203-.529.344-.33.142-.806.142m.128-.752q.497 0 .838-.196a1.32 1.32 0 0 0 .696-1.154v-.767q-.054.064-.234.117a4 4 0 0 1-.412.089 18 18 0 0 1-.803.107 3 3 0 0 0-.611.138 1.05 1.05 0 0 0-.454.281q-.171.184-.171.504 0 .436.323.66.327.22.828.221m4.246 2.67q-.213 0-.38-.035a1 1 0 0 1-.231-.064l.213-.739q.306.078.54.057a.65.65 0 0 0 .416-.21q.184-.184.337-.6l.156-.426-2.017-5.483h.909l1.506 4.347h.057l1.505-4.347h.91l-2.316 6.25a2.4 2.4 0 0 1-.387.7 1.45 1.45 0 0 1-.536.415q-.302.135-.682.135m8.89-6.278-.752.213a1.4 1.4 0 0 0-.21-.366 1 1 0 0 0-.369-.298 1.35 1.35 0 0 0-.6-.117q-.5 0-.835.23-.33.228-.33.579 0 .313.227.494.228.181.71.302l.81.198q.732.178 1.09.544.359.362.359.934 0 .469-.27.838-.267.369-.746.582a2.7 2.7 0 0 1-1.115.213q-.835 0-1.381-.362-.547-.362-.693-1.058l.796-.199q.113.441.429.66.32.22.835.221.587 0 .93-.249.348-.252.348-.604a.63.63 0 0 0-.199-.475q-.198-.196-.61-.292l-.909-.213q-.75-.178-1.101-.55-.348-.377-.348-.941 0-.462.259-.817.262-.355.714-.558a2.5 2.5 0 0 1 1.03-.202q.809 0 1.271.355.465.355.66.938m4.586 4.233h-.923l2.67-7.273h.909l2.671 7.273h-.924l-2.173-6.123h-.057zm.341-2.841h3.721v.781h-3.721zm6.843-4.432v7.273h-.838v-7.273zm2.373 0v7.273h-.838v-7.273zm3.751 7.386q-.74 0-1.296-.351a2.4 2.4 0 0 1-.867-.984q-.309-.632-.309-1.477 0-.852.309-1.488.312-.636.867-.987.557-.352 1.296-.352.738 0 1.292.352.558.351.867.987.312.636.312 1.488 0 .845-.312 1.477a2.36 2.36 0 0 1-.867.984q-.554.351-1.292.351m0-.753q.561 0 .923-.287a1.7 1.7 0 0 0 .536-.757q.174-.469.174-1.015a2.9 2.9 0 0 0-.174-1.019 1.7 1.7 0 0 0-.536-.764q-.362-.291-.923-.291c-.561 0-.682.097-.924.291q-.362.291-.536.764a2.9 2.9 0 0 0-.174 1.019q0 .546.174 1.015a1.7 1.7 0 0 0 .536.757q.363.288.924.287m4.801.64-1.662-5.455h.881l1.179 4.176h.056l1.165-4.176h.895l1.151 4.162h.056l1.179-4.162h.881l-1.662 5.455h-.824l-1.193-4.191h-.085l-1.193 4.191zm11.917.113q-.738 0-1.296-.351a2.4 2.4 0 0 1-.866-.984q-.309-.632-.309-1.477 0-.852.309-1.488.312-.636.866-.987.558-.352 1.296-.352.74 0 1.293.352.558.351.867.987.312.636.312 1.488 0 .845-.312 1.477a2.36 2.36 0 0 1-.867.984q-.554.351-1.293.351m0-.753q.561 0 .924-.287a1.7 1.7 0 0 0 .536-.757q.174-.469.174-1.015a2.9 2.9 0 0 0-.174-1.019 1.7 1.7 0 0 0-.536-.764q-.363-.291-.924-.291c-.561 0-.681.097-.923.291q-.362.291-.536.764a2.9 2.9 0 0 0-.174 1.019q0 .546.174 1.015a1.7 1.7 0 0 0 .536.757q.362.288.923.287m4.589-2.642v3.282h-.838v-5.455h.81v.852h.071q.192-.415.582-.667.391-.256 1.009-.256.553 0 .969.227.416.225.647.682.231.455.231 1.151v3.466h-.839v-3.409q0-.644-.333-1.002-.334-.362-.917-.362-.4 0-.717.174a1.24 1.24 0 0 0-.493.508 1.7 1.7 0 0 0-.182.809m7.938 3.282v-7.273h4.389v.781h-3.508v2.458h3.281v.781h-3.281v2.471h3.565v.782zm10.323-5.455-2.017 5.455h-.852l-2.017-5.455h.909l1.506 4.347h.056l1.506-4.347zm3.198 5.568q-.789 0-1.36-.348a2.33 2.33 0 0 1-.877-.98q-.306-.632-.306-1.47t.306-1.477q.309-.644.859-1.002.554-.362 1.293-.362.426 0 .841.142.416.143.757.462.34.316.543.838t.203 1.285v.355h-4.205v-.724h3.352a1.8 1.8 0 0 0-.184-.824 1.4 1.4 0 0 0-.519-.572 1.46 1.46 0 0 0-.788-.209q-.501 0-.867.249a1.63 1.63 0 0 0-.557.639q-.195.393-.196.845v.483q0 .618.214 1.047.216.427.6.65.382.22.891.22.33 0 .597-.092.27-.096.465-.284a1.3 1.3 0 0 0 .302-.476l.809.227a1.8 1.8 0 0 1-.429.725q-.303.309-.746.483-.444.17-.998.17m3.533-.113v-5.455h.81v.824h.057q.148-.405.54-.657.39-.252.88-.252l.231.003q.138.004.21.011v.852a3 3 0 0 0-.512-.056q-.398 0-.71.166a1.23 1.23 0 0 0-.668 1.112v3.452zm4.427 2.045q-.213 0-.38-.035a1 1 0 0 1-.231-.064l.213-.739q.306.078.54.057a.64.64 0 0 0 .415-.21q.185-.184.338-.6l.156-.426-2.017-5.483h.909l1.506 4.347h.057l1.505-4.347h.909l-2.315 6.25a2.4 2.4 0 0 1-.387.7 1.46 1.46 0 0 1-.536.415q-.303.135-.682.135m9.274-2.045-1.989-7.273h.895l1.52 5.923h.071l1.548-5.923h.994l1.549 5.923h.071l1.52-5.923h.895l-1.989 7.273h-.909l-1.605-5.796h-.057l-1.605 5.796zm9.836.113q-.788 0-1.36-.348a2.33 2.33 0 0 1-.877-.98q-.305-.632-.305-1.47t.305-1.477q.31-.644.859-1.002.555-.362 1.293-.362.426 0 .842.142.415.143.756.462.341.316.543.838.203.522.203 1.285v.355h-4.205v-.724h3.353q0-.462-.185-.824a1.4 1.4 0 0 0-.519-.572 1.46 1.46 0 0 0-.788-.209q-.501 0-.866.249a1.6 1.6 0 0 0-.558.639q-.195.393-.195.845v.483q0 .618.213 1.047.216.427.6.65.384.22.891.22.33 0 .597-.092.27-.096.465-.284a1.3 1.3 0 0 0 .302-.476l.81.227a1.8 1.8 0 0 1-.43.725q-.302.309-.746.483-.443.17-.998.17m3.647-.113v-7.273h.838v2.685h.071q.093-.142.256-.363.167-.223.476-.397.312-.178.845-.178.689 0 1.215.345.525.344.82.976.294.633.295 1.492 0 .866-.295 1.502a2.33 2.33 0 0 1-.817.98 2.14 2.14 0 0 1-1.204.344q-.525 0-.841-.174a1.6 1.6 0 0 1-.487-.401 6 6 0 0 1-.263-.376h-.099v.838zm.824-2.728q0 .618.181 1.091.181.468.529.735.349.262.853.262.525 0 .877-.277a1.7 1.7 0 0 0 .533-.752q.18-.476.181-1.059 0-.575-.178-1.037a1.6 1.6 0 0 0-.529-.735q-.351-.273-.884-.273-.512 0-.86.259-.348.256-.525.717a2.9 2.9 0 0 0-.178 1.069m9.137-1.505-.753.213a1.4 1.4 0 0 0-.209-.366 1 1 0 0 0-.369-.298 1.35 1.35 0 0 0-.601-.117q-.5 0-.834.23-.33.228-.33.579 0 .313.227.494t.71.302l.81.198q.732.178 1.09.544.359.362.359.934 0 .469-.27.838-.267.369-.746.582-.48.213-1.115.213-.835 0-1.381-.362-.548-.362-.693-1.058l.796-.199q.113.441.429.66.32.22.835.221.586 0 .93-.249.348-.252.348-.604a.63.63 0 0 0-.199-.475q-.199-.196-.61-.292l-.91-.213q-.749-.177-1.1-.55-.348-.377-.348-.941 0-.462.259-.817.262-.356.714-.558a2.5 2.5 0 0 1 1.029-.202q.81 0 1.272.355.465.355.66.938m1.361 4.233v-5.455h.838v5.455zm.426-6.364a.6.6 0 0 1-.422-.167.54.54 0 0 1-.174-.401q0-.234.174-.401a.6.6 0 0 1 .422-.167.58.58 0 0 1 .419.167.53.53 0 0 1 .178.401q0 .234-.178.401a.58.58 0 0 1-.419.167m4.319.909v.71h-2.826v-.71zm-2.002-1.307h.838v5.199q0 .355.103.533a.53.53 0 0 0 .27.234q.167.057.351.057.138 0 .227-.014l.142-.029.171.753a1.6 1.6 0 0 1-.238.064 1.7 1.7 0 0 1-.387.036q-.355 0-.696-.153a1.4 1.4 0 0 1-.561-.465q-.22-.313-.22-.789zm5.491 6.875q-.787 0-1.36-.348a2.34 2.34 0 0 1-.877-.98q-.305-.632-.305-1.47t.305-1.477q.31-.644.86-1.002.554-.362 1.292-.362.426 0 .842.142.416.143.756.462.342.316.544.838t.202 1.285v.355h-4.205v-.724h3.353q0-.462-.185-.824a1.4 1.4 0 0 0-.518-.572 1.46 1.46 0 0 0-.789-.209 1.5 1.5 0 0 0-.866.249 1.6 1.6 0 0 0-.558.639q-.195.393-.195.845v.483q0 .618.213 1.047.216.427.6.65.384.22.891.22.33 0 .597-.092.27-.096.465-.284a1.3 1.3 0 0 0 .302-.476l.81.227a1.8 1.8 0 0 1-.43.725q-.302.309-.746.483-.443.17-.998.17m4.145-.057a.61.61 0 0 1-.451-.188.61.61 0 0 1-.189-.451q0-.262.189-.451a.62.62 0 0 1 .451-.188q.262 0 .451.188a.62.62 0 0 1 .188.451.66.66 0 0 1-.32.554.6.6 0 0 1-.319.085m2.754 0a.61.61 0 0 1-.451-.188.61.61 0 0 1-.189-.451q0-.262.189-.451a.62.62 0 0 1 .451-.188q.262 0 .451.188a.62.62 0 0 1 .188.451.66.66 0 0 1-.32.554.6.6 0 0 1-.319.085m2.753 0a.61.61 0 0 1-.451-.188.62.62 0 0 1-.188-.451q0-.262.188-.451a.62.62 0 0 1 .451-.188q.264 0 .451.188a.62.62 0 0 1 .189.451.66.66 0 0 1-.32.554.6.6 0 0 1-.32.085"})),De||(De=n.createElement("path",{fill:"#D40101",d:"M362.322 245.635a2.8 2.8 0 0 0 0-5.6zm-96.363-4.78a2.8 2.8 0 0 0 0 3.96l17.819 17.819a2.801 2.801 0 0 0 3.96-3.96l-15.839-15.839 15.839-15.839a2.8 2.8 0 1 0-3.96-3.96zm96.363 1.98v-2.8h-94.383v5.6h94.383z"})))};var Le,Me,Fe,$e,Ve,Ke,Be,je,ze,He,We,Ye,Ze,Xe,Je,Qe,et,tt,st,nt,it,rt;function at(){return at=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)({}).hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},at.apply(null,arguments)}const ot=function(e){return n.createElement("svg",at({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 484 307"},e),Le||(Le=n.createElement("rect",{width:483,height:306,x:.5,y:.5,fill:"#232222",rx:16.3})),Me||(Me=n.createElement("rect",{width:483,height:306,x:.5,y:.5,stroke:"#4F4F4F",rx:16.3})),Fe||(Fe=n.createElement("circle",{cx:21.613,cy:18.2,r:4.594,fill:"#EE6B5F",stroke:"#E93F30",strokeWidth:.438})),$e||($e=n.createElement("circle",{cx:36.487,cy:18.2,r:4.594,fill:"#F5BE50",stroke:"#F2AD21",strokeWidth:.438})),Ve||(Ve=n.createElement("circle",{cx:51.362,cy:18.2,r:4.594,fill:"#62C655",stroke:"#47AC3A",strokeWidth:.438})),Ke||(Ke=n.createElement("rect",{width:25.106,height:24.105,x:146.275,y:6.147,fill:"#2C2A2A",rx:12.053})),Be||(Be=n.createElement("rect",{width:25.106,height:24.105,x:146.275,y:6.147,stroke:"#474747",rx:12.053})),je||(je=n.createElement("path",{fill:"#DFE0E1",d:"m165.841 17.203-6.06-5.592a1.42 1.42 0 0 0-.951-.364c-.352 0-.691.13-.95.364l-3.803 3.524a3.4 3.4 0 0 1 1.306.858c.361.382.624.843.768 1.344h5.134a.49.49 0 0 1 .337.137.47.47 0 0 1 .138.33v.768a.47.47 0 0 1-.475.467h-.593v1.085a.46.46 0 0 1-.292.432.5.5 0 0 1-.182.036h-1.301a.48.48 0 0 1-.439-.289.5.5 0 0 1-.035-.178v-1.086h-2.292a3.2 3.2 0 0 1-.759 1.36 3.3 3.3 0 0 1-1.315.86l3.82 3.53a1.42 1.42 0 0 0 1.901 0l6.05-5.59a1.364 1.364 0 0 0-.007-1.996"})),ze||(ze=n.createElement("path",{fill:"#DFE0E1",d:"M152.951 16.66a1.7 1.7 0 0 0-.712.169c-.248.12-.459.304-.61.531a1.5 1.5 0 0 0-.076 1.543c.129.24.321.442.556.586a1.577 1.577 0 0 0 2.161-.518c.141-.234.216-.5.216-.772a1.47 1.47 0 0 0-.436-1.086 1.56 1.56 0 0 0-1.099-.453"})),He||(He=n.createElement("rect",{width:185.694,height:24.2,x:186.381,y:6.1,fill:"#2C2A2A",rx:12.1})),We||(We=n.createElement("rect",{width:185.694,height:24.2,x:186.381,y:6.1,stroke:"#474747",rx:12.1})),Ye||(Ye=n.createElement("mask",{id:"a",fill:"#fff"},n.createElement("path",{fillRule:"evenodd",d:"M172.799 44.954a5.6 5.6 0 0 0 3.245 1.036h74.14c12.372 0 22.401 10.03 22.401 22.4v178.137c0 12.372-10.029 22.401-22.401 22.401H68.307c-12.372 0-22.4-10.029-22.4-22.401V68.391c0-12.372 10.028-22.4 22.4-22.4h74.139a5.6 5.6 0 0 0 3.245-1.037L156 37.625a5.6 5.6 0 0 1 6.49 0z",clipRule:"evenodd"}))),Ze||(Ze=n.createElement("path",{fill:"#3B3C3F",fillRule:"evenodd",d:"M172.799 44.954a5.6 5.6 0 0 0 3.245 1.036h74.14c12.372 0 22.401 10.03 22.401 22.4v178.137c0 12.372-10.029 22.401-22.401 22.401H68.307c-12.372 0-22.4-10.029-22.4-22.401V68.391c0-12.372 10.028-22.4 22.4-22.4h74.139a5.6 5.6 0 0 0 3.245-1.037L156 37.625a5.6 5.6 0 0 1 6.49 0z",clipRule:"evenodd"})),Xe||(Xe=n.createElement("path",{fill:"#7E7F80",d:"m145.691 44.954-.405-.57zm27.108 0 .405-.57zm3.245 1.036v.7h74.14v-1.4h-74.14zm74.14 0v.7c11.985 0 21.701 9.716 21.701 21.7h1.4c0-12.757-10.343-23.1-23.101-23.1zm22.401 22.4h-.7v178.137h1.4V68.391h-.7Zm0 178.137h-.7c0 11.985-9.716 21.701-21.701 21.701v1.4c12.758 0 23.101-10.343 23.101-23.101zm-22.401 22.401v-.7H68.307v1.4h181.877zm-181.877 0v-.7c-11.985 0-21.7-9.716-21.7-21.701h-1.4c0 12.758 10.342 23.101 23.1 23.101zm-22.4-22.401h.7V68.391h-1.4v178.136zm0-178.136h.7c0-11.985 9.715-21.7 21.7-21.7v-1.4c-12.758 0-23.1 10.342-23.1 23.1zm22.4-22.4v.7h74.139v-1.4h-74.14zm77.384-1.037.406.57 10.309-7.328-.406-.57-.405-.571-10.309 7.329zm16.799-7.329-.406.57 10.309 7.33.406-.57.405-.571-10.309-7.33zm-20.044 8.365v.7a6.3 6.3 0 0 0 3.651-1.165l-.406-.57-.405-.571a4.9 4.9 0 0 1-2.84.906zM156 37.625l.406.57a4.9 4.9 0 0 1 5.678 0l.406-.57.405-.57a6.3 6.3 0 0 0-7.3 0zm20.044 8.365v-.7a4.9 4.9 0 0 1-2.84-.906l-.405.57-.406.57a6.3 6.3 0 0 0 3.651 1.166z",mask:"url(#safari_quickaccess_configuration_dark_svg__a)"})),Je||(Je=n.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeOpacity:.1,strokeWidth:7.388,d:"M72.024 63.89h174.452m-164.46 11.2h154.467m-127.822 11.2h101.178"})),Qe||(Qe=n.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeOpacity:.1,strokeWidth:3.694,d:"M72.024 108.689h174.452M108.661 119.89h101.178M72.024 131.089h174.452M82.016 142.29h154.467m-127.822 11.199h101.178"})),et||(et=n.createElement("g",{opacity:.5},n.createElement("rect",{width:191.8,height:22.4,x:63.35,y:175.89,fill:"#007CFF",rx:11.2}),n.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeWidth:2.8,d:"M130.051 187.089h58.398"}))),tt||(tt=n.createElement("g",{opacity:.5},n.createElement("rect",{width:191.8,height:22.4,x:63.35,y:203.89,fill:"#727273",rx:11.2}),n.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeWidth:2.8,d:"M130.051 215.089h58.398"}))),st||(st=n.createElement("rect",{width:191.8,height:22,x:63.35,y:231.89,fill:"#575759",rx:11})),nt||(nt=n.createElement("rect",{width:191.8,height:22,x:63.35,y:231.89,stroke:"#D40101",strokeWidth:3,rx:11})),it||(it=n.createElement("path",{fill:"#fff",d:"M82.929 246.89h-.923l2.67-7.273h.91l2.67 7.273h-.924l-2.173-6.123h-.057zm.34-2.841h3.722v.781H83.27zm6.844-4.432v7.273h-.838v-7.273zm2.77 7.273-1.661-5.455h.88l1.18 4.176h.056l1.165-4.176h.895l1.15 4.162h.057l1.18-4.162h.88l-1.662 5.455h-.824l-1.193-4.191h-.085l-1.193 4.191h-.824Zm8.495.127q-.519 0-.941-.195a1.6 1.6 0 0 1-.671-.572q-.249-.377-.249-.909 0-.468.185-.76.185-.294.493-.461.31-.167.682-.249.376-.085.757-.135.497-.063.806-.096.312-.034.454-.117.146-.081.146-.284v-.028q0-.526-.288-.817-.284-.291-.863-.291-.6 0-.941.263-.34.262-.479.561l-.795-.285q.212-.496.568-.774.358-.28.781-.39a3.2 3.2 0 0 1 .838-.114q.262 0 .604.064.344.06.664.252.323.192.536.579t.213 1.037v3.594h-.838v-.739h-.043a1.5 1.5 0 0 1-.284.38q-.198.203-.529.344-.33.142-.806.142m.128-.752q.497 0 .838-.196a1.32 1.32 0 0 0 .696-1.154v-.767q-.054.064-.234.117a4 4 0 0 1-.412.089 18 18 0 0 1-.803.107 3 3 0 0 0-.611.138 1.05 1.05 0 0 0-.454.281q-.171.184-.171.504 0 .436.323.66.327.22.828.221m4.246 2.67q-.213 0-.38-.035a1 1 0 0 1-.231-.064l.213-.739q.306.078.54.057a.65.65 0 0 0 .416-.21q.184-.184.337-.6l.156-.426-2.017-5.483h.909l1.506 4.347h.057l1.505-4.347h.91l-2.316 6.25a2.4 2.4 0 0 1-.387.7 1.45 1.45 0 0 1-.536.415q-.302.135-.682.135m8.89-6.278-.752.213a1.4 1.4 0 0 0-.21-.366 1 1 0 0 0-.369-.298 1.35 1.35 0 0 0-.6-.117q-.5 0-.835.23-.33.228-.33.579 0 .313.227.494.228.181.71.302l.81.198q.732.178 1.09.544.359.362.359.934 0 .469-.27.838-.267.369-.746.582a2.7 2.7 0 0 1-1.115.213q-.835 0-1.381-.362-.547-.362-.693-1.058l.796-.199q.113.441.429.66.32.22.835.221.587 0 .93-.249.348-.252.348-.604a.63.63 0 0 0-.199-.475q-.198-.196-.61-.292l-.909-.213q-.75-.178-1.101-.55-.348-.377-.348-.941 0-.462.259-.817.262-.355.714-.558a2.5 2.5 0 0 1 1.03-.202q.809 0 1.271.355.465.355.66.938m4.586 4.233h-.923l2.67-7.273h.909l2.671 7.273h-.924l-2.173-6.123h-.057zm.341-2.841h3.721v.781h-3.721zm6.843-4.432v7.273h-.838v-7.273zm2.373 0v7.273h-.838v-7.273zm3.751 7.386q-.74 0-1.296-.351a2.4 2.4 0 0 1-.867-.984q-.309-.632-.309-1.477 0-.852.309-1.488.312-.636.867-.987.557-.352 1.296-.352.738 0 1.292.352.558.351.867.987.312.636.312 1.488 0 .845-.312 1.477a2.36 2.36 0 0 1-.867.984q-.554.351-1.292.351m0-.753q.561 0 .923-.287a1.7 1.7 0 0 0 .536-.757q.174-.469.174-1.015a2.9 2.9 0 0 0-.174-1.019 1.7 1.7 0 0 0-.536-.764q-.362-.291-.923-.291c-.561 0-.682.097-.924.291q-.362.291-.536.764a2.9 2.9 0 0 0-.174 1.019q0 .546.174 1.015a1.7 1.7 0 0 0 .536.757q.363.288.924.287m4.801.64-1.662-5.455h.881l1.179 4.176h.056l1.165-4.176h.895l1.151 4.162h.056l1.179-4.162h.881l-1.662 5.455h-.824l-1.193-4.191h-.085l-1.193 4.191zm11.917.113q-.738 0-1.296-.351a2.4 2.4 0 0 1-.866-.984q-.309-.632-.309-1.477 0-.852.309-1.488.312-.636.866-.987.558-.352 1.296-.352.74 0 1.293.352.558.351.867.987.312.636.312 1.488 0 .845-.312 1.477a2.36 2.36 0 0 1-.867.984q-.554.351-1.293.351m0-.753q.561 0 .924-.287a1.7 1.7 0 0 0 .536-.757q.174-.469.174-1.015a2.9 2.9 0 0 0-.174-1.019 1.7 1.7 0 0 0-.536-.764q-.363-.291-.924-.291c-.561 0-.681.097-.923.291q-.362.291-.536.764a2.9 2.9 0 0 0-.174 1.019q0 .546.174 1.015a1.7 1.7 0 0 0 .536.757q.362.288.923.287m4.589-2.642v3.282h-.838v-5.455h.81v.852h.071q.192-.415.582-.667.391-.256 1.009-.256.553 0 .969.227.416.225.647.682.231.455.231 1.151v3.466h-.839v-3.409q0-.644-.333-1.002-.334-.362-.917-.362-.4 0-.717.174a1.24 1.24 0 0 0-.493.508 1.7 1.7 0 0 0-.182.809m7.938 3.282v-7.273h4.389v.781h-3.508v2.458h3.281v.781h-3.281v2.471h3.565v.782zm10.323-5.455-2.017 5.455h-.852l-2.017-5.455h.909l1.506 4.347h.056l1.506-4.347zm3.198 5.568q-.789 0-1.36-.348a2.33 2.33 0 0 1-.877-.98q-.306-.632-.306-1.47t.306-1.477q.309-.644.859-1.002.554-.362 1.293-.362.426 0 .841.142.416.143.757.462.34.316.543.838t.203 1.285v.355h-4.205v-.724h3.352a1.8 1.8 0 0 0-.184-.824 1.4 1.4 0 0 0-.519-.572 1.46 1.46 0 0 0-.788-.209q-.501 0-.867.249a1.63 1.63 0 0 0-.557.639q-.195.393-.196.845v.483q0 .618.214 1.047.216.427.6.65.382.22.891.22.33 0 .597-.092.27-.096.465-.284a1.3 1.3 0 0 0 .302-.476l.809.227a1.8 1.8 0 0 1-.429.725q-.303.309-.746.483-.444.17-.998.17m3.533-.113v-5.455h.81v.824h.057q.148-.405.54-.657.39-.252.88-.252l.231.003q.138.004.21.011v.852a3 3 0 0 0-.512-.056q-.398 0-.71.166a1.23 1.23 0 0 0-.668 1.112v3.452zm4.427 2.045q-.213 0-.38-.035a1 1 0 0 1-.231-.064l.213-.739q.306.078.54.057a.64.64 0 0 0 .415-.21q.185-.184.338-.6l.156-.426-2.017-5.483h.909l1.506 4.347h.057l1.505-4.347h.909l-2.315 6.25a2.4 2.4 0 0 1-.387.7 1.46 1.46 0 0 1-.536.415q-.303.135-.682.135m9.274-2.045-1.989-7.273h.895l1.52 5.923h.071l1.548-5.923h.994l1.549 5.923h.071l1.52-5.923h.895l-1.989 7.273h-.909l-1.605-5.796h-.057l-1.605 5.796zm9.836.113q-.788 0-1.36-.348a2.33 2.33 0 0 1-.877-.98q-.305-.632-.305-1.47t.305-1.477q.31-.644.859-1.002.555-.362 1.293-.362.426 0 .842.142.415.143.756.462.341.316.543.838.203.522.203 1.285v.355h-4.205v-.724h3.353q0-.462-.185-.824a1.4 1.4 0 0 0-.519-.572 1.46 1.46 0 0 0-.788-.209q-.501 0-.866.249a1.6 1.6 0 0 0-.558.639q-.195.393-.195.845v.483q0 .618.213 1.047.216.427.6.65.384.22.891.22.33 0 .597-.092.27-.096.465-.284a1.3 1.3 0 0 0 .302-.476l.81.227a1.8 1.8 0 0 1-.43.725q-.302.309-.746.483-.443.17-.998.17m3.647-.113v-7.273h.838v2.685h.071q.093-.142.256-.363.167-.223.476-.397.312-.178.845-.178.689 0 1.215.345.525.344.82.976.294.633.295 1.492 0 .866-.295 1.502a2.33 2.33 0 0 1-.817.98 2.14 2.14 0 0 1-1.204.344q-.525 0-.841-.174a1.6 1.6 0 0 1-.487-.401 6 6 0 0 1-.263-.376h-.099v.838zm.824-2.728q0 .618.181 1.091.181.468.529.735.349.262.853.262.525 0 .877-.277a1.7 1.7 0 0 0 .533-.752q.18-.476.181-1.059 0-.575-.178-1.037a1.6 1.6 0 0 0-.529-.735q-.351-.273-.884-.273-.512 0-.86.259-.348.256-.525.717a2.9 2.9 0 0 0-.178 1.069m9.137-1.505-.753.213a1.4 1.4 0 0 0-.209-.366 1 1 0 0 0-.369-.298 1.35 1.35 0 0 0-.601-.117q-.5 0-.834.23-.33.228-.33.579 0 .313.227.494t.71.302l.81.198q.732.178 1.09.544.359.362.359.934 0 .469-.27.838-.267.369-.746.582-.48.213-1.115.213-.835 0-1.381-.362-.548-.362-.693-1.058l.796-.199q.113.441.429.66.32.22.835.221.586 0 .93-.249.348-.252.348-.604a.63.63 0 0 0-.199-.475q-.199-.196-.61-.292l-.91-.213q-.749-.177-1.1-.55-.348-.377-.348-.941 0-.462.259-.817.262-.356.714-.558a2.5 2.5 0 0 1 1.029-.202q.81 0 1.272.355.465.355.66.938m1.361 4.233v-5.455h.838v5.455zm.426-6.364a.6.6 0 0 1-.422-.167.54.54 0 0 1-.174-.401q0-.234.174-.401a.6.6 0 0 1 .422-.167.58.58 0 0 1 .419.167.53.53 0 0 1 .178.401q0 .234-.178.401a.58.58 0 0 1-.419.167m4.319.909v.71h-2.826v-.71zm-2.002-1.307h.838v5.199q0 .355.103.533a.53.53 0 0 0 .27.234q.167.057.351.057.138 0 .227-.014l.142-.029.171.753a1.6 1.6 0 0 1-.238.064 1.7 1.7 0 0 1-.387.036q-.355 0-.696-.153a1.4 1.4 0 0 1-.561-.465q-.22-.313-.22-.789zm5.491 6.875q-.787 0-1.36-.348a2.34 2.34 0 0 1-.877-.98q-.305-.632-.305-1.47t.305-1.477q.31-.644.86-1.002.554-.362 1.292-.362.426 0 .842.142.416.143.756.462.342.316.544.838t.202 1.285v.355h-4.205v-.724h3.353q0-.462-.185-.824a1.4 1.4 0 0 0-.518-.572 1.46 1.46 0 0 0-.789-.209 1.5 1.5 0 0 0-.866.249 1.6 1.6 0 0 0-.558.639q-.195.393-.195.845v.483q0 .618.213 1.047.216.427.6.65.384.22.891.22.33 0 .597-.092.27-.096.465-.284a1.3 1.3 0 0 0 .302-.476l.81.227a1.8 1.8 0 0 1-.43.725q-.302.309-.746.483-.443.17-.998.17m4.145-.057a.61.61 0 0 1-.451-.188.61.61 0 0 1-.189-.451q0-.262.189-.451a.62.62 0 0 1 .451-.188q.262 0 .451.188a.62.62 0 0 1 .188.451.66.66 0 0 1-.32.554.6.6 0 0 1-.319.085m2.754 0a.61.61 0 0 1-.451-.188.61.61 0 0 1-.189-.451q0-.262.189-.451a.62.62 0 0 1 .451-.188q.262 0 .451.188a.62.62 0 0 1 .188.451.66.66 0 0 1-.32.554.6.6 0 0 1-.319.085m2.753 0a.61.61 0 0 1-.451-.188.62.62 0 0 1-.188-.451q0-.262.188-.451a.62.62 0 0 1 .451-.188q.264 0 .451.188a.62.62 0 0 1 .189.451.66.66 0 0 1-.32.554.6.6 0 0 1-.32.085"})),rt||(rt=n.createElement("path",{fill:"#D40101",d:"M362.322 245.635a2.8 2.8 0 0 0 0-5.6zm-96.363-4.78a2.8 2.8 0 0 0 0 3.96l17.819 17.819a2.801 2.801 0 0 0 3.96-3.96l-15.839-15.839 15.839-15.839a2.8 2.8 0 1 0-3.96-3.96zm96.363 1.98v-2.8h-94.383v5.6h94.383z"})))};class lt extends n.Component{constructor(e){super(e),this.bindCallbacks()}bindCallbacks(){this.handleExtensionNotInstalledClick=this.handleExtensionNotInstalledClick.bind(this)}handleExtensionNotInstalledClick(){this.props.onExtensionNotDownloaded()}render(){const e=window.matchMedia("(prefers-color-scheme: dark)").matches;return n.createElement("div",{className:"install-extension"},n.createElement("h1",null,n.createElement(I.x,null,"Allow the extension on every website.")),n.createElement("p",null,n.createElement(I.x,null,"Once the extension is installed, it must be allowed on every website, otherwise it won't work as expected."," ",n.createElement("a",{href:"https://www.passbolt.com/docs/safari-onboarding",rel:"noopener noreferrer",target:"_blank"},"Learn more"))),e?n.createElement(ot,null):n.createElement(Ge,null),n.createElement("div",{className:"form-actions"},n.createElement("p",null,n.createElement(I.x,null,"Click on ",n.createElement("span",{className:"passbolt-logo"},"@"),' in the toolbar and select "',n.createElement("strong",null,"Always allow on every website…"),'"')),n.createElement("button",{className:"link",type:"button",onClick:this.handleExtensionNotInstalledClick},n.createElement(I.x,null,"I didn't install the extension"))))}}lt.propTypes={context:c().any,onExtensionNotDownloaded:c().func};const ct=a((0,P.C)("common")(lt));class dt extends n.Component{componentDidMount(){this.initializeSetup()}initializeSetup(){setTimeout(()=>this.props.apiSetupContext.onInitializeSetupRequested(),1e3)}render(){switch(this.props.apiSetupContext.state){case N.INSTALL_EXTENSION_STATE:return n.createElement($,null);case N.INSTALL_SAFARI_EXTENSION_STATE:return n.createElement(ue,{onExtensionDownloading:this.props.apiSetupContext.handleSafariExtensionDownloading,onExtensionAlreadyInstalled:this.props.apiSetupContext.handleExtensionAlreadyInstalled});case N.CONFIGURE_SAFARI_EXTENSION_STATE:return n.createElement(ct,{onExtensionNotDownloaded:this.props.apiSetupContext.handleSafariExtensionNotDownloaded});case N.DOWNLOAD_SUPPORTED_BROWSER_STATE:return n.createElement(K,null);case N.TOKEN_EXPIRED_STATE:return n.createElement(H,null);case N.ERROR_ALREADY_SIGNED_IN_STATE:return n.createElement(J,{onLogoutButtonClick:this.props.apiSetupContext.logoutUserAndRefresh,displayAs:W});case N.REQUEST_INVITATION_ERROR:return n.createElement(j,null);case N.UNEXPECTED_ERROR_STATE:return n.createElement(ae,{error:this.props.apiSetupContext.unexpectedError});default:return n.createElement(L,null)}}}dt.propTypes={apiSetupContext:c().object};const ht=q(dt);var pt;function ut(){return ut=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)({}).hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},ut.apply(null,arguments)}const mt=function(e){return n.createElement("svg",ut({xmlns:"http://www.w3.org/2000/svg",width:17,height:16,fill:"none",viewBox:"0 0 17 16"},e),pt||(pt=n.createElement("g",{clipPath:"url(#heart_svg__clip0_93_734678)"},n.createElement("path",{stroke:"var(--icon-color)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M13.497 9.333c.993-.973 2-2.14 2-3.666A3.667 3.667 0 0 0 11.83 2c-1.173 0-2 .333-3 1.333-1-1-1.827-1.333-3-1.333a3.667 3.667 0 0 0-3.667 3.667c0 1.533 1 2.7 2 3.666L8.83 14z"}))))};class gt extends n.Component{render(){return n.createElement("div",{className:"tooltip",tabIndex:"0"},this.props.children,n.createElement("span",{className:`tooltip-text ${this.props.direction}`},this.props.message))}}gt.defaultProps={direction:"right"},gt.propTypes={children:c().any,message:c().any.isRequired,direction:c().string};const Et=gt;var yt=s(28097),ft=s(44296);const bt=n.createContext({dialogs:[],open:()=>{},close:()=>{}});class vt extends n.Component{constructor(e){super(e),this.state=this.defaultState}get defaultState(){return{dialogs:[],open:(e,t)=>{const s=(0,ft.A)();return this.setState(n=>({dialogs:[...n.dialogs,{key:s,Dialog:e,DialogProps:t}]})),s},close:e=>{this.setState(t=>({dialogs:t.dialogs.filter(t=>e!==t.key)}))},closeAll:()=>this.setState({dialogs:[]})}}render(){return n.createElement(bt.Provider,{value:this.state},this.props.children)}}function St(e){return class extends n.Component{render(){return n.createElement(bt.Consumer,null,t=>n.createElement(e,{dialogContext:t,...this.props}))}}}vt.displayName="DialogContextProvider",vt.propTypes={children:c().any};var Tt=s(75410);const wt=["/app/administration","/app/administration/mfa","/app/administration/mfa-policy","/app/administration/password-policies","/app/administration/secret-history","/app/administration/self-registration","/app/administration/users-directory","/app/administration/healthcheck","/app/administration/email-notification","/app/administration/smtp-settings","/app/administration/subscription","/app/administration/ce-downgrade","/app/administration/internationalization","/app/administration/account-recovery","/app/administration/sso","/app/administration/rbacs","/app/administration/content-types/metadata-getting-started","/app/administration/user-provisionning/scim","/app/administration/user-passphrase-policies","/app/administration/password-expiry","/app/administration/content-types/metadata","/app/administration/content-types/metadata-key","/app/administration/migrate-metadata","/app/administration/allow-content-types","/app/administration/subscription-teasing","/app/administration/password-policies-teasing","/app/administration/user-passphrase-policies-teasing","/app/administration/account-recovery-teasing","/app/administration/sso-teasing","/app/administration/mfa-policy-teasing","/app/administration/users-directory-teasing","/app/administration/scim-teasing","/app/administration/offline","/app/passwords","/app/users","/app/settings/profile","/app/settings/passphrase","/app/settings/security-token","/app/settings/theme","/app/settings/mfa","/app/settings/keys","/app/settings/mobile","/app/settings/desktop","/app/settings/account-recovery"],xt=n.createContext({onGoToAdministrationRequested:()=>{},onGoToAdministrationSelfRegistrationRequested:()=>{},onGoToAdministrationMfaRequested:()=>{},onGoToAdministrationUsersDirectoryRequested:()=>{},onGoToAdministrationEmailNotificationsRequested:()=>{},onGoToAdministrationSubscriptionRequested:()=>{},onGoToAdministrationDowngradeToCeRequested:()=>{},onGoToAdministrationInternationalizationRequested:()=>{},onGoToAdministrationAccountRecoveryRequested:()=>{},onGoToAdministrationSmtpSettingsRequested:()=>{},onGoToAdministrationSsoRequested:()=>{},onGoToAdministrationPasswordPoliciesRequested:()=>{},onGoToAdministrationSecretHistoryRequested:()=>{},onGoToAdministrationUserPassphrasePoliciesRequested:()=>{},onGoToAdministrationPasswordExpirySettingsRequested:()=>{},onGoToAdministrationHealthcheckRequested:()=>{},onGoToPasswordsRequested:()=>{},onGoToUsersRequested:()=>{},onGoToTermsRequested:()=>{},onGoToHelpRequested:()=>{},onGoToUserSettingsProfileRequested:()=>{},onGoToUserSettingsPassphraseRequested:()=>{},onGoToUserSettingsSecurityTokenRequested:()=>{},onGoToUserSettingsThemeRequested:()=>{},onGoToUserSettingsMfaRequested:()=>{},onGoToUserSettingsKeysRequested:()=>{},onGoToUserSettingsMobileRequested:()=>{},onGoToUserSettingsDesktopRequested:()=>{},onGoToUserSettingsAccountRecoveryRequested:()=>{},onGoToSubscriptionUpdateQuantityRequested:()=>{},onGoToSubscriptionRenewRequested:()=>{},onGoToAdministrationRbacsRequested:()=>{},onGoToAdministrationMigrateMetadataRequested:()=>{},onGoToAdministrationAllowContentTypesRequested:()=>{},onGoToAdministrationMetadataGettingStartedRequested:()=>{},onGoToAdministrationSubscriptionRequestedTeasing:()=>{},onGoToAdministrationPasswordPoliciesRequestedTeasing:()=>{},onGoToAdministrationUserPassphrasePoliciesRequestedTeasing:()=>{},onGoToAdministrationAccountRecoveryRequestedTeasing:()=>{},onGoToAdministrationSsoRequestedTeasing:()=>{},onGoToAdministrationMfaPolicyRequestedTeasing:()=>{},onGoToAdministrationUsersDirectoryRequestedTeasing:()=>{},onGoToAdministrationScimRequestedTeasing:()=>{},onGoToAdministrationScimRequested:()=>{},onGoToAdministrationOfflineRequested:()=>{}});class At extends n.Component{constructor(e){super(e),this.state=this.defaultState}get defaultState(){return{onGoToAdministrationRequested:this.onGoToAdministrationRequested.bind(this),onGoToAdministrationMfaRequested:this.onGoToAdministrationMfaRequested.bind(this),onGoToAdministrationUsersDirectoryRequested:this.onGoToAdministrationUsersDirectoryRequested.bind(this),onGoToAdministrationEmailNotificationsRequested:this.onGoToAdministrationEmailNotificationsRequested.bind(this),onGoToAdministrationSubscriptionRequested:this.onGoToAdministrationSubscriptionRequested.bind(this),onGoToAdministrationDowngradeToCeRequested:this.onGoToAdministrationDowngradeToCeRequested.bind(this),onGoToAdministrationInternationalizationRequested:this.onGoToAdministrationInternationalizationRequested.bind(this),onGoToAdministrationAccountRecoveryRequested:this.onGoToAdministrationAccountRecoveryRequested.bind(this),onGoToAdministrationSmtpSettingsRequested:this.onGoToAdministrationSmtpSettingsRequested.bind(this),onGoToAdministrationSelfRegistrationRequested:this.onGoToAdministrationSelfRegistrationRequested.bind(this),onGoToAdministrationSsoRequested:this.onGoToAdministrationSsoRequested.bind(this),onGoToAdministrationMfaPolicyRequested:this.onGoToAdministrationMfaPolicyRequested.bind(this),onGoToAdministrationPasswordPoliciesRequested:this.onGoToAdministrationPasswordPoliciesRequested.bind(this),onGoToAdministrationSecretHistoryRequested:this.onGoToAdministrationSecretHistoryRequested.bind(this),onGoToAdministrationUserPassphrasePoliciesRequested:this.onGoToAdministrationUserPassphrasePoliciesRequested.bind(this),onGoToAdministrationPasswordExpirySettingsRequested:this.onGoToAdministrationPasswordExpirySettingsRequested.bind(this),onGoToAdministrationHealthcheckRequested:this.onGoToAdministrationHealthcheckRequested.bind(this),onGoToAdministrationContentTypesEncryptedMetadataRequested:this.onGoToAdministrationContentTypesEncryptedMetadataRequested.bind(this),onGoToAdministrationContentTypesMetadataKeyRequested:this.onGoToAdministrationContentTypesMetadataKeyRequested.bind(this),onGoToAdministrationMigrateMetadataRequested:this.onGoToAdministrationMigrateMetadataRequested.bind(this),onGoToAdministrationAllowContentTypesRequested:this.onGoToAdministrationAllowContentTypesRequested.bind(this),onGoToPasswordsRequested:this.onGoToPasswordsRequested.bind(this),onGoToUsersRequested:this.onGoToUsersRequested.bind(this),onGoToHelpRequested:this.onGoToHelpRequested.bind(this),onGoToTermsRequested:this.onGoToTermsRequested.bind(this),onGoToUserSettingsProfileRequested:this.onGoToUserSettingsProfileRequested.bind(this),onGoToUserSettingsPassphraseRequested:this.onGoToUserSettingsPassphraseRequested.bind(this),onGoToUserSettingsSecurityTokenRequested:this.onGoToUserSettingsSecurityTokenRequested.bind(this),onGoToUserSettingsThemeRequested:this.onGoToUserSettingsThemeRequested.bind(this),onGoToUserSettingsMfaRequested:this.onGoToUserSettingsMfaRequested.bind(this),onGoToUserSettingsKeysRequested:this.onGoToUserSettingsKeysRequested.bind(this),onGoToUserSettingsMobileRequested:this.onGoToUserSettingsMobileRequested.bind(this),onGoToUserSettingsDesktopRequested:this.onGoToUserSettingsDesktopRequested.bind(this),onGoToUserSettingsAccountRecoveryRequested:this.onGoToUserSettingsAccountRecoveryRequested.bind(this),onGoToSubscriptionUpdateQuantityRequested:this.onGoToSubscriptionUpdateQuantityRequested.bind(this),onGoToSubscriptionRenewRequested:this.onGoToSubscriptionRenewRequested.bind(this),onGoToAdministrationRbacsRequested:this.onGoToAdministrationRbacsRequested.bind(this),onGoToAdministrationMetadataGettingStartedRequested:this.onGoToAdministrationMetadataGettingStartedRequested.bind(this),onGoToAdministrationSubscriptionRequestedTeasing:this.onGoToAdministrationSubscriptionRequestedTeasing.bind(this),onGoToAdministrationPasswordPoliciesRequestedTeasing:this.onGoToAdministrationPasswordPoliciesRequestedTeasing.bind(this),onGoToAdministrationUserPassphrasePoliciesRequestedTeasing:this.onGoToAdministrationUserPassphrasePoliciesRequestedTeasing.bind(this),onGoToAdministrationAccountRecoveryRequestedTeasing:this.onGoToAdministrationAccountRecoveryRequestedTeasing.bind(this),onGoToAdministrationSsoRequestedTeasing:this.onGoToAdministrationSsoRequestedTeasing.bind(this),onGoToAdministrationMfaPolicyRequestedTeasing:this.onGoToAdministrationMfaPolicyRequestedTeasing.bind(this),onGoToAdministrationUsersDirectoryRequestedTeasing:this.onGoToAdministrationUsersDirectoryRequestedTeasing.bind(this),onGoToAdministrationScimRequestedTeasing:this.onGoToAdministrationScimRequestedTeasing.bind(this),onGoToAdministrationScimRequested:this.onGoToAdministrationScimRequested.bind(this),onGoToAdministrationOfflineRequested:this.onGoToAdministrationOfflineRequested.bind(this)}}async goTo(e,t){if(!wt.includes(t))throw new Error("The pathname is not part of the allowed list of pathnames.");if(e===this.props.context.name)return void await this.props.history.push({pathname:t});if("api"===e)return void await this.props.context.port.request("passbolt.tabs.open-admin-page",t);const s=`${this.props.context.userSettings?this.props.context.userSettings.getTrustedDomain():this.props.context.trustedDomain}${t}`;window.open(s,"_parent","noopener,noreferrer")}async onGoToAdministrationRequested(){await this.goTo("browser-extension","/app/administration")}async onGoToAdministrationMfaRequested(){await this.goTo("api","/app/administration/mfa")}async onGoToAdministrationMfaPolicyRequested(){await this.goTo("api","/app/administration/mfa-policy")}async onGoToAdministrationPasswordPoliciesRequested(){await this.goTo("browser-extension","/app/administration/password-policies")}async onGoToAdministrationSecretHistoryRequested(){await this.goTo("browser-extension","/app/administration/secret-history")}async onGoToAdministrationOfflineRequested(){await this.goTo("browser-extension","/app/administration/offline")}async onGoToAdministrationSelfRegistrationRequested(){await this.goTo("api","/app/administration/self-registration")}async onGoToAdministrationUsersDirectoryRequested(){await this.goTo("api","/app/administration/users-directory")}async onGoToAdministrationHealthcheckRequested(){await this.goTo("api","/app/administration/healthcheck")}async onGoToAdministrationEmailNotificationsRequested(){await this.goTo("api","/app/administration/email-notification")}async onGoToAdministrationSmtpSettingsRequested(){await this.goTo("api","/app/administration/smtp-settings")}async onGoToAdministrationSubscriptionRequested(){await this.goTo("browser-extension","/app/administration/subscription")}async onGoToAdministrationDowngradeToCeRequested(){await this.goTo("browser-extension","/app/administration/ce-downgrade")}async onGoToAdministrationInternationalizationRequested(){await this.goTo("api","/app/administration/internationalization")}async onGoToAdministrationAccountRecoveryRequested(){await this.goTo("browser-extension","/app/administration/account-recovery")}async onGoToAdministrationSsoRequested(){await this.goTo("browser-extension","/app/administration/sso")}async onGoToAdministrationRbacsRequested(){await this.goTo("api","/app/administration/rbacs")}async onGoToAdministrationMetadataGettingStartedRequested(){await this.goTo("browser-extension","/app/administration/content-types/metadata-getting-started")}async onGoToAdministrationScimRequested(){await this.goTo("browser-extension","/app/administration/user-provisionning/scim")}async onGoToAdministrationUserPassphrasePoliciesRequested(){await this.goTo("browser-extension","/app/administration/user-passphrase-policies")}async onGoToAdministrationPasswordExpirySettingsRequested(){await this.goTo("browser-extension","/app/administration/password-expiry")}async onGoToAdministrationContentTypesEncryptedMetadataRequested(){await this.goTo("browser-extension","/app/administration/content-types/metadata")}async onGoToAdministrationContentTypesMetadataKeyRequested(){await this.goTo("browser-extension","/app/administration/content-types/metadata-key")}async onGoToAdministrationMigrateMetadataRequested(){await this.goTo("browser-extension","/app/administration/migrate-metadata")}async onGoToAdministrationAllowContentTypesRequested(){await this.goTo("browser-extension","/app/administration/allow-content-types")}async onGoToAdministrationSubscriptionRequestedTeasing(){await this.goTo("browser-extension","/app/administration/subscription-teasing")}async onGoToAdministrationPasswordPoliciesRequestedTeasing(){await this.goTo("browser-extension","/app/administration/password-policies-teasing")}async onGoToAdministrationUserPassphrasePoliciesRequestedTeasing(){await this.goTo("browser-extension","/app/administration/user-passphrase-policies-teasing")}async onGoToAdministrationAccountRecoveryRequestedTeasing(){await this.goTo("browser-extension","/app/administration/account-recovery-teasing")}async onGoToAdministrationSsoRequestedTeasing(){await this.goTo("browser-extension","/app/administration/sso-teasing")}async onGoToAdministrationMfaPolicyRequestedTeasing(){await this.goTo("browser-extension","/app/administration/mfa-policy-teasing")}async onGoToAdministrationUsersDirectoryRequestedTeasing(){await this.goTo("browser-extension","/app/administration/users-directory-teasing")}async onGoToAdministrationScimRequestedTeasing(){await this.goTo("browser-extension","/app/administration/scim-teasing")}get isMfaEnabled(){const e=this.props.context.siteSettings;return e&&e.canIUse("multiFactorAuthentication")}get isUserDirectoryEnabled(){const e=this.props.context.siteSettings;return e&&e.canIUse("directorySync")}get isSmtpSettingsEnable(){const e=this.props.context.siteSettings;return e&&e.canIUse("smtpSettings")}get isSelfRegistrationEnable(){const e=this.props.context.siteSettings;return e&&e.canIUse("selfRegistration")}get isPasswordPoliciesEnable(){const e=this.props.context.siteSettings;return e&&e.canIUse("passwordPoliciesUpdate")}get isUserPassphrasePoliciesEnable(){const e=this.props.context.siteSettings;return e&&e.canIUse("userPassphrasePolicies")}get isPasswordExpiryEnable(){const e=this.props.context.siteSettings;return e&&e.canIUse("passwordExpiry")}async onGoToPasswordsRequested(){await this.goTo("browser-extension","/app/passwords")}async onGoToUsersRequested(){await this.goTo("browser-extension","/app/users")}async onGoToHelpRequested(){window.open("https://www.passbolt.com/docs/","_blank","noopener,noreferrer")}async onGoToTermsRequested(){window.open("https://www.passbolt.com/terms","_blank","noopener,noreferrer")}async onGoToSubscriptionUpdateQuantityRequested(e,t){const s=`https://www.passbolt.com/subscription/ee/update/qty?subscription_id=${encodeURIComponent(e)}&customer_id=${encodeURIComponent(t)}`;window.open(s,"_blank","noopener,noreferrer")}async onGoToSubscriptionRenewRequested(e,t){const s=`https://www.passbolt.com/subscription/ee/update/renew?subscription_id=${encodeURIComponent(e)}&customer_id=${encodeURIComponent(t)}`;window.open(s,"_blank","noopener,noreferrer")}async onGoToUserSettingsProfileRequested(){await this.goTo("browser-extension","/app/settings/profile")}async onGoToUserSettingsPassphraseRequested(){await this.goTo("browser-extension","/app/settings/passphrase")}async onGoToUserSettingsSecurityTokenRequested(){await this.goTo("browser-extension","/app/settings/security-token")}async onGoToUserSettingsThemeRequested(){await this.goTo("browser-extension","/app/settings/theme")}async onGoToUserSettingsMfaRequested(){await this.goTo("browser-extension","/app/settings/mfa")}async onGoToUserSettingsKeysRequested(){await this.goTo("browser-extension","/app/settings/keys")}async onGoToUserSettingsMobileRequested(){await this.goTo("browser-extension","/app/settings/mobile")}async onGoToUserSettingsDesktopRequested(){await this.goTo("browser-extension","/app/settings/desktop")}async onGoToUserSettingsAccountRecoveryRequested(){await this.goTo("browser-extension","/app/settings/account-recovery")}render(){return n.createElement(xt.Provider,{value:this.state},this.props.children)}}At.displayName="NavigationContextProvider",At.propTypes={context:c().object,children:c().any,location:c().object,match:c().object,history:c().object},(0,Tt.withRouter)(a(At));const Ct=n.createContext({counter:[],add:()=>{},remove:()=>{}});class Rt extends n.Component{constructor(e){super(e),this.state=this.defaultState}get defaultState(){return{counter:0,add:()=>{this.setState(e=>({counter:e.counter+1}))},remove:()=>{this.setState(e=>({counter:Math.min(e.counter-1,0)}))}}}render(){return n.createElement(Ct.Provider,{value:this.state},this.props.children)}}Rt.propTypes={children:c().any};class qt{}class Nt extends qt{static execute(){return!0}}class kt extends qt{static execute(){return!1}}const _t="Folders.use",Ot="Administration.viewWorkspace",It="GroupsAdd.addPost",Pt="AccountRecoveryRequestsView.view",Dt="AccountRecoveryRequestsIndex.index",Ut="AccountRecoveryResponsesCreate.post",Gt="Allow",Lt="Deny",Mt="AllowIfGroupManagerInOneGroup",Ft={[Gt]:Nt,[Lt]:kt,[Mt]:class extends qt{static execute(e){return e.groups_users.some(e=>e.is_admin)}}},$t={[_t]:Ft[Gt]},Vt={[Ot]:Ft[Lt],[It]:Ft[Lt],[Pt]:Ft[Lt],[Dt]:Ft[Lt],[Ut]:Ft[Lt]};class Kt{static getByRbac(e){return Ft[e.controlFunction]||(console.warn(`Could not find control function for the given rbac entity (${e.id})`),kt)}static getDefaultForAdminAndAction(e){return $t[e]||Nt}static getDefaultForUserAndAction(e){return Vt[e]||Nt}}class Bt extends Error{constructor(e="Collection validation error."){super(e),this.name="CollectionValidationError",this.errors=[]}addItemValidationError(e,t){if(!Number.isInteger(e))throw new TypeError('CollectionValidationError::addEntityValidationError expects "position" to be an integer.');if(!(t instanceof Ht||t instanceof Bt))throw new TypeError('CollectionValidationError::addEntityValidationError expects "entityValidationError" to be an instance of EntityValidationError or CollectionValidationError.');this.errors[e]=t}addCollectionValidationError(e,t){if("string"!=typeof e)throw new TypeError('CollectionValidationError::addCollectionValidationError expects "rule" to be a string.');if("string"!=typeof t)throw new TypeError('CollectionValidationError::addCollectionValidationError expects "error" to be a string.');this.errors[e]=t}hasErrors(){return this.errors.some(e=>Object.keys(e.details).length>0)}get details(){const e={};for(const t in this.errors)this.errors[t]instanceof Ht||this.errors[t]instanceof Bt?e[t]=this.errors[t].details:e[t]=this.errors[t];return e}}const jt=Bt;class zt extends Error{constructor(e="Entity validation error."){super(e),this.name="EntityValidationError",this.details={}}addError(e,t,s){if("string"!=typeof e)throw new TypeError("EntityValidationError addError property should be a string.");if("string"!=typeof t)throw new TypeError("EntityValidationError addError rule should be a string.");if("string"!=typeof s)throw new TypeError("EntityValidationError addError message should be a string.");Object.prototype.hasOwnProperty.call(this.details,e)||(this.details[e]={}),this.details[e][t]=s}addAssociationError(e,t){if("string"!=typeof e)throw new TypeError("EntityValidationError addAssociationError associationName should be a string.");if(!(t instanceof zt||t instanceof jt))throw new TypeError("EntityValidationError addAssociationError errorDetails should be an object.");this.details[e]=t}getError(e,t){if(!this.hasError(e,t))return null;const s=this.details[e];return t?s[t]:s}hasError(e,t){if("string"!=typeof e)throw new TypeError("EntityValidationError hasError property should be a string.");const s=this.details&&Object.prototype.hasOwnProperty.call(this.details,e);if(!s)return!1;if(!t)return s;if("string"!=typeof t)throw new TypeError("EntityValidationError hasError rule should be a string.");return Object.prototype.hasOwnProperty.call(this.details[e],t)}hasErrors(){return Object.keys(this.details).length>0}getFirstRuleErrorByField(e){if(!this.hasError(e))return null;const t=this.details[e];return t[Object.keys(t)[0]]}}const Ht=zt;var Wt=s(57761),Yt=s.n(Wt);class Zt{static validateSchema(e,t){if(!t)throw new TypeError(`Could not validate entity ${e}. No schema for entity ${e}.`);if(!t.type)throw new TypeError(`Could not validate entity ${e}. Type missing.`);if("array"!==t.type){if("object"===t.type){if(!t.required||!Array.isArray(t.required))throw new TypeError(`Could not validate entity ${e}. Schema error: no required properties.`);if(!t.properties||!Object.keys(t).length)throw new TypeError(`Could not validate entity ${e}. Schema error: no properties.`);const s=t.properties;for(const e in s){if(!Object.prototype.hasOwnProperty.call(s,e)||!s[e].type&&!s[e].anyOf)throw TypeError(`Invalid schema. Type missing for ${e}...`);if(s[e].anyOf&&(!Array.isArray(s[e].anyOf)||!s[e].anyOf.length))throw new TypeError(`Invalid schema, prop ${e} anyOf should be an array`)}}}else if(!t.items)throw new TypeError(`Could not validate entity ${e}. Schema error: missing item definition.`)}static validate(e,t,s){if(!e||!t||!s)throw new TypeError(`Could not validate entity ${e}. No data provided.`);switch(s.type){case"object":return Zt.validateObject(e,t,s);case"array":return Zt.validateArray(e,t,s);default:throw new TypeError(`Could not validate entity ${e}. Unsupported type.`)}}static validateArray(e,t,s){let n;const i=Zt.validateProp("items",t,s);if("number"==typeof s.minItems&&(Zt.isGreaterThanOrEqual(t.length,s.minItems)||(n=Zt.handleCollectionValidationError("minItems",`The items array should contain at least ${s.minItems} item(s).`,n))),"number"==typeof s.maxItems&&(Zt.isLessThanOrEqual(t.length,s.maxItems)||(n=Zt.handleCollectionValidationError("maxItems",`The items array should contain at maximum ${s.maxItems} item(s).`,n))),n)throw n;return i}static validateObject(e,t,s){const n=s.required,i=s.properties,r={};let a;for(const s in i)if(Object.prototype.hasOwnProperty.call(i,s))if(null!==t?.[s]||!0!==i[s]?.nullable){if(n.includes(s)){if(!Object.prototype.hasOwnProperty.call(t,s)){a=Zt.getOrInitEntityValidationError(e,a),a.addError(s,"required",`The ${s} is required.`);continue}}else if(!Object.prototype.hasOwnProperty.call(t,s))continue;try{r[s]=Zt.validateProp(s,t[s],i[s])}catch(t){if(!(t instanceof Ht))throw t;a=Zt.getOrInitEntityValidationError(e,a),a.details[s]=t.details[s]}}else r[s]=null;if(a)throw a;return r}static getOrInitEntityValidationError(e,t){return t||new Ht(`Could not validate entity ${e}.`)}static validateProp(e,t,s){if(s.anyOf)return Zt.validateAnyOf(e,t,s.anyOf),t;if(!0===s.nullable&&null===t)return t;if(Zt.validatePropType(e,t,s),s.enum)return Zt.validatePropEnum(e,t,s),t;switch(s.type){case"string":Zt.validatePropTypeString(e,t,s);break;case"integer":case"number":Zt.validatePropTypeNumber(e,t,s);break;case"array":Zt.validatePropTypeArray(e,t,s);break;case"object":case"boolean":case"blob":case"null":break;case"x-custom":Zt.validatePropCustom(e,t,s);break;default:throw new TypeError(`Could not validate property ${e}. Unsupported prop type ${s.type}`)}return t}static validatePropType(e,t,s){if(!Zt.isValidPropType(t,s.type))throw Zt.handlePropertyValidationError(e,"type",`The ${e} is not a valid ${s.type}.`)}static validatePropCustom(e,t,s){try{s.validationCallback(t)}catch(t){throw Zt.handlePropertyValidationError(e,"custom",`The ${e} is not valid: ${t.message}`)}}static validatePropTypeString(e,t,s){let n;if(s.format&&(Zt.isValidStringFormat(t,s.format)||(n=Zt.handlePropertyValidationError(e,"format",`The ${e} is not a valid ${s.format}.`,n))),s.length&&(Zt.isValidStringLength(t,s.length,s.length)||(n=Zt.handlePropertyValidationError(e,"length",`The ${e} should be ${s.length} character in length.`,n))),s.minLength&&(Zt.isValidStringLength(t,s.minLength)||(n=Zt.handlePropertyValidationError(e,"minLength",`The ${e} should be ${s.minLength} character in length minimum.`,n))),s.maxLength&&(Zt.isValidStringLength(t,0,s.maxLength)||(n=Zt.handlePropertyValidationError(e,"maxLength",`The ${e} should be ${s.maxLength} character in length maximum.`,n))),s.pattern&&(Yt().matches(t,s.pattern)||(n=Zt.handlePropertyValidationError(e,"pattern",`The ${e} is not valid.`,n))),s.custom&&(s.custom(t)||(n=Zt.handlePropertyValidationError(e,"custom",`The ${e} is not valid.`,n))),n)throw n}static handlePropertyValidationError(e,t,s,n=null){return(n=n||new Ht(`Could not validate property ${e}.`)).addError(e,t,s),n}static handleCollectionValidationError(e,t,s=null){return(s=s||new jt("Could not validate collection.")).addCollectionValidationError(e,t),s}static validatePropTypeNumber(e,t,s){let n;if("number"==typeof s.minimum&&(Zt.isGreaterThanOrEqual(t,s.minimum)||(n=Zt.handlePropertyValidationError(e,"minimum",`The ${e} should be greater or equal to ${s.minimum}.`,n))),"number"==typeof s.maximum&&(Zt.isLesserThanOrEqual(t,s.maximum)||(n=Zt.handlePropertyValidationError(e,"maximum",`The ${e} should be lesser or equal to ${s.maximum}.`,n))),n)throw n}static validatePropTypeArray(e,t,s){let n;if(s?.items&&"object"==typeof s.items){for(let i=0;i<t.length;i++){const r=`${e}.${i}`;try{this.validateProp(r,t[i],s.items)}catch(t){if(!(t instanceof Ht))throw t;{n=Zt.getOrInitEntityValidationError(e,n);const s=t.details[r];n.details[e]={...n.details[e],[i]:s}}}}if(n)throw n}}static validatePropEnum(e,t,s){if(!Zt.isPropInEnum(t,s.enum)){const t=new Ht(`Could not validate property ${e}.`);throw t.addError(e,"enum",`The ${e} value is not included in the supported list.`),t}}static validateAnyOf(e,t,s){for(let n=0;n<s.length;n++)try{return void Zt.validateProp(e,t,s[n])}catch{}const n=new Ht(`Could not validate property ${e}.`);throw n.addError(e,"type",`The ${e} does not match any of the supported types.`),n}static isValidPropType(e,t){if(Array.isArray(t))throw new TypeError("EntitySchema isValidPropType multiple types are not supported.");if("string"!=typeof t)throw new TypeError("EntitySchema isValidPropType type is invalid.");switch(t){case"null":return null===e;case"boolean":return"boolean"==typeof e;case"string":return"string"==typeof e;case"integer":return Number.isInteger(e);case"number":return"number"==typeof e;case"object":return"object"==typeof e;case"array":return Array.isArray(e);case"blob":return e instanceof Blob;case"x-custom":return!0;default:throw new TypeError("EntitySchema validation type not supported.")}}static isValidStringFormat(e,t){if("string"!=typeof t)throw new TypeError("EntitySchema validPropFormat format is invalid.");switch(t){case"uuid":return Yt().isUUID(e);case"email":case"idn-email":return Yt().isEmail(e);case"date-time":return Yt().isISO8601(e);case"x-hex-color":return Yt().isHexColor(e);case"x-base64":return Yt().isBase64(e);default:throw new TypeError(`EntitySchema string validation format ${t} is not supported.`)}}static isValidStringLength(e,t,s){return t=t||0,Yt().isLength(e,t,s)}static isPropInEnum(e,t){if(!t||!Array.isArray(t)||!t.length)throw new TypeError("EntitySchema enum schema cannot be empty.");return t.includes(e)}static isGreaterThanOrEqual(e,t){return e>=t}static isLessThanOrEqual(e,t){return e<=t}static isLesserThanOrEqual(e,t){return e<=t}}const Xt=Zt;class Jt{constructor(e,t={}){(t?.clone??!0)&&(e=JSON.parse(JSON.stringify(e))),this._props=e}toDto(){return JSON.parse(JSON.stringify(this))}toJSON(){return this._props}_hasProp(e){if(!e.includes(".")){const t=Jt._normalizePropName(e);return Object.prototype.hasOwnProperty.call(this._props,t)}try{return this._getPropByPath(e),!0}catch(t){return console.error(`Failed to check if property "${e}" is set:`,t),!1}}_getPropByPath(e){return Jt._normalizePropName(e).split(".").reduce((e,t)=>{if(Object.prototype.hasOwnProperty.call(e,t))return e[t];throw new Error},this._props)}static _normalizePropName(e){return e.replace(/([A-Z])/g,(e,t)=>`_${t.toLowerCase()}`).replace(/\._/,".").replace(/^_/,"").replace(/^\./,"")}}const Qt=Jt;var es=s(5648);const ts=e=>e?.replace(/_([a-z])/g,(e,t)=>t.toUpperCase());class ss extends Error{constructor(e,t,s){if(super(s=s||"Entity collection error."),"number"!=typeof e)throw new TypeError("EntityCollectionError requires a valid position");if(!t||"string"!=typeof t)throw new TypeError("EntityCollectionError requires a valid rule");if(!s||"string"!=typeof s)throw new TypeError("EntityCollectionError requires a valid message");this.position=e,this.rule=t}}const ns=ss;class is{constructor(e=[],t={}){const s=t?.clone??!0;this._items=[],s&&(e=JSON.parse(JSON.stringify(e))),this._props=e}toDto(){return JSON.parse(JSON.stringify(this._items))}toJSON(){return this.toDto()}get items(){return this._items}get length(){return this._items.length}[Symbol.iterator](){let e=0;return{next:()=>e<this._items.length?{value:this._items[e++],done:!1}:{done:!0}}}getAll(e,t){if("string"!=typeof e)throw new TypeError("EntityCollection excludeAll expects propName to be string.");if("string"!=typeof t)throw new TypeError("EntityCollection excludeAll expects search to be string.");return this._items.filter(s=>Object.prototype.hasOwnProperty.call(s._props,e)&&s._props[e]===t)}getFirst(e,t){if("string"!=typeof e||"string"!=typeof t)throw new TypeError("EntityCollection getFirst by expect propName and search to be strings");const s=this.getAll(e,t);if(s&&s.length)return s[0]}extract(e){if("string"!=typeof e)throw new TypeError("EntityCollection extract expects propName to be a string.");return this._items.reduce((t,s)=>(void 0!==s._props[e]&&t.push(s._props[e]),t),[])}push(e){return this._items.push(e),this._items.length}unshift(e){return this._items.unshift(e),this._items.length}filterByPropertyValueIn(e,t,s=!0){if("string"!=typeof e)throw new TypeError("EntityCollection filterByPropertyValueIn expects propName to be a string.");if(!Array.isArray(t))throw new TypeError("EntityCollection filterByPropertyValueIn expects needles to be an array.");this.filterByCallback(n=>{const i=Object.prototype.hasOwnProperty.call(n._props,e);return!(s&&!i||i&&!t.includes(n._props[e]))})}filterByCallback(e){if("function"!=typeof e)throw new TypeError("EntityCollection filterByCallback expects callback to be a function.");for(let t=this._items.length-1;t>=0;t--)e(this._items[t])||this._items.splice(t,1)}assertUniqueByProperty(e,t){const s=`unique_${e}`,n=this.extract(e),i=new Set;t=t||`The collection should only contain items with unique values for the property: ${e}.`,n.forEach((e,n)=>{if(i.add(e),n!==i.size-1)throw new ns(n,s,t)})}assertNotExist(e,t,s={}){if(void 0===t)return;let n=s?.haystackSet;if(!n){const t=this.extract(e);n=new Set(t)}if(n.has(t)){const t=new Ht,n=s?.message||`The collection already includes an element that has a property (${e}) with an identical value.`;throw t.addError(e,"unique",n),t}}}const rs=is,as=["string","number","integer","boolean"];class os extends Qt{static _cachedSchema={};constructor(e={},t={}){const s=t?.validate??!0;super(e,t),this.marshall(),s&&this.validateSchema({schema:t?.schema,skipSchemaAssociationValidation:t?.skipSchemaAssociationValidation}),this.createAssociations(t),s&&this.validateBuildRules(t?.validateBuildRules)}marshall(){}validate(e={}){try{this.validateSchema({schema:e?.schema,skipSchemaAssociationValidation:e?.skipSchemaAssociationValidation}),this.validateBuildRules(e?.validateBuildRules),this.validateAssociations(e)}catch(e){if(!(e instanceof Ht))throw e;return e}return null}validateSchema(e=null){let t=e?.schema??this.cachedSchema;if(e?.skipSchemaAssociationValidation){t={...t};const e=Object.keys(this.constructor.associations),s=t.required.filter(t=>!e.includes(t));t.required=s}this._props=Xt.validate(this.constructor.name,this._props,t)}get cachedSchema(){return this.constructor._cachedSchema[this.constructor.name]||(this.constructor._cachedSchema[this.constructor.name]=this.constructor.getSchema()),this.constructor._cachedSchema[this.constructor.name]}static getSchema(){throw new Error("The entity class should declare its schema.")}validateBuildRules(e={}){}createAssociations(e={}){if(Object.keys(this.constructor.associations).length>0){const t=new Ht;for(const[s,n]of Object.entries(this.constructor.associations))try{this._props[s]&&(this[`_${ts(s)}`]=new n(this._props[s],{...e,clone:!1}),delete this._props[s])}catch(e){if(!(e instanceof Ht))throw e;t.addAssociationError(s,e)}if(t.hasErrors())throw t}}static get associations(){return{}}get(e){(0,es.A)(e);const t=this.constructor.getSchema().properties[e];if(!t)throw new Error(`The property "${e}" has no schema definition.`);if(!as.includes(t?.type))throw new Error('The property "associated_entity" should reference scalar properties only.');return this._props[e]}set(e,t,s={}){(0,es.A)(e);const n=s?.validate??!0;if(this.isAssociation(e))this.setAssociation(e,t,s);else{const i=e.split(".")[0],r=this.constructor.getSchema().properties[i];if(!r)throw new Error(`The property "${i}" has no schema definition.`);if("array"===r?.type)this.setArrayProp(e,t,s);else{if(r?.type&&!as.includes(r?.type))throw new Error('The property "associated_entity" should reference scalar properties only.');if(r?.anyOf?.some(e=>!as.includes(e.type)))throw new Error('The property "associated_entity" should reference scalar properties only.');n&&Xt.validateProp(i,t,r),this._props[i]=t}}}setArrayProp(e,t,s){(0,es.A)(e);const n=e.split("."),i=n[0];let r=null;const a=this.constructor.getSchema().properties[i],o=s?.validate??!0;if(2!==n.length)throw new Error(`The property "${n[0]}" has no index passed.`);{const e=n[1].match(/^(\d+)$/);if(!e)throw new Error(`The property "${n[0]}" has an invalid index format. Expected format: digits.`);r=parseInt(e[1],10)}if(!as.includes(a.items.type))throw new Error('The property "associated_entity" with array type should reference scalar properties only.');o&&Xt.validateProp(i,t,a.items),this._props[i]||(this._props[i]=[]),null!=t?this._props[i][r]=t:this._props[i].splice(r,1)}setCollection(e,t,s){(0,es.A)(e);const n=e.split("."),i=n[0];let r=null;if(1===n.length)t instanceof this.constructor.associations[e]?this[`_${i}`]=t:this[`_${i}`]=new this.constructor.associations[e](t,s);else{if(!(n.length>1))throw new Error(`The property "${n[0]}" has no index passed.`);{const e=n[1].match(/^(\d+)$/);if(!e)throw new Error(`The property "${n[0]}" has an invalid index format. Expected format: digits.`);r=parseInt(e[1],10)}}if(!this[`_${i}`])throw new Error(`The collection "${n[0]}" has no item".`);if(null!=t)if(n.length>2){if(!this[`_${i}`]._items[r])throw new Error(`The collection "${n[0]}" has no item at the index "${n[1]}".`);const e=n.slice(2).join(".");this[`_${i}`]._items[r].set(e,t,s)}else this[`_${i}`].push(t,s,s);else this[`_${i}`].items.splice(r,1)}setAssociation(e,t,s={}){if((0,es.A)(e),this.isAssociation(e)){const n=e.split("."),i=ts(n[0]);if(n.length>1)if(this[`_${i}`]||(this[`_${i}`]=new this.constructor.associations[n[0]]({},{validate:!1})),this[`_${i}`]instanceof rs){const e=n.toSpliced(0,1,i).join(".");this.setCollection(e,t,s)}else{const e=n.slice(1).join(".");this[`_${i}`].set(e,t,s)}else t instanceof this.constructor.associations[e]?this[`_${i}`]=t:this[`_${i}`]=new this.constructor.associations[e](t,s)}}validateAssociations(e={}){const t=new Ht;if(Object.keys(this.constructor.associations).length>0&&Object.keys(this.constructor.associations).forEach(s=>{const n=ts(s);if(this[`_${n}`]){const i=this[n].validate(e);i&&t.addAssociationError(s,i)}}),t.hasErrors())throw t}diffProps(e){if(!(e instanceof os))throw new TypeError('The property "compareEntity" should be of "EntityV2" type.');const t={},s=this.constructor.getSchema(),n=Object.keys(s.properties).filter(e=>as.includes(s.properties[e].type));for(const s of n){const n=this.get(s),i=e.get(s);n!==i&&(t[s]=i)}return t}hasDiffProps(e){const t=this.diffProps(e);return Object.keys(t).length>0}isAssociation(e){const t=e.split(".")[0];return Boolean(this.constructor.associations?.[t])}}const ls=os;class cs extends ls{static getSchema(){return{type:"object",required:["name"],properties:{id:{type:"string",format:"uuid"},name:{type:"string",minLength:1,maxLength:50},description:{type:"string",maxLength:255,nullable:!0},created:{type:"string",format:"date-time"},modified:{type:"string",format:"date-time"}}}}validateBuildRules(){this.assertNoTrailingSpaces("name",this._props.name)}get id(){return this._props.id||null}get name(){return this._props.name}isAdmin(){return this.name.toLowerCase()===cs.ROLE_ADMIN}isUser(){return this.name.toLowerCase()===cs.ROLE_USER}isGuest(){return this.name.toLowerCase()===cs.ROLE_GUEST}isAReservedRole(){return this.isAdmin()||this.isUser()||this.isGuest()}verifyHealth(){let e=null;return 50===this.name.length&&(e=new Ht,e.addError("name","maxLength","name reached maximum length limit")),e}assertNoTrailingSpaces(e,t){if(t.trim()!==t){const t=new Ht;throw t.addError(e,"trailing-spaces",`The property (${e}) contains forbidden trailing spaces.`),t}}static get ENTITY_NAME(){return"Role"}static get ROLE_ADMIN(){return"admin"}static get ROLE_USER(){return"user"}static get ROLE_GUEST(){return"guest"}static get ROLE_NAME_MAX_LENGTH(){return 50}toUpdateDto(){return{name:this.name}}}class ds{static canRoleUseAction(e,t,s){if("undefined"!=typeof window&&window.chrome?.webview){const n=t.findRbacByActionName(s);if(n)return Kt.getByRbac(n).execute(e)}const n=new cs(e.role);if(n.isAdmin())return Kt.getDefaultForAdminAndAction(s).execute();const i=t.findRbacByRoleAndActionName(n,s);return this.getByRbacOrDefault(i,s,e)}static getByRbacOrDefault(e,t,s){return e?Kt.getByRbac(e).execute(s):Kt.getDefaultForUserAndAction(t).execute()}}const hs=n.createContext({canIUseAction:()=>{}});class ps extends n.Component{constructor(e){super(e),this.state=this.defaultState}get defaultState(){return{canIUseAction:this.canIUseAction.bind(this)}}canIUseAction(e){return ds.canRoleUseAction(this.props.context.loggedInUser,this.props.context.rbacs,e)}render(){return n.createElement(hs.Provider,{value:this.state},this.props.children)}}ps.propTypes={context:c().any,children:c().any},a(ps);const us=n.createContext({selectedAdministration:null,can:{save:!1},must:{save:!1,editSubscriptionKey:!1,refreshSubscriptionKey:!1},administrationWorkspaceAction:null,setDisplayAdministrationWorkspaceAction:()=>{},resetDisplayAdministrationWorkspaceAction:()=>{},onUpdateSubscriptionKeyRequested:()=>{},onSaveEnabled:()=>{},onMustSaveSettings:()=>{},onMustEditSubscriptionKey:()=>{},onMustRefreshSubscriptionKey:()=>{},onResetActionsSettings:()=>{}});class ms extends n.Component{constructor(e){super(e),this.state=this.defaultState}get defaultState(){return{selectedAdministration:ys.NONE,can:{save:!1},must:{save:!1,editSubscriptionKey:!1,refreshSubscriptionKey:!1},administrationWorkspaceAction:()=>n.createElement(n.Fragment,null),setDisplayAdministrationWorkspaceAction:this.setDisplayAdministrationWorkspaceAction.bind(this),resetDisplayAdministrationWorkspaceAction:this.resetDisplayAdministrationWorkspaceAction.bind(this),onSaveEnabled:this.handleSaveEnabled.bind(this),onMustSaveSettings:this.handleMustSaveSettings.bind(this),onMustEditSubscriptionKey:this.handleMustEditSubscriptionKey.bind(this),onMustRefreshSubscriptionKey:this.handleMustRefreshSubscriptionKey.bind(this),onResetActionsSettings:this.handleResetActionsSettings.bind(this)}}componentDidMount(){this.handleAdministrationMenuRouteChange()}componentDidUpdate(e){this.handleRouteChange(e.location)}handleSaveEnabled(){this.setState({can:{...this.state.can,save:!0}})}handleMustSaveSettings(){this.setState({must:{...this.state.must,save:!0}})}handleMustEditSubscriptionKey(){this.setState({must:{...this.state.must,editSubscriptionKey:!0}})}handleMustRefreshSubscriptionKey(){this.setState({must:{...this.state.must,refreshSubscriptionKey:!0}})}handleResetActionsSettings(){this.setState({must:{save:!1,test:!1,synchronize:!1,editSubscriptionKey:!1,refreshSubscriptionKey:!1}})}handleRouteChange(e){this.props.location.key!==e.key&&this.handleAdministrationMenuRouteChange()}handleAdministrationMenuRouteChange(){const e={can:{save:!1,test:!1,synchronize:!1},must:{save:!1,test:!1,synchronize:!1,editSubscriptionKey:!1,refreshSubscriptionKey:!1}};if(!this.props.rbacContext.canIUseAction(Ot))return e.selectedAdministration=ys.HTTP_403_ACCESS_DENIED,void this.setState(e);const t=this.props.location.pathname,s=bs.homePage.test(t),n=bs.mfa.test(t),i=bs.mfaPolicy.test(t),r=bs.passwordPolicies.test(t),a=bs.usersDirectory.test(t),o=bs.emailNotification.test(t),l=bs.subscription.test(t),c=bs.internationalization.test(t),d=bs.accountRecovery.test(t),h=bs.smtpSettings.test(t),p=bs.selfRegistration.test(t),u=bs.sso.test(t),m=bs.rbac.test(t),g=bs.userPassphrasePolicies.test(t),E=bs.passwordExpirySettings.test(t),y=bs.healthcheck.test(t),f=bs.contentTypesEncryptedMetadata.test(t),b=bs.contentTypesMetadataKey.test(t),v=bs.migrateEncryptedMetadata.test(t),S=bs.allowContentTypes.test(t),T=bs.gettingStarted.test(t),w=bs.scim.test(t),x=bs.secretHistory.test(t),A=bs.ceDowngrade.test(t),C=bs.offline.test(t),R=bs.mfaPolicyTeasing.test(t),q=bs.passwordPoliciesTeasing.test(t),N=bs.usersDirectoryTeasing.test(t),k=bs.subscriptionTeasing.test(t),_=bs.accountRecoveryTeasing.test(t),O=bs.userPassphrasePoliciesTeasing.test(t),I=bs.ssoTeasing.test(t),P=bs.scimTeasing.test(t);let D;if(s?D=ys.HOME:i||R?D=ys.MFA_POLICY:r||q?D=ys.PASSWORD_POLICIES:n?D=ys.MFA:a||N?D=ys.USER_DIRECTORY:o?D=ys.EMAIL_NOTIFICATION:l||k?D=ys.SUBSCRIPTION:c?D=ys.INTERNATIONALIZATION:d||_?D=ys.ACCOUNT_RECOVERY:h?D=ys.SMTP_SETTINGS:p?D=ys.SELF_REGISTRATION:u||I?D=ys.SSO:m?D=ys.RBAC:g||O?D=ys.USER_PASSPHRASE_POLICIES:E?D=ys.PASSWORD_EXPIRY:y?D=ys.HEALTHCHECK:f?D=ys.CONTENT_TYPES_ENCRYPTED_METADATA:b?D=ys.CONTENT_TYPES_METADATA_KEY:v?D=ys.MIGRATE_METADATA:S?D=ys.ALLOW_CONTENT_TYPES:T?D=ys.METADATA_GETTING_STARTED:w||P?D=ys.SCIM:x?D=ys.SECRET_HISTORY:A?D=ys.CE_DOWNGRADE:C&&(D=ys.OFFLINE),!D)return e.selectedAdministration=ys.HTTP_404_NOT_FOUND,void this.setState(e);const U=fs?.[D];e.selectedAdministration=U&&!(this.props.context.siteSettings.canIUse(U)||vs.includes(D)&&this.props.context.siteSettings.isCommunityEdition)?ys.HTTP_404_NOT_FOUND:D,this.setState(e)}setDisplayAdministrationWorkspaceAction(e){this.setState({administrationWorkspaceAction:e})}resetDisplayAdministrationWorkspaceAction(){this.setState({administrationWorkspaceAction:()=>n.createElement(n.Fragment,null)})}render(){return n.createElement(us.Provider,{value:this.state},this.props.children)}}var gs;function Es(e){return class extends n.Component{render(){return n.createElement(us.Consumer,null,t=>n.createElement(e,{administrationWorkspaceContext:t,...this.props}))}}}ms.displayName="AdministrationWorkspaceContextProvider",ms.propTypes={context:c().object,children:c().any,location:c().object,match:c().object,history:c().object,loadingContext:c().object,rbacContext:c().object},(0,Tt.withRouter)(a(function(e){return class extends n.Component{render(){return n.createElement(hs.Consumer,null,t=>n.createElement(e,{rbacContext:t,...this.props}))}}}((gs=ms,class extends n.Component{render(){return n.createElement(Ct.Consumer,null,e=>n.createElement(gs,{loadingContext:e,...this.props}))}}))));const ys={NONE:"NONE",HOME:"HOME",MFA:"MFA",MFA_POLICY:"MFA-POLICY",PASSWORD_POLICIES:"PASSWORD-POLICIES",USER_DIRECTORY:"USER-DIRECTORY",EMAIL_NOTIFICATION:"EMAIL-NOTIFICATION",SUBSCRIPTION:"SUBSCRIPTION",INTERNATIONALIZATION:"INTERNATIONALIZATION",ACCOUNT_RECOVERY:"ACCOUNT-RECOVERY",SMTP_SETTINGS:"SMTP-SETTINGS",SELF_REGISTRATION:"SELF-REGISTRATION",SSO:"SSO",RBAC:"RBAC",USER_PASSPHRASE_POLICIES:"USER-PASSPHRASE-POLICIES",PASSWORD_EXPIRY:"PASSWORD-EXPIRY",HTTP_403_ACCESS_DENIED:"403-ACCESS-DENIED",HTTP_404_NOT_FOUND:"404-NOT-FOUND",HEALTHCHECK:"HEALTHCHECK",CONTENT_TYPES_ENCRYPTED_METADATA:"CONTENT_TYPES_ENCRYPTED_METADATA",CONTENT_TYPES_METADATA_KEY:"CONTENT_TYPES_METADATA_KEY",MIGRATE_METADATA:"MIGRATE_METADATA",ALLOW_CONTENT_TYPES:"ALLOW_CONTENT_TYPES",METADATA_GETTING_STARTED:"METADATA_GETTING_STARTED",SCIM:"SCIM",SECRET_HISTORY:"SECRET_HISTORY",CE_DOWNGRADE:"DOWNGRADE-TO-CE",OFFLINE:"OFFLINE"},fs={[ys.MFA]:"multiFactorAuthentication",[ys.MFA_POLICY]:"mfaPolicies",[ys.PASSWORD_POLICIES]:"passwordPoliciesUpdate",[ys.USER_DIRECTORY]:"directorySync",[ys.SUBSCRIPTION]:"ee",[ys.INTERNATIONALIZATION]:"locale",[ys.ACCOUNT_RECOVERY]:"accountRecovery",[ys.SMTP_SETTINGS]:"smtpSettings",[ys.SELF_REGISTRATION]:"selfRegistration",[ys.SSO]:"sso",[ys.RBAC]:"rbacs",[ys.USER_PASSPHRASE_POLICIES]:"userPassphrasePolicies",[ys.PASSWORD_EXPIRY]:"passwordExpiry",[ys.HEALTHCHECK]:"healthcheckUi",[ys.CONTENT_TYPES_ENCRYPTED_METADATA]:"metadata",[ys.CONTENT_TYPES_METADATA_KEY]:"metadata",[ys.MIGRATE_METADATA]:"metadata",[ys.ALLOW_CONTENT_TYPES]:"metadata",[ys.METADATA_GETTING_STARTED]:"metadata",[ys.SCIM]:"scim",[ys.SECRET_HISTORY]:"secretRevisions",[ys.CE_DOWNGRADE]:"ee",[ys.OFFLINE]:"offlineMode"},bs={homePage:/^\/app\/administration\/?$/,mfa:/^\/app\/administration\/mfa\/?$/,mfaPolicy:/^\/app\/administration\/mfa-policy\/?$/,mfaPolicyTeasing:/^\/app\/administration\/mfa-policy-teasing\/?$/,passwordPolicies:/^\/app\/administration\/password-policies\/?$/,passwordPoliciesTeasing:/^\/app\/administration\/password-policies-teasing\/?$/,usersDirectory:/^\/app\/administration\/users-directory\/?$/,usersDirectoryTeasing:/^\/app\/administration\/users-directory-teasing\/?$/,emailNotification:/^\/app\/administration\/email-notification\/?$/,subscription:/^\/app\/administration\/subscription\/?$/,subscriptionTeasing:/^\/app\/administration\/subscription-teasing\/?$/,internationalization:/^\/app\/administration\/internationalization\/?$/,accountRecovery:/^\/app\/administration\/account-recovery\/?$/,accountRecoveryTeasing:/^\/app\/administration\/account-recovery-teasing\/?$/,smtpSettings:/^\/app\/administration\/smtp-settings\/?$/,selfRegistration:/^\/app\/administration\/self-registration\/?$/,sso:/^\/app\/administration\/sso\/?$/,ssoTeasing:/^\/app\/administration\/sso-teasing\/?$/,rbac:/^\/app\/administration\/rbacs\/?$/,userPassphrasePolicies:/^\/app\/administration\/user-passphrase-policies\/?$/,userPassphrasePoliciesTeasing:/^\/app\/administration\/user-passphrase-policies-teasing\/?$/,passwordExpirySettings:/^\/app\/administration\/password-expiry\/?$/,healthcheck:/^\/app\/administration\/healthcheck\/?$/,contentTypesEncryptedMetadata:/^\/app\/administration\/content-types\/metadata\/?$/,contentTypesMetadataKey:/^\/app\/administration\/content-types\/metadata-key\/?$/,migrateEncryptedMetadata:/^\/app\/administration\/migrate-metadata\/?$/,allowContentTypes:/^\/app\/administration\/allow-content-types\/?$/,gettingStarted:/^\/app\/administration\/content-types\/metadata-getting-started\/?$/,scim:/^\/app\/administration\/user-provisionning\/scim\/?$/,scimTeasing:/^\/app\/administration\/scim-teasing\/?$/,secretHistory:/^\/app\/administration\/secret-history\/?$/,ceDowngrade:/^\/app\/administration\/ce-downgrade\/?$/,offline:/^\/app\/administration\/offline\/?$/},vs=[ys.SUBSCRIPTION,ys.PASSWORD_POLICIES,ys.USER_PASSPHRASE_POLICIES,ys.ACCOUNT_RECOVERY,ys.SSO,ys.MFA_POLICY,ys.USER_DIRECTORY,ys.SCIM],Ss=class{constructor(e){this.customerId=e?.customer_id||"",this.subscriptionId=e?"subscription_id"in e?e.subscription_id:"N/A":"",this.users=e?.users||null,this.email=e?"email"in e?e.email:"N/A":"",this.expiry=e?.expiry||null,this.created=e?.created||null,this.data=e?.data||null}},Ts=n.createContext({getSubscription:()=>{},findSubscriptionKey:()=>{},isProcessing:()=>{},setProcessing:()=>{},getActiveUsers:()=>{},clearContext:()=>{}});class ws extends n.Component{constructor(e){super(e),this.state=this.defaultState}get defaultState(){return{subscription:new Ss,processing:!1,getSubscription:this.getSubscription.bind(this),findSubscriptionKey:this.findSubscriptionKey.bind(this),isProcessing:this.isProcessing.bind(this),setProcessing:this.setProcessing.bind(this),getActiveUsers:this.getActiveUsers.bind(this),clearContext:this.clearContext.bind(this)}}async findSubscriptionKey(){this.setProcessing(!0);let e=new Ss;try{const t=await this.props.context.onGetSubscriptionKeyRequested();e=new Ss(t.toDto())}catch(t){"PassboltSubscriptionError"===t.name&&(e=new Ss(t.subscription))}finally{this.setState({subscription:e}),this.setProcessing(!1)}}async getActiveUsers(){return(await this.props.context.port.request("passbolt.users.get-all")).filter(e=>e.active).length}getSubscription(){return this.state.subscription}isProcessing(){return this.state.processing}setProcessing(e){this.setState({processing:e})}clearContext(){const{subscription:e,processing:t}=this.defaultState;this.setState({subscription:e,processing:t})}render(){return n.createElement(Ts.Provider,{value:this.state},this.props.children)}}function xs(e){return class extends n.Component{render(){return n.createElement(Ts.Consumer,null,t=>n.createElement(e,{adminSubscriptionContext:t,...this.props}))}}}var As;function Cs(){return Cs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)({}).hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},Cs.apply(null,arguments)}ws.propTypes={context:c().any,children:c().any},a(ws);const Rs=function(e){return n.createElement("svg",Cs({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16"},e),As||(As=n.createElement("path",{stroke:"var(--icon-color)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m12 4-8 8M4 4l8 8"})))};class qs extends n.Component{constructor(e){super(e),this.bindCallbacks()}bindCallbacks(){this.handleCloseClick=this.handleCloseClick.bind(this)}handleCloseClick(){this.props.onClose()}render(){return n.createElement("button",{type:"button",disabled:this.props.disabled,className:"dialog-close button button-transparent",onClick:this.handleCloseClick},n.createElement(Rs,{className:"svg-icon close"}),n.createElement("span",{className:"visually-hidden"},n.createElement(I.x,null,"Close")))}}qs.propTypes={onClose:c().func,disabled:c().bool};const Ns=(0,P.C)("common")(qs);var ks;function _s(){return _s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)({}).hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},_s.apply(null,arguments)}const Os=function(e){return n.createElement("svg",_s({xmlns:"http://www.w3.org/2000/svg",width:17,height:18,fill:"none",viewBox:"0 0 17 18"},e),ks||(ks=n.createElement("path",{stroke:"var(--icon-color)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M8.5 16.5a7.5 7.5 0 1 0 0-15 7.5 7.5 0 0 0 0 15M8.5 12V9M8.5 6h.008"})))};class Is extends n.Component{constructor(e){super(e),this.bindCallbacks()}bindCallbacks(){this.handleKeyDown=this.handleKeyDown.bind(this),this.handleClose=this.handleClose.bind(this)}handleKeyDown(e){27===e.keyCode&&this.handleClose()}handleClose(){this.props.disabled||this.props.onClose()}componentDidMount(){document.addEventListener("keydown",this.handleKeyDown,{capture:!1})}componentWillUnmount(){document.removeEventListener("keydown",this.handleKeyDown,{capture:!1})}render(){return n.createElement("div",{className:`${this.props.className} dialog-wrapper`},n.createElement("div",{className:"dialog"},n.createElement("div",{className:"dialog-header"},n.createElement("div",{className:"dialog-title-wrapper"},n.createElement("h2",null,n.createElement("span",{className:"dialog-header-title"},this.props.title),this.props.subtitle&&n.createElement("span",{className:"dialog-header-subtitle"},this.props.subtitle)),this.props.tooltip&&""!==this.props.tooltip&&n.createElement(Et,{message:this.props.tooltip},n.createElement(Os,null))),n.createElement(Ns,{onClose:this.handleClose,disabled:this.props.disabled})),n.createElement("div",{className:"dialog-content"},this.props.children)))}}Is.propTypes={children:c().node,className:c().string,title:c().oneOfType([c().arrayOf(c().node),c().node,c().string]),subtitle:c().string,tooltip:c().node,disabled:c().bool,onClose:c().func};const Ps=Is,Ds=n.createContext({feedbacks:[],displaySuccess:()=>{},displayWarning:()=>{},displayError:()=>{},remove:()=>{}});class Us extends n.Component{constructor(e){super(e),this.state=this.defaultState}get defaultState(){return{feedbacks:[],displaySuccess:this.displaySuccess.bind(this),displayWarning:this.displayWarning.bind(this),displayError:this.displayError.bind(this),remove:this.remove.bind(this)}}displaySuccess(e){this.setState({feedbacks:[...this.state.feedbacks,{id:(0,ft.A)(),type:"success",message:e}]})}displayWarning(e){this.setState({feedbacks:[...this.state.feedbacks,{id:(0,ft.A)(),type:"warning",message:e}]})}displayError(e){this.setState({feedbacks:[...this.state.feedbacks,{id:(0,ft.A)(),type:"error",message:e}]})}remove(e){this.setState(t=>({feedbacks:t.feedbacks.filter(t=>e.id!==t.id)}))}render(){return n.createElement(Ds.Provider,{value:this.state},this.props.children)}}Us.displayName="ActionFeedbackContextProvider",Us.propTypes={children:c().any};class Gs extends n.Component{constructor(e){super(e),this.state=this.defaultState,this.bindCallbacks()}get defaultState(){return{showErrorDetails:!1}}bindCallbacks(){this.handleKeyDown=this.handleKeyDown.bind(this),this.handleErrorDetailsToggle=this.handleErrorDetailsToggle.bind(this)}componentDidMount(){document.addEventListener("keydown",this.handleKeyDown,{capture:!0})}componentWillUnmount(){document.removeEventListener("keydown",this.handleKeyDown,{capture:!0})}getTitle(){return this.props.title?this.props.title:this.props.t("There was an unexpected error...")}getMessage(){return this.props.error.message}handleKeyDown(e){27!==e.keyCode&&13!==e.keyCode||(e.stopPropagation(),this.props.onClose())}handleErrorDetailsToggle(){this.setState({showErrorDetails:!this.state.showErrorDetails})}get hasErrorDetails(){return Boolean(this.props.error.data?.body)||Boolean(this.props.error.details)}formatErrors(){const e=this.props.error?.details||this.props.error?.data;return JSON.stringify(e,null,4)}render(){return n.createElement(Ps,{className:"dialog-wrapper error-dialog",onClose:this.props.onClose,title:this.getTitle()},n.createElement("div",{className:"form-content"},n.createElement("p",null,this.getMessage()),this.hasErrorDetails&&n.createElement("div",{className:"accordion error-details"},n.createElement("div",{className:"accordion-header"},n.createElement("button",{type:"button",className:"link no-border",onClick:this.handleErrorDetailsToggle},n.createElement("span",null,n.createElement(I.x,null,"Error details")),this.state.showErrorDetails?n.createElement(te,{className:"baseline svg-icon"}):n.createElement(ie,{className:"baseline svg-icon"}))),this.state.showErrorDetails&&n.createElement("div",{className:"accordion-content"},n.createElement("div",{className:"input text"},n.createElement("label",{htmlFor:"js_field_debug",className:"visuallyhidden"},n.createElement(I.x,null,"Error details")),n.createElement("textarea",{id:"js_field_debug",defaultValue:this.formatErrors(),readOnly:!0}))))),n.createElement("div",{className:"submit-wrapper clearfix"},n.createElement("button",{type:"button",className:"button primary warning",onClick:this.props.onClose},"Ok")))}}Gs.propTypes={title:c().string,error:c().object.isRequired,onClose:c().func,t:c().func};const Ls=(0,P.C)("common")(Gs);class Ms extends n.Component{constructor(e){super(e),this.bindCallbacks()}bindCallbacks(){this.getClassName=this.getClassName.bind(this)}getClassName(){let e="button primary form";return this.props.warning?e+=" warning":this.props.attention&&(e+=" attention"),this.props.disabled&&(e+=" disabled"),this.props.processing&&(e+=" processing"),this.props.big&&(e+=" big"),this.props.medium&&(e+=" medium"),this.props.fullWidth&&(e+=" full-width"),e}render(){return n.createElement("button",{type:"submit",className:this.getClassName(),disabled:this.props.disabled},this.props.value||n.createElement(I.x,null,"Save"),this.props.processing&&n.createElement(U,null))}}Ms.defaultProps={warning:!1,attention:!1},Ms.propTypes={processing:c().bool,disabled:c().bool,value:c().oneOfType([c().arrayOf(c().node),c().node,c().string]),warning:c().bool,attention:c().bool,big:c().bool,medium:c().bool,fullWidth:c().bool};const Fs=(0,P.C)("common")(Ms);class $s extends n.Component{constructor(e){super(e),this.bindCallbacks()}bindCallbacks(){this.handleClick=this.handleClick.bind(this)}handleClick(){this.props.disabled||this.props.onClick()}render(){return n.createElement("button",{type:"button",disabled:this.props.disabled,className:"link cancel",onClick:this.handleClick},this.props.value)}}$s.defaultProps={value:n.createElement(I.x,null,"Cancel")},$s.propTypes={disabled:c().bool,onClick:c().func,value:c().oneOfType([c().arrayOf(c().node),c().node,c().string])};const Vs=(0,P.C)("common")($s),Ks=class extends ls{static getSchema(){return{type:"object",required:["subscription_id","users","expiry","created","data"],properties:{customer_id:{type:"string"},subscription_id:{type:"string"},users:{type:"integer"},email:{type:"string",format:"email"},created:{type:"string",format:"date-time"},expiry:{type:"string",format:"date-time"},data:{type:"string"}}}}get expiry(){return this._props.expiry}toDto(){return Object.assign({},this._props)}toJSON(){return this.toDto()}static get ENTITY_NAME(){return"Subscription"}},Bs=class{constructor(e){this.port=e}async createOrganizationSubscriptionKey(e){(0,es.A)(e);const t=await this.port.request("passbolt.subscription.create",{data:e});return new Ks(t)}async findOrganizationSubscriptionKey(){const e=await this.port.request("passbolt.subscription.get");return new Ks(e)}async updateOrganizationSubscriptionKey(e){(0,es.A)(e);const t=await this.port.request("passbolt.subscription.update",{data:e});return new Ks(t)}async deleteOrganizationSubscriptionKey(){await this.port.request("passbolt.subscription.downgrade")}};class js extends n.Component{constructor(e){super(e),this.state=this.getDefaultState(),this.initEventHandlers(),this.createInputRef(),this.subscriptionKeyService=new Bs(e.context.port)}getDefaultState(){return{selectedFile:null,key:"",keyError:"",processing:!1,hasBeenValidated:!1}}initEventHandlers(){this.handleCloseClick=this.handleCloseClick.bind(this),this.handleFormSubmit=this.handleFormSubmit.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleKeyInputKeyUp=this.handleKeyInputKeyUp.bind(this),this.handleSelectSubscriptionKeyFile=this.handleSelectSubscriptionKeyFile.bind(this),this.handleSelectFile=this.handleSelectFile.bind(this)}createInputRef(){this.keyInputRef=n.createRef(),this.fileUploaderRef=n.createRef()}componentDidMount(){this.setState({key:this.props.context.editSubscriptionKey?.key||""})}async handleFormSubmit(e){e.preventDefault(),this.state.processing||await this.save()}handleInputChange(e){const t=e.target,s=t.value,n=t.name;this.setState({[n]:s})}handleKeyInputKeyUp(){if(this.state.hasAlreadyBeenValidated){const e=this.validateNameInput();this.setState(e)}}handleCloseClick(){this.props.context.setContext({editSubscriptionKey:null}),this.props.onClose()}handleSelectFile(){this.fileUploaderRef.current.click()}get selectedFilename(){return this.state.selectedFile?this.state.selectedFile.name:""}async handleSelectSubscriptionKeyFile(e){const[t]=e.target.files,s=await this.readSubscriptionKeyFile(t);this.setState({key:s,selectedFile:t}),this.state.hasBeenValidated&&await this.validate()}readSubscriptionKeyFile(e){const t=new FileReader;return new Promise((s,n)=>{t.onloadend=()=>{try{s(t.result)}catch(e){n(e)}},t.readAsText(e)})}async save(){if(!this.state.processing){if(this.setState({hasBeenValidated:!0,processing:!0}),!await this.validate())return this.handleValidateError(),void this.setState({processing:!1});try{this.props.onSave?await this.props.onSave(this.state.key):await this.subscriptionKeyService.updateOrganizationSubscriptionKey(this.state.key),await this.handleSaveSuccess(),await this.props.adminSubscriptionContext.findSubscriptionKey()}catch(e){this.setState({processing:!1}),this.handleSaveError(e),this.focusFieldError()}}}handleValidateError(){this.focusFieldError()}async handleSaveSuccess(){await this.props.actionFeedbackContext.displaySuccess(this.translate("The subscription key has been updated successfully.")),this.props.administrationWorkspaceContext.onMustRefreshSubscriptionKey(),this.props.context.setContext({editSubscriptionKey:null,refreshSubscriptionAnnouncement:!0}),this.props.onClose()}handleSaveError(e){if("PassboltSubscriptionError"===e.name)this.setState({keyError:e.message});else if("EntityValidationError"===e.name)this.setState({keyError:this.translate("The subscription key is invalid.")});else if("PassboltApiFetchError"===e.name&&e.data&&400===e.data.code)this.setState({keyError:e.message});else{console.error(e);const t={error:e};this.props.dialogContext.open(Ls,t)}}focusFieldError(){this.state.keyError&&this.keyInputRef.current.focus()}validateKeyInput(){const e=this.state.key.trim();let t="";return e.length||(t=this.translate("A subscription key is required.")),new Promise(e=>{this.setState({keyError:t},e)})}async validate(){return this.setState({keyError:""}),await this.validateKeyInput(),""===this.state.keyError}hasAllInputDisabled(){return this.state.processing}get translate(){return this.props.t}render(){return n.createElement(Ps,{title:this.props.title??this.translate("Edit subscription key"),onClose:this.handleCloseClick,disabled:this.state.processing,className:"edit-subscription-dialog"},n.createElement("form",{onSubmit:this.handleFormSubmit,noValidate:!0},n.createElement("div",{className:"form-content"},n.createElement("div",{className:`input textarea required ${this.state.keyError?"error":""} ${this.hasAllInputDisabled()?"disabled":""}`},n.createElement("label",{htmlFor:"edit-tag-form-name"},n.createElement(I.x,null,"Subscription key")),n.createElement("textarea",{id:"edit-subscription-form-key",name:"key",value:this.state.key,onKeyUp:this.handleKeyInputKeyUp,onChange:this.handleInputChange,disabled:this.hasAllInputDisabled(),ref:this.keyInputRef,className:"required full_report",required:"required",autoComplete:"off",autoFocus:!0})),n.createElement("div",{className:"input file "+(this.hasAllInputDisabled()?"disabled":"")},n.createElement("input",{type:"file",ref:this.fileUploaderRef,disabled:this.hasAllInputDisabled(),onChange:this.handleSelectSubscriptionKeyFile}),n.createElement("div",{className:"input-file-inline"},n.createElement("input",{type:"text",disabled:!0,placeholder:this.translate("No key file selected"),value:this.selectedFilename}),n.createElement("button",{type:"button",className:"button primary",onClick:this.handleSelectFile,disabled:this.hasAllInputDisabled()},n.createElement("span",null,n.createElement(I.x,null,"Choose a file")))),this.state.keyError&&n.createElement("div",{className:"key error-message"},this.state.keyError),this.props.warning&&n.createElement("p",null,this.props.warning))),n.createElement("div",{className:"submit-wrapper clearfix"},n.createElement(Vs,{disabled:this.hasAllInputDisabled(),onClick:this.handleCloseClick}),n.createElement(Fs,{disabled:this.hasAllInputDisabled(),processing:this.state.processing,value:this.translate("Save")}))))}}js.propTypes={context:c().any,onClose:c().func,actionFeedbackContext:c().any,adminSubscriptionContext:c().object,dialogContext:c().any,administrationWorkspaceContext:c().any,title:c().string,warning:c().string,onSave:c().func,t:c().func};const zs=a(xs(Es(function(e){return class extends n.Component{render(){return n.createElement(Ds.Consumer,null,t=>n.createElement(e,{actionFeedbackContext:t,...this.props}))}}}(St((0,P.C)("common")(js))))));class Hs{constructor(e){this.context=e.context,this.dialogContext=e.dialogContext,this.subscriptionContext=e.adminSubscriptionContext}static getInstance(e){return this.instance||(this.instance=new Hs(e)),this.instance}static killInstance(){this.instance=null}editSubscription(){const e={key:this.subscriptionContext.getSubscription().data};this.context.setContext({editSubscriptionKey:e}),this.dialogContext.open(zs)}}const Ws=Hs;var Ys=s(40961);var Zs,Xs;function Js(){return Js=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)({}).hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},Js.apply(null,arguments)}const Qs=function(e){return n.createElement("svg",Js({xmlns:"http://www.w3.org/2000/svg",width:18,height:18,fill:"none",viewBox:"0 0 18 18"},e),Zs||(Zs=n.createElement("path",{stroke:"var(--icon-color)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M15 3H3a1.5 1.5 0 0 0-1.5 1.5v9A1.5 1.5 0 0 0 3 15h12a1.5 1.5 0 0 0 1.5-1.5v-9A1.5 1.5 0 0 0 15 3"})),Xs||(Xs=n.createElement("path",{stroke:"var(--icon-color)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M16.5 5.25 9.773 9.525a1.46 1.46 0 0 1-1.546 0L1.5 5.25"})))};var en;function tn(){return tn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)({}).hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},tn.apply(null,arguments)}const sn=function(e){return n.createElement("svg",tn({xmlns:"http://www.w3.org/2000/svg",width:18,height:18,fill:"none",viewBox:"0 0 18 18"},e),en||(en=n.createElement("path",{stroke:"var(--icon-color)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m16.298 13.5-6-10.5a1.5 1.5 0 0 0-2.61 0l-6 10.5A1.5 1.5 0 0 0 3 15.75h12a1.5 1.5 0 0 0 1.297-2.25M9 6.75v3M9 12.75h.008"})))},nn="Pro Edition",rn="Community Edition";class an extends n.Component{constructor(e){super(e),this.state=this.defaultState,this.bindCallbacks(),this.subscriptionActionService=Ws.getInstance(this.props),this.subscriptionKeyService=new Bs(this.props.context.port)}get defaultState(){return{activeUsers:null}}async componentDidMount(){this.props.context.siteSettings.isCommunityEdition&&this.hasEditionPlugin()||this.props.adminSubscriptionContext.findSubscriptionKey();const e=await this.props.adminSubscriptionContext.getActiveUsers();this.setState({activeUsers:e})}componentWillUnmount(){this.props.adminSubscriptionContext.clearContext(),Ws.killInstance()}bindCallbacks(){this.handleRenewKey=this.handleRenewKey.bind(this),this.handleUpdateKey=this.handleUpdateKey.bind(this),this.handleDowngradeClick=this.handleDowngradeClick.bind(this),this.handleAddSubscriptionKey=this.handleAddSubscriptionKey.bind(this),this.handleSaveSubscriptionKey=this.handleSaveSubscriptionKey.bind(this)}handleSaveSubscriptionKey(e){return this.subscriptionKeyService.createOrganizationSubscriptionKey(e)}handleAddSubscriptionKey(){this.props.dialogContext.open(zs,{title:this.props.t("New subscription key"),onSave:this.handleSaveSubscriptionKey,warning:this.translate("You and your team will be disconnected at the end of the process.")})}handleDowngradeClick(){this.props.navigationContext.onGoToAdministrationDowngradeToCeRequested()}handleRenewKey(){const e=this.props.adminSubscriptionContext.getSubscription();this.hasLimitUsersExceeded()?this.props.navigationContext.onGoToSubscriptionUpdateQuantityRequested(e.subscriptionId,e.customerId):(this.hasSubscriptionKeyExpired()||this.hasSubscriptionKeyGoingToExpire())&&this.props.navigationContext.onGoToSubscriptionRenewRequested(e.subscriptionId,e.customerId)}handleUpdateKey(){this.subscriptionActionService.editSubscription()}hasEditionPlugin(){return this.props.context.siteSettings.canIUse("edition")}hasSubscriptionKeyExpired(){return yt.c9.fromISO(this.props.adminSubscriptionContext.getSubscription().expiry)<yt.c9.now()}hasSubscriptionKeyGoingToExpire(){return!this.hasSubscriptionKeyExpired()&&yt.c9.fromISO(this.props.adminSubscriptionContext.getSubscription().expiry)<yt.c9.now().plus({days:30})}shouldShowDowngradeSection(){return this.hasEditionPlugin()&&!this.props.context.siteSettings.isCommunityEdition&&(this.hasSubscriptionKeyExpired()||this.hasSubscriptionKeyGoingToExpire())}hasLimitUsersExceeded(){return this.props.adminSubscriptionContext.getSubscription().users<this.state.activeUsers}hasValidSubscription(){return!this.props.context.siteSettings.isCommunityEdition&&!this.hasLimitUsersExceeded()&&!this.hasSubscriptionKeyExpired()}hasInvalidSubscription(){return!this.props.context.siteSettings.isCommunityEdition&&!this.props.adminSubscriptionContext.getSubscription().data}formatDate(e){try{return yt.c9.fromISO(e).setLocale(this.props.context.locale).toLocaleString(yt.c9.DATE_SHORT)}catch(t){return console.error(`Failed to format date "${e}":`,t),""}}get translate(){return this.props.t}render(){const e=this.props.adminSubscriptionContext.getSubscription(),t=this.props.adminSubscriptionContext.isProcessing();return n.createElement("div",{className:"row"},!t&&n.createElement("div",{className:"subscription-key main-column"},n.createElement("div",{className:"main-content"},n.createElement("h1",null,n.createElement(I.x,null,"Subscription")),n.createElement("h3",null,n.createElement(I.x,null,"Details")),n.createElement("div",{className:"subscription-information"},n.createElement("div",{className:"information container"},n.createElement("div",{className:"information"},n.createElement("div",{className:"information-label"},n.createElement("span",{className:"edition label"},n.createElement(I.x,null,"Edition:")),n.createElement("span",{className:"server-version label"},n.createElement(I.x,null,"Server version:")),n.createElement("span",{className:"client-version label"},n.createElement(I.x,null,"Client version:")),!this.props.context.siteSettings.isCommunityEdition&&n.createElement(n.Fragment,null,n.createElement("span",{className:"email label"},n.createElement(I.x,null,"Email:")),n.createElement("span",{className:"users label"},n.createElement(I.x,null,"Users limit:")))),n.createElement("div",{className:"information-value"},n.createElement("span",{className:"edition value"},!this.props.context.siteSettings.isCommunityEdition&&nn,this.props.context.siteSettings.isCommunityEdition&&n.createElement(n.Fragment,null,rn,n.createElement("span",{className:"subtitle"},n.createElement(I.x,null,"(Free forever)")))),n.createElement("span",{className:"server-version value"},this.props.context.siteSettings.version),n.createElement("span",{className:"client-version value"},this.props.context.extensionVersion),!this.props.context.siteSettings.isCommunityEdition&&n.createElement(n.Fragment,null,n.createElement("span",{className:"email value"},e.email),n.createElement("span",{className:"users value "+(this.hasLimitUsersExceeded()?"error":"")},e.users," ",n.createElement("span",{className:"secondary-information"},"(",n.createElement(I.x,null,"currently:")," ",this.state.activeUsers,")"))))),n.createElement("div",{className:"information"},n.createElement("div",{className:"information-label"},!this.props.context.siteSettings.isCommunityEdition&&n.createElement(n.Fragment,null,n.createElement("span",{className:"customer-id label"},n.createElement(I.x,null,"Customer id:")),n.createElement("span",{className:"subscription-id label"},n.createElement(I.x,null,"Subscription id:")),n.createElement("span",{className:"created label"},n.createElement(I.x,null,"Valid from:")),n.createElement("span",{className:"expiry label"},n.createElement(I.x,null,"Expires on:")))),n.createElement("div",{className:"information-value"},!this.props.context.siteSettings.isCommunityEdition&&n.createElement(n.Fragment,null,n.createElement("span",{className:"customer-id value"},e.customerId),n.createElement("span",{className:"subscription-id value"},e.subscriptionId),n.createElement("span",{className:"created value"},this.formatDate(e.created)),n.createElement("span",{className:`expiry value ${this.hasSubscriptionKeyExpired()?"error":""} ${this.hasSubscriptionKeyGoingToExpire()?"warning":""}`},this.formatDate(e.expiry)," ",n.createElement("span",{className:"secondary-information",title:e.expiry},"(",`${this.hasSubscriptionKeyExpired()?this.translate("expired "):""}${((e,t,s)=>{if(null===e)return"n/a";if("Infinity"===e)return t("Never");const n=yt.c9.fromISO(e),i=n.diffNow().toMillis();return i>-1e3&&i<0?t("Just now"):n.toRelative({locale:s})})(e.expiry,this.props.t,this.props.context.locale)}`,")"))))))),!this.props.context.siteSettings.isCommunityEdition&&n.createElement(n.Fragment,null,!this.props.context.siteSettings.isCommunityEdition&&n.createElement("div",{className:"subscription-actions"},this.hasSubscriptionKeyExpired()&&n.createElement("div",{className:"subscription-warning"},n.createElement(sn,null),n.createElement(I.x,null,"Your subscription key is expired.")),this.hasLimitUsersExceeded()&&n.createElement("div",{className:"subscription-warning"},n.createElement(sn,null),n.createElement(I.x,null,"Your users limit has been reached.")),this.hasInvalidSubscription()&&n.createElement("div",{className:"subscription-warning"},n.createElement(sn,null),n.createElement(I.x,null,"Your subscription key is either missing or not valid.")))),n.createElement("div",{className:"subscription-actions"},!this.props.context.siteSettings.isCommunityEdition&&n.createElement(n.Fragment,null,(this.shouldShowDowngradeSection()||this.hasLimitUsersExceeded())&&n.createElement("button",{className:"button",type:"button",onClick:this.handleRenewKey},n.createElement(I.x,null,"Renew subscription key")),n.createElement("button",{className:"button primary form",type:"button",onClick:this.handleUpdateKey},n.createElement(I.x,null,"Update subscription key"))),this.props.context.siteSettings.isCommunityEdition&&this.hasEditionPlugin()&&n.createElement(n.Fragment,null,n.createElement("button",{className:"button primary form",type:"button",onClick:this.handleAddSubscriptionKey},n.createElement(I.x,null,"Upload subscription key")))),n.createElement("h3",{className:"title"},n.createElement(I.x,null,"Plans")),n.createElement("div",{className:"subscription-editions"},n.createElement("div",{className:"edition "+(this.props.context.siteSettings.isCommunityEdition?"current-edition":"")},n.createElement("div",{className:"content"},n.createElement("div",{className:"title"},n.createElement("div",{className:"community-title"},n.createElement("h3",null,rn),n.createElement("span",{className:"subtitle"},n.createElement(I.x,null,"(Free forever)"))),this.props.context.siteSettings.isCommunityEdition&&n.createElement("div",{className:"current-edition-indicator-wrapper"},n.createElement("div",{className:"current-edition-indicator"},n.createElement(I.x,null,"Current plan")))),n.createElement("div",{className:"features"},n.createElement("span",{className:"subtitle"},n.createElement(I.x,null,"Features included:")),n.createElement("ul",null,n.createElement("li",null,n.createElement(I.x,null,"Open source under AGPLV3 license")),n.createElement("li",null,n.createElement(I.x,null,"Passwords management & sharing")),n.createElement("li",null,n.createElement(I.x,null,"Private and shared folders")),n.createElement("li",null,n.createElement(I.x,null,"Users and groups management")),n.createElement("li",null,n.createElement(I.x,null,"Secret key authentication (2FA)")),n.createElement("li",null,n.createElement(I.x,null,"Additional factor authentication (3-step verification)")),n.createElement("li",null,n.createElement(I.x,null,"Open API")),n.createElement("li",null,n.createElement(I.x,null,"Role Based Access Control")),n.createElement("li",null,n.createElement(I.x,null,"Password expiry")),n.createElement("li",null,n.createElement(I.x,null,"Secret history")),n.createElement("li",null,n.createElement(I.x,null,"Community support"))))),this.shouldShowDowngradeSection()&&n.createElement("div",{className:"subscription-actions"},n.createElement("button",{className:"button",type:"button",onClick:this.handleDowngradeClick},n.createElement(I.x,null,"Downgrade to ",{edition:"Community"})))),n.createElement("div",{className:"edition "+(this.props.context.siteSettings.isCommunityEdition?"":"current-edition")},n.createElement("div",{className:"content"},n.createElement("div",{className:"title"},n.createElement("h3",null,nn),!this.props.context.siteSettings.isCommunityEdition&&n.createElement("div",{className:"current-edition-indicator-wrapper"},n.createElement("div",{className:"current-edition-indicator"},n.createElement(I.x,null,"Current plan")))),n.createElement("div",{className:"features"},n.createElement("span",{className:"subtitle"},n.createElement(I.x,null,"Features include everything in Community, plus:")),n.createElement("ul",null,n.createElement("li",null,n.createElement(I.x,null,"Account recovery (Escrow)")),n.createElement("li",null,n.createElement(I.x,null,"Users provisioning (AD / OpenLDAP / SCIM)")),n.createElement("li",null,n.createElement(I.x,null,"Single Sign On (SSO) with Microsoft, Google and more")),n.createElement("li",null,n.createElement(I.x,null,"Activity log (audit changes)")),n.createElement("li",null,n.createElement(I.x,null,"Additional policies")),n.createElement("li",null,n.createElement(I.x,null,"Tags management")),n.createElement("li",null,n.createElement(I.x,null,"VM appliance")),n.createElement("li",null,n.createElement(I.x,null,"Next business day support"))),n.createElement("div",null,n.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:"https://www.passbolt.com/pricing/pro?utm_campaign=21060976-CE%20to%20Pro&utm_source=product"},n.createElement(I.x,null,"See pricing page"))))),this.props.context.siteSettings.isCommunityEdition&&n.createElement("div",{className:"subscription-actions"},n.createElement("a",{className:"button primary",target:"_blank",rel:"noopener noreferrer",href:"https://www.passbolt.com/pricing/pro?utm_campaign=21060976-CE%20to%20Pro&utm_source=product"},n.createElement(I.x,null,"Buy now")),n.createElement("a",{className:"button",target:"_blank",rel:"noopener noreferrer",href:"https://www.passbolt.com/contact/pro/free-trial?utm_campaign=21060976-CE%20to%20Pro&utm_source=product"},n.createElement(I.x,null,"Start a free trial"))))))),(s=n.createElement("div",{className:"sidebar-help-section"},n.createElement("h3",null,n.createElement(I.x,null,"Need help?")),n.createElement("p",null,n.createElement(I.x,null,"For any change or question related to your passbolt subscription, kindly contact our sales team.")),n.createElement("a",{className:"button",target:"_blank",rel:"noopener noreferrer",href:"https://www.passbolt.com/contact"},n.createElement(Qs,null),n.createElement("span",null,n.createElement(I.x,null,"Contact Sales")))),i=document.getElementById("administration-help-panel"),n.createElement(n.Fragment,null,i&&(0,Ys.createPortal)(s,i,void 0))));var s,i}}a(function(e){return class extends n.Component{render(){return n.createElement(xt.Consumer,null,t=>n.createElement(e,{navigationContext:t,...this.props}))}}}(xs(Es(St((0,P.C)("common")(an))))));class on extends n.Component{get privacyUrl(){return this.props.context.siteSettings.privacyLink}get creditsUrl(){return"https://www.passbolt.com/terms"}get unsafeUrl(){return"https://www.passbolt.com/docs/hosting/faq/why-I-see-unsafe-mode-banner/"}get termsUrl(){return this.props.context.siteSettings.termsLink}get versions(){const e=this.props.context.extensionVersion,t=this.props.context.siteSettings.version;return n.createElement("div",null,e&&n.createElement("div",null,this.props.t("Client")," ",e),t&&n.createElement(n.Fragment,null,e&&n.createElement("hr",null),n.createElement("div",null,this.props.t("Server")," ",t)))}get isUnsafeMode(){if(!this.props.context.siteSettings)return!1;const e=this.props.context.siteSettings.debug,t=this.props.context.siteSettings.url.startsWith("http://");return e||t}get isCloud(){const e=new URL(this.props.context.siteSettings.url);return"https:"===e.protocol&&Boolean(e.hostname.match(/cloud.passbolt.com$/))}render(){return n.createElement("footer",{className:"footer"},n.createElement("ul",{className:"footer-links"},this.isUnsafeMode&&n.createElement("li",{className:"error-message"},n.createElement("a",{href:this.unsafeUrl,target:"_blank",rel:"noopener noreferrer"},n.createElement(I.x,null,"Unsafe mode"))),!this.isCloud&&n.createElement(n.Fragment,null,this.props.context.siteSettings.isCommunityEdition&&n.createElement("li",null,rn,n.createElement("span",{className:"edition-suffix"},n.createElement(I.x,null," (free)"))),!this.props.context.siteSettings.isCommunityEdition&&n.createElement("li",null,nn)),this.isCloud&&n.createElement("li",null,"Cloud"),n.createElement("li",null,this.versions&&n.createElement(Et,{message:this.versions,direction:"top-left"},n.createElement("a",{className:"button button-transparent inline",href:this.creditsUrl,target:"_blank",rel:"noopener noreferrer"},n.createElement(mt,null))),!this.versions&&n.createElement("a",{className:"button button-transparent inline",href:this.creditsUrl,target:"_blank",rel:"noopener noreferrer"},n.createElement(mt,null)))))}}on.propTypes={context:c().any,t:c().func};const ln=a((0,P.C)("common")(on)),cn=(e,t)=>t.split(".").reduce((e,t)=>e?.[t],e);s.dn(cn);const dn=(e,t)=>{if(void 0===e||"string"!=typeof e||!e.length)return!1;if((t=t||{}).whiteListedProtocols&&!Array.isArray(t.whiteListedProtocols))throw new TypeError("The whiteListedProtocols should be an array of string.");if(t.defaultProtocol&&"string"!=typeof t.defaultProtocol)throw new TypeError("The defaultProtocol should be a string.");const s=t.whiteListedProtocols||[hn.HTTP,hn.HTTPS],n=[hn.JAVASCRIPT],i=t.defaultProtocol||"";!/^(?:(?!:\/\/).)*:\/\//.test(e)&&i&&(e=`${i}//${e}`);try{const t=new URL(e);return!n.includes(t.protocol)&&!!s.includes(t.protocol)&&t.href}catch(e){return console.error("Failed to sanitize URL:",e),!1}};s.dn(dn);const hn={FTP:"http:",FTPS:"https:",HTTP:"http:",HTTPS:"https:",JAVASCRIPT:"javascript:",SSH:"ssh:"},pn="enabled",un="disabled",mn="not found";class gn extends ls{static getSchema(){return{type:"object",required:[],properties:{status:{type:"string",enum:[pn,un,mn]},app:{type:"object"},passbolt:{type:"object"},serverTimeDiff:{type:"integer",nullable:!0}}}}marshall(){void 0===this._props.status&&(this._props.status=pn),gn.sanitizeEmailValidateRegex(this._props)}static sanitizeEmailValidateRegex(e){const t=e?.passbolt?.email?.validate?.regex;t&&"string"==typeof t&&t.trim().length&&(e.passbolt.email.validate.regex=t.trim().replace(/^\/+/,"").replace(/\/+$/,""))}static get disabledSiteSettings(){return{status:un}}toDto(){return{...this._props}}toJSON(){return this.toDto()}canIUse(e){const t=this._props?.passbolt?.plugins?.[e];return!(!t||"object"!=typeof t||void 0!==t.enabled&&!0!==t.enabled&&"true"!==t.enabled)}isPluginEnabled(e){return this.canIUse(e)}isFeatureBeta(e){return(0,es.A)(e),cn(this._props,`passbolt.plugins.${e}.isInBeta`)||!1}getPluginSettings(e){return cn(this._props,`passbolt.plugins.${e}`)}getRememberMeOptions(){return(this.getPluginSettings("rememberMe")||{}).options||{}}get hasRememberMeUntilILogoutOption(){return void 0!==(this.getRememberMeOptions()||{})[-1]}get generatorConfiguration(){return cn(this._props,"passbolt.plugins.generator.configuration")}get locale(){return cn(this._props,"app.locale")||gn.DEFAULT_LOCALE.locale}async setLocale(e){this._props.app||(this._props.app={}),this._props.app.locale=e}get supportedLocales(){return cn(this._props,"passbolt.plugins.locale.options")||gn.DEFAULT_SUPPORTED_LOCALES}getServerTimezone(){return cn(this._props,"passbolt.app.server_timezone")}get termsLink(){const e=cn(this._props,"passbolt.legal.terms.url");return!!e&&dn(e)}get privacyLink(){const e=cn(this._props,"passbolt.legal.privacy_policy.url");return!!e&&dn(e)}get registrationPublic(){return!0===cn(this._props,"passbolt.registration.public")}get debug(){return!0===cn(this._props,"app.debug")}get url(){return cn(this._props,"app.url")||""}get version(){return cn(this._props,"app.version.number")}get isCommunityEdition(){return"ce"===cn(this._props,"passbolt.edition")}get emailValidateRegex(){return cn(this._props,"passbolt.email.validate.regex")||null}isServerInPast(){return(this._props.serverTimeDiff||0)<0}get serverTime(){const e=this._props.serverTimeDiff||0;return(new Date).getTime()+e}static get ENTITY_NAME(){return"SiteSettings"}static get ORGANIZATION_ENABLED(){return pn}static get ORGANIZATION_DISABLED(){return un}static get ORGANIZATION_NOT_FOUND(){return mn}static get DEFAULT_LOCALE(){return{locale:"en-UK",label:"English"}}static get DEFAULT_SUPPORTED_LOCALES(){return[gn.DEFAULT_LOCALE]}}const En=gn;var yn=s(72635),fn=s(51831),bn=s(32107);class vn extends n.Component{constructor(e){super(e),this.state=this.defaultState}get defaultState(){return{ready:!1}}async componentDidMount(){await(0,yn.Yx)(fn.r).use(bn.A).init({lng:this.locale,load:"currentOnly",interpolation:{escapeValue:!1},react:{useSuspense:!1},backend:{loadPath:(e,t)=>this.getTranslationPath(e,t)},supportedLngs:this.supportedLocales,fallbackLng:!1,ns:["common"],defaultNS:"common",keySeparator:!1,nsSeparator:!1,debug:!1}),this.setState({ready:!0})}getTranslationPath(e,t){const s=e[0],n=t[0],i="en-GB"===s?"en-UK":s;return(this.props.loadingPath||"/locales/{{lng}}/{{ns}}.json").replace("{{lng}}",i).replace("{{ns}}",n)}get supportedLocales(){let e=[];return this.props.context.siteSettings?.supportedLocales?e=this.props.context.siteSettings?.supportedLocales.map(e=>e.locale):e.push(this.locale),e.includes("en-UK")&&e.push("en-GB"),e}get locale(){return this.props.context.locale}async componentDidUpdate(e){await this.handleLocaleChange(e.context.locale)}async handleLocaleChange(e){this.locale!==e&&await(0,yn.v2)(this.locale)}get isReady(){return this.state.ready}render(){return n.createElement(n.Fragment,null,this.isReady&&this.props.children)}}vn.propTypes={context:c().any,loadingPath:c().any,children:c().any};const Sn=a(vn),Tn=new class{allPropTypes=(...e)=>(...t)=>{const s=e.map(e=>e(...t)).filter(Boolean);if(0===s.length)return;const n=s.map(e=>e.message).join("\n");return new Error(n)}};var wn;function xn(){return xn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)({}).hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},xn.apply(null,arguments)}const An=function(e){return n.createElement("svg",xn({width:25,height:24,fill:"none",viewBox:"0 0 25 24"},e),wn||(wn=n.createElement("path",{stroke:"var(--icon-color)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M11.597 19a8 8 0 1 0 0-16 8 8 0 0 0 0 16M21.597 21l-4.35-4.35"})))};class Cn extends n.Component{constructor(e){super(e),this.state=this.getDefaultState(e),this.bindCallback(),this.createRefs()}getDefaultState(e){return{selectedValue:e.value,search:"",open:!1,style:void 0}}get listItemsFiltered(){const e=this.props.items.filter(e=>e.value!==this.state.selectedValue);return this.props.search&&""!==this.state.search?this.getItemsMatch(e,this.state.search):e}get selectedItemLabel(){const e=this.props.items&&this.props.items.find(e=>e.value===this.state.selectedValue);return e&&e.label||n.createElement(n.Fragment,null," ")}static getDerivedStateFromProps(e,t){return void 0!==e.value&&e.value!==t.selectedValue?{selectedValue:e.value}:null}bindCallback(){this.handleDocumentClickEvent=this.handleDocumentClickEvent.bind(this),this.handleDocumentContextualMenuEvent=this.handleDocumentContextualMenuEvent.bind(this),this.handleDocumentDragStartEvent=this.handleDocumentDragStartEvent.bind(this),this.handleDocumentScrollEvent=this.handleDocumentScrollEvent.bind(this),this.handleSelectClick=this.handleSelectClick.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleItemClick=this.handleItemClick.bind(this),this.handleSelectKeyDown=this.handleSelectKeyDown.bind(this),this.handleItemKeyDown=this.handleItemKeyDown.bind(this),this.handleBlur=this.handleBlur.bind(this)}createRefs(){this.selectedItemRef=n.createRef(),this.selectItemsRef=n.createRef(),this.itemsRef=n.createRef()}componentDidMount(){document.addEventListener("click",this.handleDocumentClickEvent,{capture:!0}),document.addEventListener("contextmenu",this.handleDocumentContextualMenuEvent,{capture:!0}),document.addEventListener("dragstart",this.handleDocumentDragStartEvent,{capture:!0}),document.addEventListener("scroll",this.handleDocumentScrollEvent,{capture:!0})}componentWillUnmount(){document.removeEventListener("click",this.handleDocumentClickEvent,{capture:!0}),document.removeEventListener("contextmenu",this.handleDocumentContextualMenuEvent,{capture:!0}),document.removeEventListener("dragstart",this.handleDocumentDragStartEvent,{capture:!0}),document.removeEventListener("scroll",this.handleDocumentScrollEvent,{capture:!0})}handleDocumentClickEvent(e){this.selectedItemRef.current.contains(e.target)||this.selectItemsRef.current.contains(e.target)||this.closeSelect()}handleDocumentContextualMenuEvent(e){this.selectedItemRef.current.contains(e.target)||this.selectItemsRef.current.contains(e.target)||this.closeSelect()}handleDocumentDragStartEvent(){this.closeSelect()}handleDocumentScrollEvent(e){this.itemsRef.current.contains(e.target)||this.selectItemsRef.current.contains(e.target)||this.closeSelect()}handleSelectClick(){if(this.props.disabled)this.closeSelect();else{const e=!this.state.open;e?this.forceVisibilitySelect():this.resetStyleSelect(),this.setState({open:e})}}getFirstParentWithTransform(){let e=this.selectedItemRef.current.parentElement;for(;null!==e&&""===e.style.getPropertyValue("transform");)e=e.parentElement;return e}forceVisibilitySelect(){const e=this.selectedItemRef.current.getBoundingClientRect(),{width:t,height:s}=e;let{top:n,left:i}=e;const r=this.getFirstParentWithTransform();if(r){const e=r.getBoundingClientRect();n-=e.top,i-=e.left}const a={position:"fixed",zIndex:1,width:t,height:s,top:n,left:i};this.setState({style:a})}handleBlur(e){e.currentTarget.contains(e.relatedTarget)||this.closeSelect()}closeSelect(){this.resetStyleSelect(),this.setState({open:!1})}resetStyleSelect(){this.setState({style:void 0})}handleInputChange(e){const t=e.target,s=t.value,n=t.name;this.setState({[n]:s})}handleItemClick(e){if(this.setState({selectedValue:e.value,open:!1}),"function"==typeof this.props.onChange){const t={target:{value:e.value,name:this.props.name}};this.props.onChange(t)}this.closeSelect()}getItemsMatch(e,t){const s=t&&t.split(/\s+/)||[""];return e.filter(e=>s.every(t=>((e,t)=>(e=>new RegExp((e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))(e),"i"))(e).test(t))(t,e.label)))}handleSelectKeyDown(e){switch(e.keyCode){case 13:return e.stopPropagation(),void this.handleSelectClick();case 40:return e.preventDefault(),e.stopPropagation(),void(this.state.open?this.focusItem(0):this.handleSelectClick());case 38:return e.preventDefault(),e.stopPropagation(),void(this.state.open?this.focusItem(this.listItemsFiltered.length-1):this.handleSelectClick());case 27:return e.stopPropagation(),void this.closeSelect();default:return}}focusItem(e){this.itemsRef.current.childNodes[e]?.focus()}handleItemKeyDown(e,t){switch(e.keyCode){case 13:return e.stopPropagation(),void this.handleItemClick(t);case 40:return e.stopPropagation(),e.preventDefault(),void(e.target.nextSibling?e.target.nextSibling.focus():this.focusItem(0));case 38:return e.stopPropagation(),e.preventDefault(),void(e.target.previousSibling?e.target.previousSibling.focus():this.focusItem(this.listItemsFiltered.length-1));default:return}}hasFilteredItems(){return this.listItemsFiltered.length>0}render(){return n.createElement("div",{className:`select-container ${this.props.className}`,style:{width:this.state.style?.width,height:this.state.style?.height}},n.createElement("div",{onKeyDown:this.handleSelectKeyDown,onBlur:this.handleBlur,id:this.props.id,className:`select ${this.props.direction} ${this.state.open?"open":""}`,style:this.state.style},n.createElement("div",{ref:this.selectedItemRef,className:"selected-value "+(this.props.disabled?"disabled":""),tabIndex:this.props.disabled?-1:0,onClick:this.handleSelectClick},n.createElement("span",{className:"value"},this.selectedItemLabel),n.createElement(te,null)),n.createElement("div",{ref:this.selectItemsRef,className:"select-items "+(this.state.open?"visible":"")},this.props.search&&n.createElement(n.Fragment,null,n.createElement("input",{className:"search-input",name:"search",value:this.state.search,onChange:this.handleInputChange,type:"text"}),n.createElement(An,{className:"search"})),n.createElement("ul",{ref:this.itemsRef,className:"items"},this.hasFilteredItems()&&this.listItemsFiltered.map(e=>n.createElement("li",{tabIndex:e.disabled?-1:0,key:e.value,title:e.title,className:`option ${e.value}`,onKeyDown:t=>this.handleItemKeyDown(t,e),onClick:()=>this.handleItemClick(e)},e.label)),!this.hasFilteredItems()&&this.props.search&&n.createElement("li",{className:"option no-results"},n.createElement(I.x,null,"No results match")," ",n.createElement("span",null,this.state.search))))))}}Cn.defaultProps={id:"",name:"select",className:"",direction:"bottom"},Cn.propTypes={id:c().string,name:c().string,className:c().string,direction:c().oneOf(Object.values({top:"top",bottom:"bottom",left:"left",right:"right"})),search:c().bool,items:c().array,value:Tn.allPropTypes(c().oneOfType([c().string,c().number,c().bool]),(e,t,s)=>{const n=e[t],i=e.items;if(null!==n&&i.length>0&&i.every(e=>e.value!==n))return new Error(`Invalid prop ${t} passed to ${s}. Expected the value ${n} in items.`)}),disabled:c().bool,onChange:c().func};const Rn=(0,P.C)("common")(Cn);class qn extends n.Component{constructor(e){super(e),this.state=this.defaultState,this.bindHandlers()}componentDidMount(){this.initLocale()}componentDidUpdate(e){this.handleLocaleChange(e.context.locale)}handleLocaleChange(e){this.props.context.locale!==e&&this.setState({locale:this.props.context.locale})}get defaultState(){return{loading:!0,locale:null,processing:!1}}get areActionsAllowed(){return!this.state.processing}bindHandlers(){this.handleLocaleInputChange=this.handleLocaleInputChange.bind(this)}async handleLocaleInputChange(e){const t=e.target.value;this.updateLocale(t)}async updateLocale(e){this.setState({processing:!0}),await this.props.context.onUpdateLocaleRequested(e),this.setState({processing:!1})}initLocale(){this.setState({locale:this.props.context.locale,loading:!1})}isLoading(){return this.state.loading}get supportedLocales(){return this.props.context.siteSettings.supportedLocales?this.props.context.siteSettings.supportedLocales.map(e=>({value:e.locale,label:e.label})):[]}render(){return n.createElement(n.Fragment,null,!this.isLoading()&&n.createElement("div",{className:"select-wrapper input"},n.createElement(Rn,{id:"user-locale-input",className:"setup-extension",name:"locale",value:this.state.locale,disabled:!this.areActionsAllowed,items:this.supportedLocales,onChange:this.handleLocaleInputChange})))}}qn.propTypes={context:c().any};const Nn=a(qn);class kn extends n.Component{get statesToHideLocaleSwitch(){return[N.INITIAL_STATE]}get mustDisplayLocaleSwitch(){return!this.statesToHideLocaleSwitch.includes(this.props.apiSetupContext.state)}render(){return n.createElement(n.Fragment,null,this.mustDisplayLocaleSwitch&&n.createElement(Nn,null))}}kn.propTypes={apiSetupContext:c().any};const _n=q(kn);var On,In,Pn,Dn,Un;function Gn(){return Gn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)({}).hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},Gn.apply(null,arguments)}const Ln=function(e){return n.createElement("svg",Gn({xmlns:"http://www.w3.org/2000/svg",width:151,height:27,fill:"none","aria-labelledby":"logo-title logo-description",viewBox:"0 0 151 27"},e),On||(On=n.createElement("title",{id:"logo-title"},"Passbolt logo")),In||(In=n.createElement("desc",{id:"logo-description"},"This is the logo of passbolt.")),Pn||(Pn=n.createElement("path",{fill:"var(--icon-color)",d:"M4.648 9.234v8.607h2.48c1.646 0 2.786-.349 3.47-1.012.685-.664 1.013-1.823 1.013-3.395 0-1.52-.305-2.595-.938-3.218-.633-.673-1.695-.972-3.24-.972zM.597 5.963h7.797c2.357 0 4.178.676 5.496 2.048q1.976 2.058 1.974 5.689a8.6 8.6 0 0 1-.406 2.749 7.1 7.1 0 0 1-1.24 2.278 5.9 5.9 0 0 1-2.38 1.773c-.937.349-2.152.524-3.697.524H4.648V26.5H.597zM24.016 18.016h5.064v-3.119h-4.76c-.937 0-1.594.124-1.95.375-.357.25-.517.698-.517 1.321 0 .524.15.899.429 1.122.28.223.848.301 1.734.301M18.649 5.963h8.268c2.103 0 3.672.476 4.736 1.423 1.065.947 1.594 2.347 1.594 4.217v9.456H22.37c-1.52 0-2.708-.375-3.52-1.121-.81-.747-1.2-1.823-1.2-3.22 0-1.722.454-2.945 1.392-3.692s2.483-1.134 4.697-1.134h5.315v-.365c0-.898-.276-1.518-.809-1.896-.532-.377-1.47-.55-2.86-.55H18.65zM36.55 17.915h8.525c.76 0 1.318-.124 1.646-.35.183-.122.328-.29.423-.486.094-.197.134-.414.115-.63a1.2 1.2 0 0 0-.112-.632 1.24 1.24 0 0 0-.42-.492c-.355-.253-.91-.374-1.646-.374h-3.494c-2.067 0-3.467-.325-4.203-.947-.737-.623-1.088-1.747-1.088-3.32 0-1.62.431-2.82 1.318-3.592.886-.772 2.255-1.152 4.064-1.152h8.684v3.142h-7.134q-1.75 0-2.279.301c-.354.198-.532.547-.532 1.071-.017.193.016.387.096.564s.204.332.361.449c.302.223.809.324 1.468.324h3.676c1.672 0 2.961.397 3.824 1.172s1.315 1.871 1.315 3.32c0 1.397-.405 2.53-1.188 3.417-.37.427-.833.768-1.354.996-.522.23-1.09.34-1.661.325H36.549zM53.822 17.915h8.526c.76 0 1.318-.124 1.646-.35a1.23 1.23 0 0 0 .42-.487c.093-.196.132-.413.112-.629a1.2 1.2 0 0 0-.111-.632 1.24 1.24 0 0 0-.421-.492c-.354-.253-.91-.374-1.646-.374h-3.493c-2.067 0-3.467-.325-4.204-.947-.736-.623-1.088-1.752-1.088-3.324 0-1.62.432-2.82 1.318-3.593.886-.772 2.253-1.147 4.075-1.147h8.686v3.142h-7.141q-1.747 0-2.28.301c-.353.198-.531.547-.531 1.071-.017.193.016.387.096.564s.204.332.361.449c.302.223.809.324 1.468.324h3.671c1.672 0 2.963.397 3.824 1.172s1.315 1.871 1.315 3.32c0 1.397-.403 2.53-1.188 3.417-.37.427-.832.767-1.354.996a3.9 3.9 0 0 1-1.66.325H53.769v-3.106zM75.387.5v5.463h3.47c1.55 0 2.759.175 3.694.55.946.362 1.77.976 2.38 1.772a7.2 7.2 0 0 1 1.243 2.296c.281.888.417 1.814.403 2.744q0 3.63-1.974 5.689c-1.315 1.372-3.14 2.046-5.493 2.046h-7.8V.5zm2.462 8.734h-2.483v8.608h2.785c1.55 0 2.633-.324 3.243-.95s.935-1.721.935-3.268-.354-2.694-1.033-3.367c-.68-.673-1.832-1.023-3.447-1.023M92.3 13.525c0 1.445.328 2.532 1.013 3.367s1.62 1.198 2.86 1.198 2.152-.398 2.863-1.198 1.033-1.921 1.033-3.367-.356-2.547-1.033-3.344c-.677-.798-1.62-1.198-2.863-1.198a3.64 3.64 0 0 0-1.57.279 3.6 3.6 0 0 0-1.29.919c-.685.797-1.013 1.921-1.013 3.344m12.002 0q0 3.544-2.202 5.689c-1.47 1.397-3.42 2.121-5.901 2.121s-4.457-.699-5.924-2.121-2.202-3.292-2.202-5.664q0-3.558 2.202-5.69c1.467-1.424 3.444-2.145 5.919-2.145s4.431.724 5.901 2.144 2.207 3.294 2.207 5.666M110.935 21.06h-4.202V.5h4.202zM112.884 5.963h2.86V.5h4.052v5.463h4.278v3.02h-4.278v6.09c0 1.12.204 1.895.581 2.343.377.449 1.064.649 2.026.649h1.671v3.02h-3.72c-1.494 0-2.636-.4-3.444-1.223-.809-.823-1.189-1.995-1.189-3.519v-7.36h-2.863v-3.02z"})),Dn||(Dn=n.createElement("path",{fill:"#D40101",d:"m149.951 10.68-9.059-8.36a2.12 2.12 0 0 0-1.421-.543c-.526 0-1.033.194-1.421.544l-5.684 5.268c.745.271 1.414.71 1.952 1.282.539.572.933 1.26 1.149 2.01h7.673a.73.73 0 0 1 .504.204.69.69 0 0 1 .207.494v1.147a.68.68 0 0 1-.207.494.72.72 0 0 1-.504.204h-.886v1.623a.68.68 0 0 1-.205.494.72.72 0 0 1-.503.205h-1.945a.73.73 0 0 1-.503-.205.69.69 0 0 1-.205-.494v-1.623h-3.426a4.84 4.84 0 0 1-1.135 2.033 5 5 0 0 1-1.966 1.287l5.71 5.276c.388.349.895.543 1.421.543a2.12 2.12 0 0 0 1.421-.543l9.043-8.355a2.03 2.03 0 0 0-.01-2.985"})),Un||(Un=n.createElement("path",{fill:"#D40101",d:"M130.683 9.867a2.6 2.6 0 0 0-1.064.253c-.371.18-.686.455-.913.794a2.242 2.242 0 0 0-.113 2.305 2.3 2.3 0 0 0 .831.877 2.36 2.36 0 0 0 2.355.059c.362-.197.664-.484.875-.833a2.24 2.24 0 0 0 .324-1.153 2.21 2.21 0 0 0-.653-1.625 2.3 2.3 0 0 0-.751-.5 2.3 2.3 0 0 0-.891-.177"})))};class Mn extends n.Component{constructor(e){super(e),this.state=this.defaultState,this.userId=null,this.token=null,this.initializeProperties()}get defaultState(){return{siteSettings:null,trustedDomain:this.baseUrl,getApiClientOptions:this.getApiClientOptions.bind(this),locale:null,onUpdateLocaleRequested:this.onUpdateLocaleRequested.bind(this)}}async componentDidMount(){const e=await this.getSiteSettings();this.initLocale(e)}initializeProperties(){const e="[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[0-5][a-fA-F0-9]{3}-[089aAbB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}",t=new RegExp(`setup/(install|start)/(${e})/(${e})$`),s=window.location.pathname.match(t);s?(this.userId=s[2],this.token=s[3]):console.error("Unable to retrieve the user id and token from the url")}get baseUrl(){const e=document.getElementsByTagName("base")&&document.getElementsByTagName("base")[0];return e?e.attributes.href.value.replace(/\/*$/g,""):(console.error("Unable to retrieve the page base tag"),"")}getApiClientOptions(){return(new k).setBaseUrl(this.state.trustedDomain)}async getSiteSettings(){const e=this.getApiClientOptions().setResourceName("settings"),t=new y(e),{body:s}=await t.findAll(),n=new En(s);return this.setState({siteSettings:n}),n}initLocale(e){const t=this.getUrlLocale(e)||this.getBrowserLocale(e)||this.getBrowserSimilarLocale(e)||e.locale;this.setState({locale:t}),this.setUrlLocale(t)}getUrlLocale(e){const t=new URL(window.location.href).searchParams.get("locale");if(t){const s=e.supportedLocales.find(e=>t===e.locale);if(s)return s.locale}}getBrowserLocale(e){const t=e.supportedLocales.find(e=>navigator.language===e.locale);if(t)return t.locale}getBrowserSimilarLocale(e){const t=navigator.language.split("-")[0],s=e.supportedLocales.find(e=>t===e.locale.split("-")[0]);if(s)return s.locale}onUpdateLocaleRequested(e){this.setState({locale:e}),this.setUrlLocale(e)}setUrlLocale(e){const t=new URL(window.location.href);t.searchParams.set("locale",e),window.history.replaceState(null,null,t)}isReady(){return null!==this.state.siteSettings&&null!==this.state.locale}render(){return n.createElement(o.Provider,{value:this.state},this.isReady()&&n.createElement(Sn,{loadingPath:`${this.state.trustedDomain}/locales/{{lng}}/{{ns}}.json`},n.createElement(R,{value:{userId:this.userId,token:this.token}},n.createElement("div",{id:"container",className:"container page login"},n.createElement("div",{className:"content"},n.createElement("div",{className:"header"},n.createElement("div",{className:"logo-svg"},n.createElement(Ln,{role:"img",width:"20rem",height:"3.5rem"}))),n.createElement("div",{className:"login-form"},n.createElement(ht,null)),n.createElement(_n,null)),n.createElement(ln,null)))))}}const Fn=Mn,$n=document.createElement("div");document.body.appendChild($n),(0,i.H)($n).render(n.createElement(Fn,null))}};const t={};function s(n){const i=t[n];if(void 0!==i)return i.exports;const r=t[n]={exports:{}};return e[n].call(r.exports,r,r.exports,s),r.exports}s.m=e,(()=>{const e=[];s.O=(t,n,i)=>{if(!n){for(var r=0;r<e.length;r++){let[n,i]=e[r],o=!0;for(var a=0;a<n.length;a++)s.O.j(n[a])?n.splice(a--,1):o=!1;if(o){e.splice(r--,1);const s=i();void 0!==s&&(t=s)}}return t}e.push([n,i])}})(),s.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.cw=e=>{var t;return()=>{if(e){var s=e;e=0,t={exports:{}},s.call(t.exports,t,t.exports)}return t.exports}},s.d=(e,t)=>{if(Array.isArray(t))for(var n=0;n<t.length;){var i=t[n++],r=t[n++],a=0===r?{enumerable:!0,value:t[n++]}:{enumerable:!0,get:r};s.o(e,i)||Object.defineProperty(e,i,a)}else for(var i in t)s.o(t,i)&&!s.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.j=7793,s.dn=e=>{var t=Object.getOwnPropertyDescriptor(e,"name");(!t||!t.writable&&t.configurable)&&Object.defineProperty(e,"name",{value:"default",configurable:!0})},(()=>{const e={7793:0};s.O.j=t=>0===e[t];const t=(t,n)=>{let[i,r,a]=n;var o,l,c=0;if(i.some(t=>0!==e[t])){for(o in r)s.o(r,o)&&(s.m[o]=r[o]);if(a)var d=a(s)}for(t&&t(n);c<i.length;c++)l=i[c],s.o(e,l)&&e[l]&&e[l][0](),e[l]=0;return s.O(d)},n=self.webpackChunkpassbolt_styleguide=self.webpackChunkpassbolt_styleguide||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();let n=s.O(void 0,[3847],()=>s(19375));n=s.O(n)})();
|
|
2
|
+
(()=>{"use strict";var e={19375(e,t,s){var n=s(96540),i=s(5338);const r=n.createContext({user:null,users:null,roles:null,rememberMeOptions:{},resources:null,resource:null,shareResources:null,selectedResources:null,selectedUser:null,folders:null,resourceCommentId:null,mustRefreshComments:!1,siteSettings:null,userSettings:null,onCheckIsAuthenticatedRequested:null});function a(e){return class extends n.Component{render(){return n.createElement(r.Consumer,null,t=>n.createElement(e,{context:t,...this.props}))}}}const o=r;var l=s(5556),c=s.n(l);class d extends Error{constructor(e,t){super(e),this.name="PassboltApiFetchError",this.data=t||{}}}const h=d;class p extends Error{constructor(){super("An internal error occurred. The server response could not be parsed. Please contact your administrator."),this.name="PassboltBadResponseError"}}const u=p;class m extends Error{constructor(e){super(e=e||"The service is unavailable"),this.name="PassboltServiceUnavailableError"}}const g=m,E=["GET","POST","PUT","DELETE"];class y{constructor(e){if(this.options=e,!this.options.getBaseUrl())throw new TypeError("ApiClient constructor error: baseUrl is required.");if(!this.options.getResourceName())throw new TypeError("ApiClient constructor error: resourceName is required.");try{let e=this.options.getBaseUrl().toString();e.endsWith("/")&&(e=e.slice(0,-1));let t=this.options.getResourceName();t.startsWith("/")&&(t=t.slice(1)),t.endsWith("/")&&(t=t.slice(0,-1)),this.baseUrl=`${e}/${t}`,this.baseUrl=new URL(this.baseUrl)}catch(e){throw new TypeError("ApiClient constructor error: b.",{cause:e})}this.apiVersion="api-version=v2"}setApiVersion(e){if("string"!=typeof e)throw new TypeError("ApiClient.setApiVersion error: apiVersion should be a string.");this.apiVersion=`api-version=${e}`}getDefaultHeaders(){return{Accept:"application/json","content-type":"application/json"}}async buildFetchOptions(){const e=await this.options.getHeaders();return{credentials:"include",headers:{...this.getDefaultHeaders(),...e}}}async get(e,t){this.assertValidId(e);const s=this.buildUrl(`${this.baseUrl}/${e}`,t||{});return this.fetchAndHandleResponse("GET",s)}async delete(e,t,s,n){let i;this.assertValidId(e),void 0===n&&(n=!1),i=n?this.buildUrl(`${this.baseUrl}/${e}/dry-run`,s||{}):this.buildUrl(`${this.baseUrl}/${e}`,s||{});let r=null;return t&&(r=this.buildBody(t)),this.fetchAndHandleResponse("DELETE",i,r)}async findAll(e){const t=this.buildUrl(this.baseUrl.toString(),e||{});return this.fetchAndHandleResponse("GET",t)}async create(e,t){const s=this.buildUrl(this.baseUrl.toString(),t||{}),n=this.buildBody(e);return this.fetchAndHandleResponse("POST",s,n)}async update(e,t,s,n){let i;this.assertValidId(e),void 0===n&&(n=!1),i=n?this.buildUrl(`${this.baseUrl}/${e}/dry-run`,s||{}):this.buildUrl(`${this.baseUrl}/${e}`,s||{});let r=null;return t&&(r=this.buildBody(t)),this.fetchAndHandleResponse("PUT",i,r)}async updateAll(e,t={}){const s=this.buildUrl(this.baseUrl.toString(),t),n=e?this.buildBody(e):null;return this.fetchAndHandleResponse("PUT",s,n)}assertValidId(e){if(!e)throw new TypeError("ApiClient.assertValidId error: id cannot be empty");if("string"!=typeof e)throw new TypeError("ApiClient.assertValidId error: id should be a string")}assertMethod(e){if("string"!=typeof e)throw new TypeError("ApiClient.assertValidMethod method should be a string.");if(E.indexOf(e.toUpperCase())<0)throw new TypeError(`ApiClient.assertValidMethod error: method ${e} is not supported.`)}assertUrl(e){if(!e)throw new TypeError("ApliClient.assertUrl error: url is required.");if(!(e instanceof URL))throw new TypeError("ApliClient.assertUrl error: url should be a valid URL object.");if("https:"!==e.protocol&&"http:"!==e.protocol)throw new TypeError("ApliClient.assertUrl error: url protocol should only be https or http.")}assertBody(e){if(!(e instanceof FormData)&&"string"!=typeof e)throw new TypeError("ApiClient.assertBody error: body should be a string or a FormData.")}buildBody(e){return JSON.stringify(e)}buildUrl(e,t){if("string"!=typeof e)throw new TypeError("ApiClient.buildUrl error: url should be a string.");const s=new URL(`${e}.json?${this.apiVersion}`);t=t||{};for(const[e,n]of Object.entries(t)){if("string"!=typeof e)throw new TypeError("ApiClient.buildUrl error: urlOptions key should be a string.");if("string"==typeof n)s.searchParams.append(e,n);else{if(!Array.isArray(n))throw new TypeError("ApiClient.buildUrl error: urlOptions value should be a string or array.");n.forEach(t=>{s.searchParams.append(e,t)})}}return s}async sendRequest(e,t,s,n){this.assertUrl(t),this.assertMethod(e),s&&this.assertBody(s);const i="undefined"!=typeof customApiClientFetch?customApiClientFetch:fetch,r={...await this.buildFetchOptions(),...n};r.method=e,s&&(r.body=s);try{return await i(t.toString(),r)}catch(e){throw console.error(e),navigator.onLine?new g("Unable to reach the server, an unexpected error occurred"):new g("Unable to reach the server, you are not connected to the network")}}async fetchAndHandleResponse(e,t,s,n){const i=await this.sendRequest(e,t,s,n);return this.parseResponseJson(i)}async parseResponseJson(e){let t;try{t=await e.json()}catch(t){throw console.debug(e.url.toString(),t),new u(t,e)}if(!e.ok){const s=t.header.message;throw new h(s,{header:t.header,code:e.status,body:t.body})}return t}}const b="chrome",f="edge",v="firefox",S="safari";function T(){const e=window.navigator.userAgent.toLowerCase();let t;return t=e.indexOf("firefox")>-1?v:e.indexOf("samsungbrowser")>-1?"samsung":e.indexOf("opera")>-1||e.indexOf("opr")>-1?"opera":e.indexOf("trident")>-1?"internet-explorer":e.indexOf("edg")>-1?f:e.indexOf("chrome")>-1?b:e.indexOf("safari")>-1?S:"unknown",t}const w=class{constructor(e){e.setResourceName("auth"),this.apiClient=new y(e)}async logout(){const e=this.apiClient.buildUrl(`${this.apiClient.baseUrl}/logout`,{}),t=await this.apiClient.sendRequest("POST",e,null,{redirect:"manual"});if(!t.ok&&0!==t.status)return this._logoutLegacy()}async _logoutLegacy(){const e=this.apiClient.buildUrl(`${this.apiClient.baseUrl}/logout`,{}),t=await this.apiClient.sendRequest("GET",e,null,{redirect:"manual"});if(!t.ok&&0!==t.status)throw new h("An unexpected error happened during the legacy logout process",{code:t.status})}};class x{static reload(){window.location.reload()}static assign(e){window.location.assign(e)}static getHostname(){return window.location.hostname}}const A=n.createContext({userId:null,token:null,state:null,unexpectedError:null,onInitializeSetupRequested:()=>{},logoutUserAndRefresh:()=>{}});class C extends n.Component{constructor(e){super(e),this.state=Object.assign(this.defaultState,e.value),this.authLogoutService=new w(e.context.getApiClientOptions())}get defaultState(){return{userId:null,token:null,state:N.INITIAL_STATE,unexpectedError:null,onInitializeSetupRequested:this.onInitializeSetupRequested.bind(this),logoutUserAndRefresh:this.logoutUserAndRefresh.bind(this),handleSafariExtensionDownloading:this.handleSafariExtensionDownloading.bind(this),handleSafariExtensionNotDownloaded:this.handleSafariExtensionNotDownloaded.bind(this),handleExtensionAlreadyInstalled:this.handleExtensionAlreadyInstalled.bind(this)}}async onInitializeSetupRequested(){return this.state.userId&&this.state.token?this.isBrowserSupported()?void await this.startSetup().then(this.handleStartSetupSuccess.bind(this)).catch(this.handleStartSetupError.bind(this)):this.setState({state:N.DOWNLOAD_SUPPORTED_BROWSER_STATE}):this.setState({state:N.REQUEST_INVITATION_ERROR})}handleStartSetupSuccess(){const e=T()===S?N.INSTALL_SAFARI_EXTENSION_STATE:N.INSTALL_EXTENSION_STATE;this.setState({state:e})}handleSafariExtensionDownloading(){const e=N.CONFIGURE_SAFARI_EXTENSION_STATE;this.setState({state:e})}handleSafariExtensionNotDownloaded(){const e=N.INSTALL_SAFARI_EXTENSION_STATE;this.setState({state:e})}handleExtensionAlreadyInstalled(){const e=N.CONFIGURE_SAFARI_EXTENSION_STATE;this.setState({state:e})}async logoutUserAndRefresh(){try{await this.authLogoutService.logout()}catch(e){const t=new g(e.message);return this.setState({unexpectedError:t,state:N.UNEXPECTED_ERROR_STATE})}x.reload()}handleStartSetupError(e){if(e instanceof h){if(403===e.data.code)return this.setState({state:N.ERROR_ALREADY_SIGNED_IN_STATE});const t=Boolean(e.data.body?.token?.expired),s=Boolean(e.data.body?.token?.isActive);if(t||s)return this.setState({state:N.TOKEN_EXPIRED_STATE});if(400===e?.data?.code)return this.setState({state:N.REQUEST_INVITATION_ERROR})}return this.setState({state:N.UNEXPECTED_ERROR_STATE})}isBrowserSupported(){const e=T(),t=[b,v,f];return this.props.context.siteSettings.canIUse("safari")&&t.push(S),t.includes(e)}async startSetup(){const e=this.props.context.getApiClientOptions();e.setResourceName("setup");const t=new y(e),{body:s}=await t.get(`install/${this.state.userId}/${this.state.token}`);return s}render(){return n.createElement(A.Provider,{value:this.state},this.props.children)}}C.propTypes={context:c().any,value:c().any,children:c().any};const R=a(C);function q(e){return class extends n.Component{render(){return n.createElement(A.Consumer,null,t=>n.createElement(e,{apiSetupContext:t,...this.props}))}}}const N={INITIAL_STATE:"Initial state",DOWNLOAD_SUPPORTED_BROWSER_STATE:"Download supported browser state",INSTALL_EXTENSION_STATE:"Install extension state",INSTALL_SAFARI_EXTENSION_STATE:"Install Safari extension state",CONFIGURE_SAFARI_EXTENSION_STATE:"Configure Safari extension state",TOKEN_EXPIRED_STATE:"Token expired state",ERROR_ALREADY_SIGNED_IN_STATE:"Error, already signed in state",REQUEST_INVITATION_ERROR:"Request inviration error state",UNEXPECTED_ERROR_STATE:"Unexpected error state"};class k{setBaseUrl(e){if(!e)throw new TypeError("ApiClientOption baseUrl is required.");if("string"==typeof e)try{this.baseUrl=new URL(e)}catch(e){throw new TypeError("ApiClientOption baseUrl is invalid.",{cause:e})}else{if(!(e instanceof URL))throw new TypeError("ApiClientOptions baseurl should be a string or URL");this.baseUrl=e}return this}setResourceName(e){if(!e)throw new TypeError("ApiClientOptions.setResourceName resourceName is required.");if("string"!=typeof e)throw new TypeError("ApiClientOptions.setResourceName resourceName should be a valid string.");return this.resourceName=e,this}getBaseUrl(){return this.baseUrl}getResourceName(){return this.resourceName}async getHeaders(){const e=await this.getCsrfToken();if(e)return{"X-CSRF-Token":e}}async getCsrfToken(){if("undefined"==typeof browser||void 0===browser.cookies){const e=document?.cookie?.split("; ")?.find(e=>e.startsWith("csrfToken"))?.split("=");return e&&2===e.length?e[1]:null}const e=this.baseUrl.toString(),t="/"===e.slice(-1)?e:`${e}/`,s=await browser.cookies.get({name:"csrfToken",url:t});return s?.value||null}}var _,O,I=s(91352),P=s(13279);function D(){return D=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)({}).hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},D.apply(null,arguments)}const U=function(e){return n.createElement("svg",D({width:18,height:18,fill:"none",className:"svg-icon spinner",viewBox:"0 0 18 18"},e),_||(_=n.createElement("circle",{id:"background",cx:8,cy:8,r:8,fill:"none",stroke:"var(--spinner-background)",strokeWidth:"var(--spinner-stroke-width)",transform:"translate(1 1)"})),O||(O=n.createElement("circle",{id:"loading",r:8,fill:"none",stroke:"var(--spinner-color)",strokeLinecap:"round",strokeWidth:"var(--spinner-stroke-width)",transform:"translate(9 9)"})))};class G extends n.Component{render(){return n.createElement("div",{className:"login-processing"},n.createElement("h1",null,this.props.title),n.createElement("div",{className:"processing-wrapper"},n.createElement(U,null)))}}G.propTypes={title:c().oneOfType([c().arrayOf(c().node),c().node,c().string])},G.defaultProps={title:n.createElement(I.x,null,"Please wait...")};const L=(0,P.C)("common")(G),M="https://download.passbolt.com/extension/chrome";class F extends n.Component{constructor(e){super(e),this.state=this.getDefaultState(),this.bindCallbacks()}getDefaultState(){const e=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";return{browserName:T(),theme:e}}bindCallbacks(){this.handleRefreshClick=this.handleRefreshClick.bind(this)}get browserStoreThumbnailUrl(){const e="dark"===this.state.theme?"white":"black";switch(this.state.browserName){case v:return`${this.props.context.trustedDomain}/img/third_party/FirefoxAMO_${e}.svg`;case f:return`${this.props.context.trustedDomain}/img/third_party/edge-addon-${e}.svg`;default:return`${this.props.context.trustedDomain}/img/third_party/ChromeWebStore_${e}.svg`}}get storeUrl(){switch(this.state.browserName){case b:return M;case v:return"https://addons.mozilla.org/firefox/addon/passbolt";case f:return"https://microsoftedge.microsoft.com/addons/detail/passbolt-extension/ljeppgjhohmhpbdhjjjbiflabdgfkhpo";default:return M}}get storeClassName(){return`browser-webstore ${this.state.browserName}`}handleRefreshClick(){x.reload()}render(){return n.createElement("div",{className:"install-extension"},n.createElement("h1",null,n.createElement(I.x,null,"Please install the browser extension.")),n.createElement("p",null,n.createElement(I.x,null,"Please download the browser extension and refresh this page to continue.")),this.state.browserName&&n.createElement("a",{href:this.storeUrl,className:this.storeClassName,target:"_blank",rel:"noopener noreferrer"},n.createElement("img",{src:this.browserStoreThumbnailUrl,alt:"browser store thumbnail"})),n.createElement("div",{className:"form-actions"},n.createElement("a",{href:this.storeUrl,className:"button primary big full-width",role:"button",target:"_blank",rel:"noopener noreferrer"},n.createElement(I.x,null,"Download extension")),n.createElement("button",{className:"link",type:"button",onClick:this.handleRefreshClick},n.createElement(I.x,null,"Refresh to detect extension"))))}}F.propTypes={context:c().any};const $=a((0,P.C)("common")(F));class V extends n.Component{constructor(e){super(e),this.state=this.getDefaultState()}getDefaultState(){return{selectedBrowser:this.compatibleBrowserList[0]}}handleBrowserButtonClick(e){this.setState({selectedBrowser:e})}get compatibleBrowserList(){const e=[{name:"Mozilla Firefox",img:"firefox.svg",url:"https://www.mozilla.org/"},{name:"Google Chrome",img:"chrome.svg",url:"https://www.google.com/chrome/"},{name:"Microsoft Edge",img:"edge.svg",url:"https://www.microsoft.com/edge"},{name:"Brave",img:"brave.svg",url:"https://www.brave.com/"},{name:"Vivaldi",img:"vivaldi.svg",url:"https://www.vivaldi.com/"}];return this.props.context.siteSettings.canIUse("safari")&&e.push({name:"Safari",img:"safari.svg",url:"https://www.apple.com/safari/"}),e}render(){return n.createElement("div",{className:"browser-not-supported"},n.createElement("h1",null,n.createElement(I.x,null,"Sorry, your browser is not supported.")),n.createElement("p",null,n.createElement(I.x,null,"Please download one of these browsers to get started with passbolt:")),n.createElement("div",{className:"browser-button-list"},this.compatibleBrowserList.map((e,t)=>n.createElement("button",{key:t,className:"browser"+(e.name===this.state.selectedBrowser.name?" focused":""),target:"_blank",onClick:()=>this.handleBrowserButtonClick(e)},n.createElement("img",{src:`${this.props.context.trustedDomain}/img/third_party/${e.img}`})))),n.createElement("div",{className:"form-actions"},n.createElement("a",{href:this.state.selectedBrowser.url,rel:"noopener noreferrer",className:"button primary big full-width",role:"button",target:"_blank"},n.createElement(I.x,null,"Download ",{browserName:this.state.selectedBrowser.name}))))}}V.propTypes={context:c().any};const K=a((0,P.C)("common")(V));class B extends n.Component{render(){return n.createElement("div",{className:"setup-error"},n.createElement("h1",null,n.createElement(I.x,null,"Access to this service requires an invitation.")),n.createElement("p",null,n.createElement(I.x,null,"This email is not associated with any approved users on this domain.")," ",n.createElement(I.x,null,"Please contact your administrator to request an invitation link.")),n.createElement("div",{className:"form-actions"},n.createElement("a",{href:`${this.props.context.trustedDomain}/users/recover`,className:"button primary big full-width",role:"button",rel:"noopener noreferrer"},n.createElement(I.x,null,"Try with another email"))))}}B.propTypes={context:c().any};const j=a((0,P.C)("common")(B));class z extends n.Component{render(){return n.createElement("div",{className:"setup-error"},n.createElement("h1",null,n.createElement(I.x,null,"The invitation is expired.")),n.createElement("p",null,n.createElement(I.x,null,"You can request another invitation email by clicking on the button below.")),n.createElement("div",{className:"form-actions"},n.createElement("a",{href:`${this.props.context.trustedDomain}/users/recover`,className:"button primary big full-width",role:"button",rel:"noopener noreferrer"},n.createElement(I.x,null,"Request invitation"))))}}z.propTypes={context:c().any};const H=a((0,P.C)("common")(z)),W="setup",Y="recover",Z="account-recovery";class X extends n.Component{render(){return n.createElement("div",{className:"setup-error"},n.createElement("h1",null,n.createElement(I.x,null,"Cannot perform the action while being logged in")),n.createElement("p",null,{[W]:n.createElement(I.x,null,"It is not possible to perform a setup of a new account as you are still logged in. You need to log out first before continuing."),[Y]:n.createElement(I.x,null,"It is not possible to perform the recovery of your account as you are still logged in. You need to log out first before continuing."),[Z]:n.createElement(I.x,null,"It is not possible to recover your private key of your account as you are still logged in. You need to log out first before continuing.")}[this.props.displayAs]),n.createElement("div",{className:"form-actions"},n.createElement("button",{onClick:this.props.onLogoutButtonClick.bind(this),className:"button primary big full-width",role:"button"},n.createElement(I.x,null,"Sign out"))))}}X.propTypes={displayAs:c().oneOf([W,Y,Z]).isRequired,onLogoutButtonClick:c().func.isRequired};const J=(0,P.C)("common")(X);var Q;function ee(){return ee=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)({}).hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},ee.apply(null,arguments)}const te=function(e){return n.createElement("svg",ee({xmlns:"http://www.w3.org/2000/svg",width:10,height:8,fill:"none",viewBox:"0 0 10 8"},e),Q||(Q=n.createElement("path",{stroke:"var(--icon-color)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m1 2 4 4 4-4"})))};var se;function ne(){return ne=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)({}).hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},ne.apply(null,arguments)}const ie=function(e){return n.createElement("svg",ne({xmlns:"http://www.w3.org/2000/svg",width:8,height:10,fill:"none",viewBox:"0 0 8 10"},e),se||(se=n.createElement("path",{stroke:"var(--icon-color)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m2 9 4-4-4-4"})))};class re extends n.Component{constructor(e){super(e),this.state=this.defaultState,this.bindCallbacks()}get defaultState(){return{showErrorDetails:!1}}bindCallbacks(){this.handleErrorDetailsToggle=this.handleErrorDetailsToggle.bind(this)}onClick(){this.props.context.port?this.props.context.port.request("passbolt.tab.reload"):x.reload()}handleErrorDetailsToggle(){this.setState({showErrorDetails:!this.state.showErrorDetails})}get hasErrorDetails(){const e=this.props?.error;return Boolean(e?.details)||Boolean(e?.data?.body)}formatErrors(){const e=this.props.error?.details||this.props.error?.data;return JSON.stringify(e,null,4)}render(){return n.createElement("div",{className:"setup-error"},n.createElement("h1",null,this.props.title),n.createElement("p",null,this.props.message),n.createElement("p",null,this.props.error&&this.props.error.message),this.hasErrorDetails&&n.createElement("div",{className:"accordion error-details"},n.createElement("div",{className:"accordion-header"},n.createElement("button",{className:"no-border",type:"button",onClick:this.handleErrorDetailsToggle},this.state.showErrorDetails?n.createElement(te,{className:"caret-down"}):n.createElement(ie,{className:"caret-right"}),n.createElement("span",null,n.createElement(I.x,null,"Error details")))),this.state.showErrorDetails&&n.createElement("div",{className:"accordion-content"},n.createElement("div",{className:"input text"},n.createElement("label",{htmlFor:"js_field_debug",className:"visuallyhidden"},n.createElement(I.x,null,"Error details")),n.createElement("textarea",{id:"js_field_debug",defaultValue:`${this.formatErrors()}`,readOnly:!0})))),n.createElement("div",{className:"form-actions"},n.createElement("button",{onClick:this.onClick.bind(this),className:"button primary big full-width",role:"button"},n.createElement(I.x,null,"Try again"))))}}re.defaultProps={title:n.createElement(I.x,null,"Something went wrong!"),message:n.createElement(I.x,null,"The operation failed with the following error:")},re.propTypes={context:c().any,title:c().oneOfType([c().arrayOf(c().node),c().node,c().string]),message:c().oneOfType([c().arrayOf(c().node),c().node,c().string]),error:c().any};const ae=a((0,P.C)("common")(re));var oe,le;function ce(){return ce=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)({}).hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},ce.apply(null,arguments)}const de=function(e){return n.createElement("svg",ce({xmlns:"http://www.w3.org/2000/svg",id:"livetype",viewBox:"0 0 119.664 40"},e),oe||(oe=n.createElement("title",null,"Download_on_the_App_Store_Badge_US-UK_RGB_blk_4SVG_092917")),n.createElement("path",{d:"M110.135 0H9.535Q8.986 0 8.44.002q-.457.004-.919.013A13 13 0 0 0 5.517.19a6.7 6.7 0 0 0-1.9.627 6.4 6.4 0 0 0-1.62 1.18A6.3 6.3 0 0 0 .82 3.617a6.6 6.6 0 0 0-.625 1.903 13 13 0 0 0-.179 2.002c-.01.307-.01.615-.015.921V31.56c.005.31.006.61.015.921a13 13 0 0 0 .18 2.002 6.6 6.6 0 0 0 .624 1.905A6.2 6.2 0 0 0 1.998 38a6.3 6.3 0 0 0 1.618 1.179 6.7 6.7 0 0 0 1.901.63 13.5 13.5 0 0 0 2.004.177c.31.007.613.011.919.011.366.002.728.002 1.095.002h100.6c.36 0 .724 0 1.084-.002.304 0 .617-.004.922-.01a13 13 0 0 0 2-.178 6.8 6.8 0 0 0 1.908-.63A6.3 6.3 0 0 0 117.666 38a6.4 6.4 0 0 0 1.182-1.614 6.6 6.6 0 0 0 .619-1.905 13.5 13.5 0 0 0 .185-2.002c.004-.31.004-.61.004-.921.008-.364.008-.725.008-1.094V9.536q.002-.549-.008-1.092.001-.46-.004-.92a13.5 13.5 0 0 0-.185-2.003 6.6 6.6 0 0 0-.62-1.903 6.47 6.47 0 0 0-2.798-2.8 6.8 6.8 0 0 0-1.908-.627 13 13 0 0 0-2-.176c-.305-.005-.618-.011-.922-.013-.36-.002-.725-.002-1.084-.002Z",style:{fill:"#a6a6a6"}}),le||(le=n.createElement("path",{d:"M8.445 39.125c-.305 0-.602-.004-.904-.01a13 13 0 0 1-1.87-.164 5.9 5.9 0 0 1-1.656-.548 5.4 5.4 0 0 1-1.397-1.016 5.3 5.3 0 0 1-1.02-1.397 5.7 5.7 0 0 1-.544-1.657 12.4 12.4 0 0 1-.166-1.875c-.007-.21-.015-.913-.015-.913v-23.1s.009-.692.015-.895a12.4 12.4 0 0 1 .165-1.872 5.8 5.8 0 0 1 .544-1.662 5.4 5.4 0 0 1 1.015-1.398 5.6 5.6 0 0 1 1.402-1.023 5.8 5.8 0 0 1 1.653-.544A12.6 12.6 0 0 1 7.543.887l.902-.012h102.769l.913.013a12.4 12.4 0 0 1 1.858.162 6 6 0 0 1 1.671.548 5.6 5.6 0 0 1 2.415 2.42 5.8 5.8 0 0 1 .535 1.649 13 13 0 0 1 .174 1.887c.003.283.003.588.003.89.008.375.008.732.008 1.092v20.929c0 .363 0 .718-.008 1.075 0 .325 0 .623-.004.93a13 13 0 0 1-.17 1.853 5.7 5.7 0 0 1-.54 1.67 5.5 5.5 0 0 1-1.016 1.386 5.4 5.4 0 0 1-1.4 1.022 5.9 5.9 0 0 1-1.668.55 12.5 12.5 0 0 1-1.869.163c-.293.007-.6.011-.897.011l-1.084.002Z"})),n.createElement("g",{id:"_Group_","data-name":"<Group>"},n.createElement("g",{id:"_Group_2","data-name":"<Group>"},n.createElement("g",{id:"_Group_3","data-name":"<Group>"},n.createElement("path",{id:"_Path_",d:"M24.769 20.3a4.95 4.95 0 0 1 2.356-4.151 5.07 5.07 0 0 0-3.99-2.158c-1.68-.176-3.308 1.005-4.164 1.005-.872 0-2.19-.988-3.608-.958a5.32 5.32 0 0 0-4.473 2.728c-1.934 3.348-.491 8.269 1.361 10.976.927 1.325 2.01 2.805 3.428 2.753 1.387-.058 1.905-.885 3.58-.885 1.658 0 2.144.885 3.59.852 1.489-.025 2.426-1.332 3.32-2.67a11 11 0 0 0 1.52-3.092 4.78 4.78 0 0 1-2.92-4.4","data-name":"<Path>",style:{fill:"#fff"}}),n.createElement("path",{id:"_Path_2",d:"M22.037 12.21a4.87 4.87 0 0 0 1.115-3.49 4.96 4.96 0 0 0-3.208 1.66A4.64 4.64 0 0 0 18.8 13.74a4.1 4.1 0 0 0 3.237-1.53","data-name":"<Path>",style:{fill:"#fff"}}))),n.createElement("path",{d:"M42.302 27.14H37.57l-1.137 3.356h-2.005l4.484-12.418h2.083l4.483 12.418h-2.039Zm-4.243-1.55h3.752l-1.85-5.446h-.051ZM55.16 25.97c0 2.813-1.506 4.62-3.779 4.62a3.07 3.07 0 0 1-2.848-1.583h-.043v4.484H46.63V21.442h1.8v1.506h.033a3.21 3.21 0 0 1 2.883-1.6c2.298 0 3.813 1.816 3.813 4.622m-1.91 0c0-1.833-.948-3.038-2.393-3.038-1.42 0-2.375 1.23-2.375 3.038 0 1.824.955 3.046 2.375 3.046 1.445 0 2.393-1.197 2.393-3.046M65.125 25.97c0 2.813-1.506 4.62-3.779 4.62a3.07 3.07 0 0 1-2.848-1.583h-.043v4.484h-1.859V21.442h1.799v1.506h.034a3.21 3.21 0 0 1 2.883-1.6c2.298 0 3.813 1.816 3.813 4.622m-1.91 0c0-1.833-.948-3.038-2.393-3.038-1.42 0-2.375 1.23-2.375 3.038 0 1.824.955 3.046 2.375 3.046 1.445 0 2.392-1.197 2.392-3.046M71.71 27.036c.138 1.232 1.334 2.04 2.97 2.04 1.566 0 2.693-.808 2.693-1.919 0-.964-.68-1.54-2.29-1.936l-1.609-.388c-2.28-.55-3.339-1.617-3.339-3.348 0-2.142 1.867-3.614 4.519-3.614 2.624 0 4.423 1.472 4.483 3.614h-1.876c-.112-1.239-1.136-1.987-2.634-1.987s-2.521.757-2.521 1.858c0 .878.654 1.395 2.255 1.79l1.368.336c2.548.603 3.606 1.626 3.606 3.443 0 2.323-1.85 3.778-4.793 3.778-2.754 0-4.614-1.42-4.734-3.667ZM83.346 19.3v2.142h1.722v1.472h-1.722v4.991c0 .776.345 1.137 1.102 1.137a6 6 0 0 0 .611-.043v1.463a5 5 0 0 1-1.032.086c-1.833 0-2.548-.689-2.548-2.445v-5.189h-1.316v-1.472h1.316V19.3ZM86.065 25.97c0-2.849 1.678-4.639 4.294-4.639 2.625 0 4.295 1.79 4.295 4.639 0 2.856-1.661 4.638-4.295 4.638s-4.294-1.782-4.294-4.638m6.695 0c0-1.954-.895-3.108-2.401-3.108s-2.4 1.162-2.4 3.108c0 1.962.894 3.106 2.4 3.106s2.401-1.144 2.401-3.106M96.186 21.442h1.773v1.541h.043a2.16 2.16 0 0 1 2.177-1.635 3 3 0 0 1 .637.069v1.738a2.6 2.6 0 0 0-.835-.112 1.873 1.873 0 0 0-1.937 2.083v5.37h-1.858ZM109.384 27.837c-.25 1.643-1.85 2.771-3.898 2.771-2.634 0-4.269-1.764-4.269-4.595 0-2.84 1.644-4.682 4.19-4.682 2.506 0 4.08 1.72 4.08 4.466v.637h-6.394v.112a2.358 2.358 0 0 0 2.436 2.564 2.05 2.05 0 0 0 2.09-1.273Zm-6.282-2.702h4.526a2.177 2.177 0 0 0-2.22-2.298 2.29 2.29 0 0 0-2.306 2.298",style:{fill:"#fff"}})),n.createElement("g",{id:"_Group_4","data-name":"<Group>"},n.createElement("path",{d:"M37.826 8.731a2.64 2.64 0 0 1 2.808 2.965c0 1.906-1.03 3.002-2.808 3.002h-2.155V8.73Zm-1.228 5.123h1.125a1.876 1.876 0 0 0 1.967-2.146 1.88 1.88 0 0 0-1.967-2.134h-1.125ZM41.68 12.444a2.133 2.133 0 1 1 4.248 0 2.134 2.134 0 1 1-4.247 0m3.334 0c0-.976-.439-1.547-1.208-1.547-.773 0-1.207.571-1.207 1.547 0 .984.434 1.55 1.207 1.55.77 0 1.208-.57 1.208-1.55M51.573 14.698h-.922l-.93-3.317h-.07l-.927 3.317h-.913l-1.242-4.503h.902l.806 3.436h.067l.926-3.436h.852l.926 3.436h.07l.803-3.436h.889ZM53.854 10.195h.855v.715h.066a1.35 1.35 0 0 1 1.344-.802 1.465 1.465 0 0 1 1.559 1.675v2.915h-.889v-2.692c0-.724-.314-1.084-.972-1.084a1.033 1.033 0 0 0-1.075 1.141v2.635h-.888ZM59.094 8.437h.888v6.26h-.888ZM61.218 12.444a2.133 2.133 0 1 1 4.247 0 2.134 2.134 0 1 1-4.247 0m3.333 0c0-.976-.439-1.547-1.208-1.547-.773 0-1.207.571-1.207 1.547 0 .984.434 1.55 1.207 1.55.77 0 1.208-.57 1.208-1.55M66.4 13.424c0-.81.604-1.278 1.676-1.344l1.22-.07v-.389c0-.475-.315-.744-.922-.744-.497 0-.84.182-.939.5h-.86c.09-.773.818-1.27 1.84-1.27 1.128 0 1.765.563 1.765 1.514v3.077h-.855v-.633h-.07a1.52 1.52 0 0 1-1.353.707 1.36 1.36 0 0 1-1.501-1.348m2.895-.384v-.377l-1.1.07c-.62.042-.9.253-.9.65 0 .405.351.64.834.64a1.06 1.06 0 0 0 1.166-.983M71.348 12.444c0-1.423.732-2.324 1.87-2.324a1.48 1.48 0 0 1 1.38.79h.067V8.437h.888v6.26h-.851v-.71h-.07a1.56 1.56 0 0 1-1.415.785c-1.145 0-1.869-.901-1.869-2.328m.918 0c0 .955.45 1.53 1.203 1.53.75 0 1.212-.583 1.212-1.526 0-.938-.468-1.53-1.212-1.53-.748 0-1.203.58-1.203 1.526M79.23 12.444a2.133 2.133 0 1 1 4.247 0 2.134 2.134 0 1 1-4.247 0m3.333 0c0-.976-.438-1.547-1.208-1.547-.772 0-1.207.571-1.207 1.547 0 .984.435 1.55 1.207 1.55.77 0 1.208-.57 1.208-1.55M84.67 10.195h.855v.715h.066a1.35 1.35 0 0 1 1.344-.802 1.465 1.465 0 0 1 1.559 1.675v2.915h-.889v-2.692c0-.724-.314-1.084-.972-1.084a1.033 1.033 0 0 0-1.075 1.141v2.635h-.889ZM93.515 9.074v1.141h.976v.749h-.976v2.315c0 .472.194.679.637.679a3 3 0 0 0 .339-.021v.74a3 3 0 0 1-.484.046c-.988 0-1.381-.348-1.381-1.216v-2.543h-.715v-.749h.715V9.074ZM95.705 8.437h.88v2.481h.07a1.39 1.39 0 0 1 1.374-.806 1.483 1.483 0 0 1 1.55 1.679v2.907h-.889V12.01c0-.72-.335-1.084-.963-1.084a1.052 1.052 0 0 0-1.134 1.142v2.63h-.888ZM104.761 13.482a1.83 1.83 0 0 1-1.95 1.303 2.045 2.045 0 0 1-2.081-2.325 2.077 2.077 0 0 1 2.076-2.352c1.253 0 2.009.856 2.009 2.27v.31h-3.18v.05a1.19 1.19 0 0 0 1.2 1.29 1.08 1.08 0 0 0 1.07-.546Zm-3.126-1.451h2.275a1.086 1.086 0 0 0-1.109-1.167 1.15 1.15 0 0 0-1.166 1.167",style:{fill:"#fff"}})))},he="https://apps.apple.com/app/6754879299";class pe extends n.Component{constructor(e){super(e),this.bindCallbacks()}bindCallbacks(){this.handleInstallExtensionClick=this.handleInstallExtensionClick.bind(this),this.handleAlreadyInstalledClick=this.handleAlreadyInstalledClick.bind(this)}handleAlreadyInstalledClick(){this.props.onExtensionAlreadyInstalled()}handleInstallExtensionClick(){this.props.onExtensionDownloading()}render(){return n.createElement("div",{className:"install-extension"},n.createElement("h1",null,n.createElement(I.x,null,"Please install the browser extension (BETA).")),n.createElement("p",null,n.createElement(I.x,null,"Please download the browser extension and refresh this page to continue.")),n.createElement("a",{href:he,className:"browser-webstore safari",target:"_blank",rel:"noopener noreferrer",onClick:this.handleInstallExtensionClick},n.createElement(de,null)),n.createElement("div",{className:"form-actions"},n.createElement("a",{href:he,className:"button primary big full-width",role:"button",target:"_blank",rel:"noopener noreferrer",onClick:this.handleInstallExtensionClick},n.createElement(I.x,null,"Download extension")),n.createElement("button",{className:"link",type:"button",onClick:this.handleAlreadyInstalledClick},n.createElement(I.x,null,"I already installed the extension"))))}}pe.propTypes={context:c().any,onExtensionDownloading:c().func,onExtensionAlreadyInstalled:c().func};const ue=a((0,P.C)("common")(pe));var me,ge,Ee,ye,be,fe,ve,Se,Te,we,xe,Ae,Ce,Re,qe,Ne,ke,_e,Oe,Ie,Pe,De;function Ue(){return Ue=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)({}).hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},Ue.apply(null,arguments)}const Ge=function(e){return n.createElement("svg",Ue({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 484 307"},e),me||(me=n.createElement("rect",{width:483,height:306,x:.5,y:.5,fill:"#EBEBEB",rx:16.3})),ge||(ge=n.createElement("rect",{width:483,height:306,x:.5,y:.5,stroke:"#F5F5F5",rx:16.3})),Ee||(Ee=n.createElement("circle",{cx:21.613,cy:18.2,r:4.594,fill:"#EE6B5F",stroke:"#E93F30",strokeWidth:.438})),ye||(ye=n.createElement("circle",{cx:36.487,cy:18.2,r:4.594,fill:"#F5BE50",stroke:"#F2AD21",strokeWidth:.438})),be||(be=n.createElement("circle",{cx:51.362,cy:18.2,r:4.594,fill:"#62C655",stroke:"#47AC3A",strokeWidth:.438})),fe||(fe=n.createElement("rect",{width:25.106,height:24.105,x:146.275,y:6.147,fill:"#FDFDFD",rx:12.053})),ve||(ve=n.createElement("rect",{width:25.106,height:24.105,x:146.275,y:6.147,stroke:"#FEFEFE",rx:12.053})),Se||(Se=n.createElement("path",{fill:"#272727",d:"m165.841 17.203-6.06-5.592a1.42 1.42 0 0 0-.951-.364c-.352 0-.691.13-.95.364l-3.803 3.524a3.4 3.4 0 0 1 1.306.858c.361.382.624.843.768 1.344h5.134a.49.49 0 0 1 .337.137.47.47 0 0 1 .138.33v.768a.47.47 0 0 1-.475.467h-.593v1.085a.46.46 0 0 1-.292.432.5.5 0 0 1-.182.036h-1.301a.48.48 0 0 1-.439-.289.5.5 0 0 1-.035-.178v-1.086h-2.292a3.2 3.2 0 0 1-.759 1.36 3.3 3.3 0 0 1-1.315.86l3.82 3.53a1.42 1.42 0 0 0 1.901 0l6.05-5.59a1.364 1.364 0 0 0-.007-1.996"})),Te||(Te=n.createElement("path",{fill:"#272727",d:"M152.951 16.66a1.7 1.7 0 0 0-.712.169c-.248.12-.459.304-.61.531a1.5 1.5 0 0 0-.076 1.543c.129.24.321.442.556.586a1.577 1.577 0 0 0 2.161-.518c.141-.234.216-.5.216-.772a1.47 1.47 0 0 0-.436-1.086 1.56 1.56 0 0 0-1.099-.453"})),we||(we=n.createElement("rect",{width:185.694,height:24.2,x:186.381,y:6.1,fill:"#FDFDFD",rx:12.1})),xe||(xe=n.createElement("rect",{width:185.694,height:24.2,x:186.381,y:6.1,stroke:"#FEFEFE",rx:12.1})),Ae||(Ae=n.createElement("mask",{id:"a",fill:"#fff"},n.createElement("path",{d:"M172.799 44.954a5.6 5.6 0 0 0 3.245 1.036h74.14c12.372 0 22.401 10.03 22.401 22.4v178.137c0 12.371-10.029 22.401-22.401 22.401H68.307c-12.372 0-22.4-10.03-22.4-22.401V68.391c0-12.372 10.028-22.4 22.4-22.4h74.139a5.6 5.6 0 0 0 3.245-1.037L156 37.625a5.6 5.6 0 0 1 6.49 0z"}))),Ce||(Ce=n.createElement("path",{fill:"#F8F8F8",d:"M172.799 44.954a5.6 5.6 0 0 0 3.245 1.036h74.14c12.372 0 22.401 10.03 22.401 22.4v178.137c0 12.371-10.029 22.401-22.401 22.401H68.307c-12.372 0-22.4-10.03-22.4-22.401V68.391c0-12.372 10.028-22.4 22.4-22.4h74.139a5.6 5.6 0 0 0 3.245-1.037L156 37.625a5.6 5.6 0 0 1 6.49 0z"})),Re||(Re=n.createElement("path",{fill:"#A9A9A9",d:"m145.691 44.954-.405-.57zm27.108 0 .405-.57zm3.245 1.036v.7h74.14v-1.4h-74.14zm74.14 0v.7c11.985 0 21.701 9.716 21.701 21.7h1.4c0-12.757-10.343-23.1-23.101-23.1zm22.401 22.4h-.7v178.137h1.4V68.391h-.7Zm0 178.137h-.7c0 11.985-9.716 21.701-21.701 21.701v1.4c12.758 0 23.101-10.343 23.101-23.101zm-22.401 22.401v-.7H68.307v1.4h181.877zm-181.877 0v-.7c-11.985 0-21.7-9.716-21.7-21.701h-1.4c0 12.758 10.342 23.101 23.1 23.101zm-22.4-22.401h.7V68.391h-1.4v178.136zm0-178.136h.7c0-11.985 9.715-21.7 21.7-21.7v-1.4c-12.758 0-23.1 10.342-23.1 23.1zm22.4-22.4v.7h74.139v-1.4h-74.14zm77.384-1.037.406.57 10.309-7.328-.406-.57-.405-.571-10.309 7.329zm16.799-7.329-.406.57 10.309 7.33.406-.57.405-.571-10.309-7.33zm-20.044 8.365v.7a6.3 6.3 0 0 0 3.651-1.165l-.406-.57-.405-.571a4.9 4.9 0 0 1-2.84.906zM156 37.625l.406.57a4.9 4.9 0 0 1 5.678 0l.406-.57.405-.57a6.3 6.3 0 0 0-7.3 0zm20.044 8.365v-.7a4.9 4.9 0 0 1-2.84-.906l-.405.57-.406.57a6.3 6.3 0 0 0 3.651 1.166z",mask:"url(#safari_quickaccess_configuration_light_svg__a)"})),qe||(qe=n.createElement("path",{stroke:"#000",strokeLinecap:"round",strokeOpacity:.1,strokeWidth:7.388,d:"M72.024 63.89h174.452m-164.46 11.2h154.467m-127.822 11.2h101.178"})),Ne||(Ne=n.createElement("path",{stroke:"#000",strokeLinecap:"round",strokeOpacity:.1,strokeWidth:3.694,d:"M72.024 108.689h174.452M108.661 119.89h101.178M72.024 131.089h174.452M82.016 142.29h154.467m-127.822 11.199h101.178"})),ke||(ke=n.createElement("g",{opacity:.5},n.createElement("rect",{width:191.8,height:22.4,x:63.35,y:175.89,fill:"#3D76F9",rx:11.2}),n.createElement("path",{stroke:"#000",strokeLinecap:"round",strokeOpacity:.25,strokeWidth:2.8,d:"M130.051 187.089h58.398"}))),_e||(_e=n.createElement("g",{opacity:.5},n.createElement("rect",{width:191.8,height:22.4,x:63.35,y:203.89,fill:"#C5C5C5",rx:11.2}),n.createElement("path",{stroke:"#000",strokeLinecap:"round",strokeOpacity:.25,strokeWidth:2.8,d:"M130.051 215.089h58.398"}))),Oe||(Oe=n.createElement("rect",{width:191.8,height:22,x:63.35,y:231.89,fill:"#E4E4E4",rx:11})),Ie||(Ie=n.createElement("rect",{width:191.8,height:22,x:63.35,y:231.89,stroke:"#D40101",strokeWidth:3,rx:11})),Pe||(Pe=n.createElement("path",{fill:"#000",d:"M82.929 246.89h-.923l2.67-7.273h.91l2.67 7.273h-.924l-2.173-6.123h-.057zm.34-2.841h3.722v.781H83.27zm6.844-4.432v7.273h-.838v-7.273zm2.77 7.273-1.661-5.455h.88l1.18 4.176h.056l1.165-4.176h.895l1.15 4.162h.057l1.18-4.162h.88l-1.662 5.455h-.824l-1.193-4.191h-.085l-1.193 4.191h-.824Zm8.495.127q-.519 0-.941-.195a1.6 1.6 0 0 1-.671-.572q-.249-.377-.249-.909 0-.468.185-.76.185-.294.493-.461.31-.167.682-.249.376-.085.757-.135.497-.063.806-.096.312-.034.454-.117.146-.081.146-.284v-.028q0-.526-.288-.817-.284-.291-.863-.291-.6 0-.941.263-.34.262-.479.561l-.795-.285q.212-.496.568-.774.358-.28.781-.39a3.2 3.2 0 0 1 .838-.114q.262 0 .604.064.344.06.664.252.323.192.536.579t.213 1.037v3.594h-.838v-.739h-.043a1.5 1.5 0 0 1-.284.38q-.198.203-.529.344-.33.142-.806.142m.128-.752q.497 0 .838-.196a1.32 1.32 0 0 0 .696-1.154v-.767q-.054.064-.234.117a4 4 0 0 1-.412.089 18 18 0 0 1-.803.107 3 3 0 0 0-.611.138 1.05 1.05 0 0 0-.454.281q-.171.184-.171.504 0 .436.323.66.327.22.828.221m4.246 2.67q-.213 0-.38-.035a1 1 0 0 1-.231-.064l.213-.739q.306.078.54.057a.65.65 0 0 0 .416-.21q.184-.184.337-.6l.156-.426-2.017-5.483h.909l1.506 4.347h.057l1.505-4.347h.91l-2.316 6.25a2.4 2.4 0 0 1-.387.7 1.45 1.45 0 0 1-.536.415q-.302.135-.682.135m8.89-6.278-.752.213a1.4 1.4 0 0 0-.21-.366 1 1 0 0 0-.369-.298 1.35 1.35 0 0 0-.6-.117q-.5 0-.835.23-.33.228-.33.579 0 .313.227.494.228.181.71.302l.81.198q.732.178 1.09.544.359.362.359.934 0 .469-.27.838-.267.369-.746.582a2.7 2.7 0 0 1-1.115.213q-.835 0-1.381-.362-.547-.362-.693-1.058l.796-.199q.113.441.429.66.32.22.835.221.587 0 .93-.249.348-.252.348-.604a.63.63 0 0 0-.199-.475q-.198-.196-.61-.292l-.909-.213q-.75-.178-1.101-.55-.348-.377-.348-.941 0-.462.259-.817.262-.355.714-.558a2.5 2.5 0 0 1 1.03-.202q.809 0 1.271.355.465.355.66.938m4.586 4.233h-.923l2.67-7.273h.909l2.671 7.273h-.924l-2.173-6.123h-.057zm.341-2.841h3.721v.781h-3.721zm6.843-4.432v7.273h-.838v-7.273zm2.373 0v7.273h-.838v-7.273zm3.751 7.386q-.74 0-1.296-.351a2.4 2.4 0 0 1-.867-.984q-.309-.632-.309-1.477 0-.852.309-1.488.312-.636.867-.987.557-.352 1.296-.352.738 0 1.292.352.558.351.867.987.312.636.312 1.488 0 .845-.312 1.477a2.36 2.36 0 0 1-.867.984q-.554.351-1.292.351m0-.753q.561 0 .923-.287a1.7 1.7 0 0 0 .536-.757q.174-.469.174-1.015a2.9 2.9 0 0 0-.174-1.019 1.7 1.7 0 0 0-.536-.764q-.362-.291-.923-.291c-.561 0-.682.097-.924.291q-.362.291-.536.764a2.9 2.9 0 0 0-.174 1.019q0 .546.174 1.015a1.7 1.7 0 0 0 .536.757q.363.288.924.287m4.801.64-1.662-5.455h.881l1.179 4.176h.056l1.165-4.176h.895l1.151 4.162h.056l1.179-4.162h.881l-1.662 5.455h-.824l-1.193-4.191h-.085l-1.193 4.191zm11.917.113q-.738 0-1.296-.351a2.4 2.4 0 0 1-.866-.984q-.309-.632-.309-1.477 0-.852.309-1.488.312-.636.866-.987.558-.352 1.296-.352.74 0 1.293.352.558.351.867.987.312.636.312 1.488 0 .845-.312 1.477a2.36 2.36 0 0 1-.867.984q-.554.351-1.293.351m0-.753q.561 0 .924-.287a1.7 1.7 0 0 0 .536-.757q.174-.469.174-1.015a2.9 2.9 0 0 0-.174-1.019 1.7 1.7 0 0 0-.536-.764q-.363-.291-.924-.291c-.561 0-.681.097-.923.291q-.362.291-.536.764a2.9 2.9 0 0 0-.174 1.019q0 .546.174 1.015a1.7 1.7 0 0 0 .536.757q.362.288.923.287m4.589-2.642v3.282h-.838v-5.455h.81v.852h.071q.192-.415.582-.667.391-.256 1.009-.256.553 0 .969.227.416.225.647.682.231.455.231 1.151v3.466h-.839v-3.409q0-.644-.333-1.002-.334-.362-.917-.362-.4 0-.717.174a1.24 1.24 0 0 0-.493.508 1.7 1.7 0 0 0-.182.809m7.938 3.282v-7.273h4.389v.781h-3.508v2.458h3.281v.781h-3.281v2.471h3.565v.782zm10.323-5.455-2.017 5.455h-.852l-2.017-5.455h.909l1.506 4.347h.056l1.506-4.347zm3.198 5.568q-.789 0-1.36-.348a2.33 2.33 0 0 1-.877-.98q-.306-.632-.306-1.47t.306-1.477q.309-.644.859-1.002.554-.362 1.293-.362.426 0 .841.142.416.143.757.462.34.316.543.838t.203 1.285v.355h-4.205v-.724h3.352a1.8 1.8 0 0 0-.184-.824 1.4 1.4 0 0 0-.519-.572 1.46 1.46 0 0 0-.788-.209q-.501 0-.867.249a1.63 1.63 0 0 0-.557.639q-.195.393-.196.845v.483q0 .618.214 1.047.216.427.6.65.382.22.891.22.33 0 .597-.092.27-.096.465-.284a1.3 1.3 0 0 0 .302-.476l.809.227a1.8 1.8 0 0 1-.429.725q-.303.309-.746.483-.444.17-.998.17m3.533-.113v-5.455h.81v.824h.057q.148-.405.54-.657.39-.252.88-.252l.231.003q.138.004.21.011v.852a3 3 0 0 0-.512-.056q-.398 0-.71.166a1.23 1.23 0 0 0-.668 1.112v3.452zm4.427 2.045q-.213 0-.38-.035a1 1 0 0 1-.231-.064l.213-.739q.306.078.54.057a.64.64 0 0 0 .415-.21q.185-.184.338-.6l.156-.426-2.017-5.483h.909l1.506 4.347h.057l1.505-4.347h.909l-2.315 6.25a2.4 2.4 0 0 1-.387.7 1.46 1.46 0 0 1-.536.415q-.303.135-.682.135m9.274-2.045-1.989-7.273h.895l1.52 5.923h.071l1.548-5.923h.994l1.549 5.923h.071l1.52-5.923h.895l-1.989 7.273h-.909l-1.605-5.796h-.057l-1.605 5.796zm9.836.113q-.788 0-1.36-.348a2.33 2.33 0 0 1-.877-.98q-.305-.632-.305-1.47t.305-1.477q.31-.644.859-1.002.555-.362 1.293-.362.426 0 .842.142.415.143.756.462.341.316.543.838.203.522.203 1.285v.355h-4.205v-.724h3.353q0-.462-.185-.824a1.4 1.4 0 0 0-.519-.572 1.46 1.46 0 0 0-.788-.209q-.501 0-.866.249a1.6 1.6 0 0 0-.558.639q-.195.393-.195.845v.483q0 .618.213 1.047.216.427.6.65.384.22.891.22.33 0 .597-.092.27-.096.465-.284a1.3 1.3 0 0 0 .302-.476l.81.227a1.8 1.8 0 0 1-.43.725q-.302.309-.746.483-.443.17-.998.17m3.647-.113v-7.273h.838v2.685h.071q.093-.142.256-.363.167-.223.476-.397.312-.178.845-.178.689 0 1.215.345.525.344.82.976.294.633.295 1.492 0 .866-.295 1.502a2.33 2.33 0 0 1-.817.98 2.14 2.14 0 0 1-1.204.344q-.525 0-.841-.174a1.6 1.6 0 0 1-.487-.401 6 6 0 0 1-.263-.376h-.099v.838zm.824-2.728q0 .618.181 1.091.181.468.529.735.349.262.853.262.525 0 .877-.277a1.7 1.7 0 0 0 .533-.752q.18-.476.181-1.059 0-.575-.178-1.037a1.6 1.6 0 0 0-.529-.735q-.351-.273-.884-.273-.512 0-.86.259-.348.256-.525.717a2.9 2.9 0 0 0-.178 1.069m9.137-1.505-.753.213a1.4 1.4 0 0 0-.209-.366 1 1 0 0 0-.369-.298 1.35 1.35 0 0 0-.601-.117q-.5 0-.834.23-.33.228-.33.579 0 .313.227.494t.71.302l.81.198q.732.178 1.09.544.359.362.359.934 0 .469-.27.838-.267.369-.746.582-.48.213-1.115.213-.835 0-1.381-.362-.548-.362-.693-1.058l.796-.199q.113.441.429.66.32.22.835.221.586 0 .93-.249.348-.252.348-.604a.63.63 0 0 0-.199-.475q-.199-.196-.61-.292l-.91-.213q-.749-.177-1.1-.55-.348-.377-.348-.941 0-.462.259-.817.262-.356.714-.558a2.5 2.5 0 0 1 1.029-.202q.81 0 1.272.355.465.355.66.938m1.361 4.233v-5.455h.838v5.455zm.426-6.364a.6.6 0 0 1-.422-.167.54.54 0 0 1-.174-.401q0-.234.174-.401a.6.6 0 0 1 .422-.167.58.58 0 0 1 .419.167.53.53 0 0 1 .178.401q0 .234-.178.401a.58.58 0 0 1-.419.167m4.319.909v.71h-2.826v-.71zm-2.002-1.307h.838v5.199q0 .355.103.533a.53.53 0 0 0 .27.234q.167.057.351.057.138 0 .227-.014l.142-.029.171.753a1.6 1.6 0 0 1-.238.064 1.7 1.7 0 0 1-.387.036q-.355 0-.696-.153a1.4 1.4 0 0 1-.561-.465q-.22-.313-.22-.789zm5.491 6.875q-.787 0-1.36-.348a2.34 2.34 0 0 1-.877-.98q-.305-.632-.305-1.47t.305-1.477q.31-.644.86-1.002.554-.362 1.292-.362.426 0 .842.142.416.143.756.462.342.316.544.838t.202 1.285v.355h-4.205v-.724h3.353q0-.462-.185-.824a1.4 1.4 0 0 0-.518-.572 1.46 1.46 0 0 0-.789-.209 1.5 1.5 0 0 0-.866.249 1.6 1.6 0 0 0-.558.639q-.195.393-.195.845v.483q0 .618.213 1.047.216.427.6.65.384.22.891.22.33 0 .597-.092.27-.096.465-.284a1.3 1.3 0 0 0 .302-.476l.81.227a1.8 1.8 0 0 1-.43.725q-.302.309-.746.483-.443.17-.998.17m4.145-.057a.61.61 0 0 1-.451-.188.61.61 0 0 1-.189-.451q0-.262.189-.451a.62.62 0 0 1 .451-.188q.262 0 .451.188a.62.62 0 0 1 .188.451.66.66 0 0 1-.32.554.6.6 0 0 1-.319.085m2.754 0a.61.61 0 0 1-.451-.188.61.61 0 0 1-.189-.451q0-.262.189-.451a.62.62 0 0 1 .451-.188q.262 0 .451.188a.62.62 0 0 1 .188.451.66.66 0 0 1-.32.554.6.6 0 0 1-.319.085m2.753 0a.61.61 0 0 1-.451-.188.62.62 0 0 1-.188-.451q0-.262.188-.451a.62.62 0 0 1 .451-.188q.264 0 .451.188a.62.62 0 0 1 .189.451.66.66 0 0 1-.32.554.6.6 0 0 1-.32.085"})),De||(De=n.createElement("path",{fill:"#D40101",d:"M362.322 245.635a2.8 2.8 0 0 0 0-5.6zm-96.363-4.78a2.8 2.8 0 0 0 0 3.96l17.819 17.819a2.801 2.801 0 0 0 3.96-3.96l-15.839-15.839 15.839-15.839a2.8 2.8 0 1 0-3.96-3.96zm96.363 1.98v-2.8h-94.383v5.6h94.383z"})))};var Le,Me,Fe,$e,Ve,Ke,Be,je,ze,He,We,Ye,Ze,Xe,Je,Qe,et,tt,st,nt,it,rt;function at(){return at=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)({}).hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},at.apply(null,arguments)}const ot=function(e){return n.createElement("svg",at({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 484 307"},e),Le||(Le=n.createElement("rect",{width:483,height:306,x:.5,y:.5,fill:"#232222",rx:16.3})),Me||(Me=n.createElement("rect",{width:483,height:306,x:.5,y:.5,stroke:"#4F4F4F",rx:16.3})),Fe||(Fe=n.createElement("circle",{cx:21.613,cy:18.2,r:4.594,fill:"#EE6B5F",stroke:"#E93F30",strokeWidth:.438})),$e||($e=n.createElement("circle",{cx:36.487,cy:18.2,r:4.594,fill:"#F5BE50",stroke:"#F2AD21",strokeWidth:.438})),Ve||(Ve=n.createElement("circle",{cx:51.362,cy:18.2,r:4.594,fill:"#62C655",stroke:"#47AC3A",strokeWidth:.438})),Ke||(Ke=n.createElement("rect",{width:25.106,height:24.105,x:146.275,y:6.147,fill:"#2C2A2A",rx:12.053})),Be||(Be=n.createElement("rect",{width:25.106,height:24.105,x:146.275,y:6.147,stroke:"#474747",rx:12.053})),je||(je=n.createElement("path",{fill:"#DFE0E1",d:"m165.841 17.203-6.06-5.592a1.42 1.42 0 0 0-.951-.364c-.352 0-.691.13-.95.364l-3.803 3.524a3.4 3.4 0 0 1 1.306.858c.361.382.624.843.768 1.344h5.134a.49.49 0 0 1 .337.137.47.47 0 0 1 .138.33v.768a.47.47 0 0 1-.475.467h-.593v1.085a.46.46 0 0 1-.292.432.5.5 0 0 1-.182.036h-1.301a.48.48 0 0 1-.439-.289.5.5 0 0 1-.035-.178v-1.086h-2.292a3.2 3.2 0 0 1-.759 1.36 3.3 3.3 0 0 1-1.315.86l3.82 3.53a1.42 1.42 0 0 0 1.901 0l6.05-5.59a1.364 1.364 0 0 0-.007-1.996"})),ze||(ze=n.createElement("path",{fill:"#DFE0E1",d:"M152.951 16.66a1.7 1.7 0 0 0-.712.169c-.248.12-.459.304-.61.531a1.5 1.5 0 0 0-.076 1.543c.129.24.321.442.556.586a1.577 1.577 0 0 0 2.161-.518c.141-.234.216-.5.216-.772a1.47 1.47 0 0 0-.436-1.086 1.56 1.56 0 0 0-1.099-.453"})),He||(He=n.createElement("rect",{width:185.694,height:24.2,x:186.381,y:6.1,fill:"#2C2A2A",rx:12.1})),We||(We=n.createElement("rect",{width:185.694,height:24.2,x:186.381,y:6.1,stroke:"#474747",rx:12.1})),Ye||(Ye=n.createElement("mask",{id:"a",fill:"#fff"},n.createElement("path",{fillRule:"evenodd",d:"M172.799 44.954a5.6 5.6 0 0 0 3.245 1.036h74.14c12.372 0 22.401 10.03 22.401 22.4v178.137c0 12.372-10.029 22.401-22.401 22.401H68.307c-12.372 0-22.4-10.029-22.4-22.401V68.391c0-12.372 10.028-22.4 22.4-22.4h74.139a5.6 5.6 0 0 0 3.245-1.037L156 37.625a5.6 5.6 0 0 1 6.49 0z",clipRule:"evenodd"}))),Ze||(Ze=n.createElement("path",{fill:"#3B3C3F",fillRule:"evenodd",d:"M172.799 44.954a5.6 5.6 0 0 0 3.245 1.036h74.14c12.372 0 22.401 10.03 22.401 22.4v178.137c0 12.372-10.029 22.401-22.401 22.401H68.307c-12.372 0-22.4-10.029-22.4-22.401V68.391c0-12.372 10.028-22.4 22.4-22.4h74.139a5.6 5.6 0 0 0 3.245-1.037L156 37.625a5.6 5.6 0 0 1 6.49 0z",clipRule:"evenodd"})),Xe||(Xe=n.createElement("path",{fill:"#7E7F80",d:"m145.691 44.954-.405-.57zm27.108 0 .405-.57zm3.245 1.036v.7h74.14v-1.4h-74.14zm74.14 0v.7c11.985 0 21.701 9.716 21.701 21.7h1.4c0-12.757-10.343-23.1-23.101-23.1zm22.401 22.4h-.7v178.137h1.4V68.391h-.7Zm0 178.137h-.7c0 11.985-9.716 21.701-21.701 21.701v1.4c12.758 0 23.101-10.343 23.101-23.101zm-22.401 22.401v-.7H68.307v1.4h181.877zm-181.877 0v-.7c-11.985 0-21.7-9.716-21.7-21.701h-1.4c0 12.758 10.342 23.101 23.1 23.101zm-22.4-22.401h.7V68.391h-1.4v178.136zm0-178.136h.7c0-11.985 9.715-21.7 21.7-21.7v-1.4c-12.758 0-23.1 10.342-23.1 23.1zm22.4-22.4v.7h74.139v-1.4h-74.14zm77.384-1.037.406.57 10.309-7.328-.406-.57-.405-.571-10.309 7.329zm16.799-7.329-.406.57 10.309 7.33.406-.57.405-.571-10.309-7.33zm-20.044 8.365v.7a6.3 6.3 0 0 0 3.651-1.165l-.406-.57-.405-.571a4.9 4.9 0 0 1-2.84.906zM156 37.625l.406.57a4.9 4.9 0 0 1 5.678 0l.406-.57.405-.57a6.3 6.3 0 0 0-7.3 0zm20.044 8.365v-.7a4.9 4.9 0 0 1-2.84-.906l-.405.57-.406.57a6.3 6.3 0 0 0 3.651 1.166z",mask:"url(#safari_quickaccess_configuration_dark_svg__a)"})),Je||(Je=n.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeOpacity:.1,strokeWidth:7.388,d:"M72.024 63.89h174.452m-164.46 11.2h154.467m-127.822 11.2h101.178"})),Qe||(Qe=n.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeOpacity:.1,strokeWidth:3.694,d:"M72.024 108.689h174.452M108.661 119.89h101.178M72.024 131.089h174.452M82.016 142.29h154.467m-127.822 11.199h101.178"})),et||(et=n.createElement("g",{opacity:.5},n.createElement("rect",{width:191.8,height:22.4,x:63.35,y:175.89,fill:"#007CFF",rx:11.2}),n.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeWidth:2.8,d:"M130.051 187.089h58.398"}))),tt||(tt=n.createElement("g",{opacity:.5},n.createElement("rect",{width:191.8,height:22.4,x:63.35,y:203.89,fill:"#727273",rx:11.2}),n.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeWidth:2.8,d:"M130.051 215.089h58.398"}))),st||(st=n.createElement("rect",{width:191.8,height:22,x:63.35,y:231.89,fill:"#575759",rx:11})),nt||(nt=n.createElement("rect",{width:191.8,height:22,x:63.35,y:231.89,stroke:"#D40101",strokeWidth:3,rx:11})),it||(it=n.createElement("path",{fill:"#fff",d:"M82.929 246.89h-.923l2.67-7.273h.91l2.67 7.273h-.924l-2.173-6.123h-.057zm.34-2.841h3.722v.781H83.27zm6.844-4.432v7.273h-.838v-7.273zm2.77 7.273-1.661-5.455h.88l1.18 4.176h.056l1.165-4.176h.895l1.15 4.162h.057l1.18-4.162h.88l-1.662 5.455h-.824l-1.193-4.191h-.085l-1.193 4.191h-.824Zm8.495.127q-.519 0-.941-.195a1.6 1.6 0 0 1-.671-.572q-.249-.377-.249-.909 0-.468.185-.76.185-.294.493-.461.31-.167.682-.249.376-.085.757-.135.497-.063.806-.096.312-.034.454-.117.146-.081.146-.284v-.028q0-.526-.288-.817-.284-.291-.863-.291-.6 0-.941.263-.34.262-.479.561l-.795-.285q.212-.496.568-.774.358-.28.781-.39a3.2 3.2 0 0 1 .838-.114q.262 0 .604.064.344.06.664.252.323.192.536.579t.213 1.037v3.594h-.838v-.739h-.043a1.5 1.5 0 0 1-.284.38q-.198.203-.529.344-.33.142-.806.142m.128-.752q.497 0 .838-.196a1.32 1.32 0 0 0 .696-1.154v-.767q-.054.064-.234.117a4 4 0 0 1-.412.089 18 18 0 0 1-.803.107 3 3 0 0 0-.611.138 1.05 1.05 0 0 0-.454.281q-.171.184-.171.504 0 .436.323.66.327.22.828.221m4.246 2.67q-.213 0-.38-.035a1 1 0 0 1-.231-.064l.213-.739q.306.078.54.057a.65.65 0 0 0 .416-.21q.184-.184.337-.6l.156-.426-2.017-5.483h.909l1.506 4.347h.057l1.505-4.347h.91l-2.316 6.25a2.4 2.4 0 0 1-.387.7 1.45 1.45 0 0 1-.536.415q-.302.135-.682.135m8.89-6.278-.752.213a1.4 1.4 0 0 0-.21-.366 1 1 0 0 0-.369-.298 1.35 1.35 0 0 0-.6-.117q-.5 0-.835.23-.33.228-.33.579 0 .313.227.494.228.181.71.302l.81.198q.732.178 1.09.544.359.362.359.934 0 .469-.27.838-.267.369-.746.582a2.7 2.7 0 0 1-1.115.213q-.835 0-1.381-.362-.547-.362-.693-1.058l.796-.199q.113.441.429.66.32.22.835.221.587 0 .93-.249.348-.252.348-.604a.63.63 0 0 0-.199-.475q-.198-.196-.61-.292l-.909-.213q-.75-.178-1.101-.55-.348-.377-.348-.941 0-.462.259-.817.262-.355.714-.558a2.5 2.5 0 0 1 1.03-.202q.809 0 1.271.355.465.355.66.938m4.586 4.233h-.923l2.67-7.273h.909l2.671 7.273h-.924l-2.173-6.123h-.057zm.341-2.841h3.721v.781h-3.721zm6.843-4.432v7.273h-.838v-7.273zm2.373 0v7.273h-.838v-7.273zm3.751 7.386q-.74 0-1.296-.351a2.4 2.4 0 0 1-.867-.984q-.309-.632-.309-1.477 0-.852.309-1.488.312-.636.867-.987.557-.352 1.296-.352.738 0 1.292.352.558.351.867.987.312.636.312 1.488 0 .845-.312 1.477a2.36 2.36 0 0 1-.867.984q-.554.351-1.292.351m0-.753q.561 0 .923-.287a1.7 1.7 0 0 0 .536-.757q.174-.469.174-1.015a2.9 2.9 0 0 0-.174-1.019 1.7 1.7 0 0 0-.536-.764q-.362-.291-.923-.291c-.561 0-.682.097-.924.291q-.362.291-.536.764a2.9 2.9 0 0 0-.174 1.019q0 .546.174 1.015a1.7 1.7 0 0 0 .536.757q.363.288.924.287m4.801.64-1.662-5.455h.881l1.179 4.176h.056l1.165-4.176h.895l1.151 4.162h.056l1.179-4.162h.881l-1.662 5.455h-.824l-1.193-4.191h-.085l-1.193 4.191zm11.917.113q-.738 0-1.296-.351a2.4 2.4 0 0 1-.866-.984q-.309-.632-.309-1.477 0-.852.309-1.488.312-.636.866-.987.558-.352 1.296-.352.74 0 1.293.352.558.351.867.987.312.636.312 1.488 0 .845-.312 1.477a2.36 2.36 0 0 1-.867.984q-.554.351-1.293.351m0-.753q.561 0 .924-.287a1.7 1.7 0 0 0 .536-.757q.174-.469.174-1.015a2.9 2.9 0 0 0-.174-1.019 1.7 1.7 0 0 0-.536-.764q-.363-.291-.924-.291c-.561 0-.681.097-.923.291q-.362.291-.536.764a2.9 2.9 0 0 0-.174 1.019q0 .546.174 1.015a1.7 1.7 0 0 0 .536.757q.362.288.923.287m4.589-2.642v3.282h-.838v-5.455h.81v.852h.071q.192-.415.582-.667.391-.256 1.009-.256.553 0 .969.227.416.225.647.682.231.455.231 1.151v3.466h-.839v-3.409q0-.644-.333-1.002-.334-.362-.917-.362-.4 0-.717.174a1.24 1.24 0 0 0-.493.508 1.7 1.7 0 0 0-.182.809m7.938 3.282v-7.273h4.389v.781h-3.508v2.458h3.281v.781h-3.281v2.471h3.565v.782zm10.323-5.455-2.017 5.455h-.852l-2.017-5.455h.909l1.506 4.347h.056l1.506-4.347zm3.198 5.568q-.789 0-1.36-.348a2.33 2.33 0 0 1-.877-.98q-.306-.632-.306-1.47t.306-1.477q.309-.644.859-1.002.554-.362 1.293-.362.426 0 .841.142.416.143.757.462.34.316.543.838t.203 1.285v.355h-4.205v-.724h3.352a1.8 1.8 0 0 0-.184-.824 1.4 1.4 0 0 0-.519-.572 1.46 1.46 0 0 0-.788-.209q-.501 0-.867.249a1.63 1.63 0 0 0-.557.639q-.195.393-.196.845v.483q0 .618.214 1.047.216.427.6.65.382.22.891.22.33 0 .597-.092.27-.096.465-.284a1.3 1.3 0 0 0 .302-.476l.809.227a1.8 1.8 0 0 1-.429.725q-.303.309-.746.483-.444.17-.998.17m3.533-.113v-5.455h.81v.824h.057q.148-.405.54-.657.39-.252.88-.252l.231.003q.138.004.21.011v.852a3 3 0 0 0-.512-.056q-.398 0-.71.166a1.23 1.23 0 0 0-.668 1.112v3.452zm4.427 2.045q-.213 0-.38-.035a1 1 0 0 1-.231-.064l.213-.739q.306.078.54.057a.64.64 0 0 0 .415-.21q.185-.184.338-.6l.156-.426-2.017-5.483h.909l1.506 4.347h.057l1.505-4.347h.909l-2.315 6.25a2.4 2.4 0 0 1-.387.7 1.46 1.46 0 0 1-.536.415q-.303.135-.682.135m9.274-2.045-1.989-7.273h.895l1.52 5.923h.071l1.548-5.923h.994l1.549 5.923h.071l1.52-5.923h.895l-1.989 7.273h-.909l-1.605-5.796h-.057l-1.605 5.796zm9.836.113q-.788 0-1.36-.348a2.33 2.33 0 0 1-.877-.98q-.305-.632-.305-1.47t.305-1.477q.31-.644.859-1.002.555-.362 1.293-.362.426 0 .842.142.415.143.756.462.341.316.543.838.203.522.203 1.285v.355h-4.205v-.724h3.353q0-.462-.185-.824a1.4 1.4 0 0 0-.519-.572 1.46 1.46 0 0 0-.788-.209q-.501 0-.866.249a1.6 1.6 0 0 0-.558.639q-.195.393-.195.845v.483q0 .618.213 1.047.216.427.6.65.384.22.891.22.33 0 .597-.092.27-.096.465-.284a1.3 1.3 0 0 0 .302-.476l.81.227a1.8 1.8 0 0 1-.43.725q-.302.309-.746.483-.443.17-.998.17m3.647-.113v-7.273h.838v2.685h.071q.093-.142.256-.363.167-.223.476-.397.312-.178.845-.178.689 0 1.215.345.525.344.82.976.294.633.295 1.492 0 .866-.295 1.502a2.33 2.33 0 0 1-.817.98 2.14 2.14 0 0 1-1.204.344q-.525 0-.841-.174a1.6 1.6 0 0 1-.487-.401 6 6 0 0 1-.263-.376h-.099v.838zm.824-2.728q0 .618.181 1.091.181.468.529.735.349.262.853.262.525 0 .877-.277a1.7 1.7 0 0 0 .533-.752q.18-.476.181-1.059 0-.575-.178-1.037a1.6 1.6 0 0 0-.529-.735q-.351-.273-.884-.273-.512 0-.86.259-.348.256-.525.717a2.9 2.9 0 0 0-.178 1.069m9.137-1.505-.753.213a1.4 1.4 0 0 0-.209-.366 1 1 0 0 0-.369-.298 1.35 1.35 0 0 0-.601-.117q-.5 0-.834.23-.33.228-.33.579 0 .313.227.494t.71.302l.81.198q.732.178 1.09.544.359.362.359.934 0 .469-.27.838-.267.369-.746.582-.48.213-1.115.213-.835 0-1.381-.362-.548-.362-.693-1.058l.796-.199q.113.441.429.66.32.22.835.221.586 0 .93-.249.348-.252.348-.604a.63.63 0 0 0-.199-.475q-.199-.196-.61-.292l-.91-.213q-.749-.177-1.1-.55-.348-.377-.348-.941 0-.462.259-.817.262-.356.714-.558a2.5 2.5 0 0 1 1.029-.202q.81 0 1.272.355.465.355.66.938m1.361 4.233v-5.455h.838v5.455zm.426-6.364a.6.6 0 0 1-.422-.167.54.54 0 0 1-.174-.401q0-.234.174-.401a.6.6 0 0 1 .422-.167.58.58 0 0 1 .419.167.53.53 0 0 1 .178.401q0 .234-.178.401a.58.58 0 0 1-.419.167m4.319.909v.71h-2.826v-.71zm-2.002-1.307h.838v5.199q0 .355.103.533a.53.53 0 0 0 .27.234q.167.057.351.057.138 0 .227-.014l.142-.029.171.753a1.6 1.6 0 0 1-.238.064 1.7 1.7 0 0 1-.387.036q-.355 0-.696-.153a1.4 1.4 0 0 1-.561-.465q-.22-.313-.22-.789zm5.491 6.875q-.787 0-1.36-.348a2.34 2.34 0 0 1-.877-.98q-.305-.632-.305-1.47t.305-1.477q.31-.644.86-1.002.554-.362 1.292-.362.426 0 .842.142.416.143.756.462.342.316.544.838t.202 1.285v.355h-4.205v-.724h3.353q0-.462-.185-.824a1.4 1.4 0 0 0-.518-.572 1.46 1.46 0 0 0-.789-.209 1.5 1.5 0 0 0-.866.249 1.6 1.6 0 0 0-.558.639q-.195.393-.195.845v.483q0 .618.213 1.047.216.427.6.65.384.22.891.22.33 0 .597-.092.27-.096.465-.284a1.3 1.3 0 0 0 .302-.476l.81.227a1.8 1.8 0 0 1-.43.725q-.302.309-.746.483-.443.17-.998.17m4.145-.057a.61.61 0 0 1-.451-.188.61.61 0 0 1-.189-.451q0-.262.189-.451a.62.62 0 0 1 .451-.188q.262 0 .451.188a.62.62 0 0 1 .188.451.66.66 0 0 1-.32.554.6.6 0 0 1-.319.085m2.754 0a.61.61 0 0 1-.451-.188.61.61 0 0 1-.189-.451q0-.262.189-.451a.62.62 0 0 1 .451-.188q.262 0 .451.188a.62.62 0 0 1 .188.451.66.66 0 0 1-.32.554.6.6 0 0 1-.319.085m2.753 0a.61.61 0 0 1-.451-.188.62.62 0 0 1-.188-.451q0-.262.188-.451a.62.62 0 0 1 .451-.188q.264 0 .451.188a.62.62 0 0 1 .189.451.66.66 0 0 1-.32.554.6.6 0 0 1-.32.085"})),rt||(rt=n.createElement("path",{fill:"#D40101",d:"M362.322 245.635a2.8 2.8 0 0 0 0-5.6zm-96.363-4.78a2.8 2.8 0 0 0 0 3.96l17.819 17.819a2.801 2.801 0 0 0 3.96-3.96l-15.839-15.839 15.839-15.839a2.8 2.8 0 1 0-3.96-3.96zm96.363 1.98v-2.8h-94.383v5.6h94.383z"})))};class lt extends n.Component{constructor(e){super(e),this.bindCallbacks()}bindCallbacks(){this.handleExtensionNotInstalledClick=this.handleExtensionNotInstalledClick.bind(this)}handleExtensionNotInstalledClick(){this.props.onExtensionNotDownloaded()}render(){const e=window.matchMedia("(prefers-color-scheme: dark)").matches;return n.createElement("div",{className:"install-extension"},n.createElement("h1",null,n.createElement(I.x,null,"Allow the extension on every website.")),n.createElement("p",null,n.createElement(I.x,null,"Once the extension is installed, it must be allowed on every website, otherwise it won't work as expected."," ",n.createElement("a",{href:"https://www.passbolt.com/docs/safari-onboarding",rel:"noopener noreferrer",target:"_blank"},"Learn more"))),e?n.createElement(ot,null):n.createElement(Ge,null),n.createElement("div",{className:"form-actions"},n.createElement("p",null,n.createElement(I.x,null,"Click on ",n.createElement("span",{className:"passbolt-logo"},"@"),' in the toolbar and select "',n.createElement("strong",null,"Always allow on every website…"),'"')),n.createElement("button",{className:"link",type:"button",onClick:this.handleExtensionNotInstalledClick},n.createElement(I.x,null,"I didn't install the extension"))))}}lt.propTypes={context:c().any,onExtensionNotDownloaded:c().func};const ct=a((0,P.C)("common")(lt));class dt extends n.Component{componentDidMount(){this.initializeSetup()}initializeSetup(){setTimeout(()=>this.props.apiSetupContext.onInitializeSetupRequested(),1e3)}render(){switch(this.props.apiSetupContext.state){case N.INSTALL_EXTENSION_STATE:return n.createElement($,null);case N.INSTALL_SAFARI_EXTENSION_STATE:return n.createElement(ue,{onExtensionDownloading:this.props.apiSetupContext.handleSafariExtensionDownloading,onExtensionAlreadyInstalled:this.props.apiSetupContext.handleExtensionAlreadyInstalled});case N.CONFIGURE_SAFARI_EXTENSION_STATE:return n.createElement(ct,{onExtensionNotDownloaded:this.props.apiSetupContext.handleSafariExtensionNotDownloaded});case N.DOWNLOAD_SUPPORTED_BROWSER_STATE:return n.createElement(K,null);case N.TOKEN_EXPIRED_STATE:return n.createElement(H,null);case N.ERROR_ALREADY_SIGNED_IN_STATE:return n.createElement(J,{onLogoutButtonClick:this.props.apiSetupContext.logoutUserAndRefresh,displayAs:W});case N.REQUEST_INVITATION_ERROR:return n.createElement(j,null);case N.UNEXPECTED_ERROR_STATE:return n.createElement(ae,{error:this.props.apiSetupContext.unexpectedError});default:return n.createElement(L,null)}}}dt.propTypes={apiSetupContext:c().object};const ht=q(dt);var pt;function ut(){return ut=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)({}).hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},ut.apply(null,arguments)}const mt=function(e){return n.createElement("svg",ut({xmlns:"http://www.w3.org/2000/svg",width:17,height:16,fill:"none",viewBox:"0 0 17 16"},e),pt||(pt=n.createElement("g",{clipPath:"url(#heart_svg__clip0_93_734678)"},n.createElement("path",{stroke:"var(--icon-color)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M13.497 9.333c.993-.973 2-2.14 2-3.666A3.667 3.667 0 0 0 11.83 2c-1.173 0-2 .333-3 1.333-1-1-1.827-1.333-3-1.333a3.667 3.667 0 0 0-3.667 3.667c0 1.533 1 2.7 2 3.666L8.83 14z"}))))};class gt extends n.Component{render(){return n.createElement("div",{className:"tooltip",tabIndex:"0"},this.props.children,n.createElement("span",{className:`tooltip-text ${this.props.direction}`},this.props.message))}}gt.defaultProps={direction:"right"},gt.propTypes={children:c().any,message:c().any.isRequired,direction:c().string};const Et=gt;var yt=s(28097),bt=s(44296);const ft=n.createContext({dialogs:[],open:()=>{},close:()=>{}});class vt extends n.Component{constructor(e){super(e),this.state=this.defaultState}get defaultState(){return{dialogs:[],open:(e,t)=>{const s=(0,bt.A)();return this.setState(n=>({dialogs:[...n.dialogs,{key:s,Dialog:e,DialogProps:t}]})),s},close:e=>{this.setState(t=>({dialogs:t.dialogs.filter(t=>e!==t.key)}))},closeAll:()=>this.setState({dialogs:[]})}}render(){return n.createElement(ft.Provider,{value:this.state},this.props.children)}}function St(e){return class extends n.Component{render(){return n.createElement(ft.Consumer,null,t=>n.createElement(e,{dialogContext:t,...this.props}))}}}vt.displayName="DialogContextProvider",vt.propTypes={children:c().any};var Tt=s(75410);const wt=["/app/administration","/app/administration/mfa","/app/administration/mfa-policy","/app/administration/password-policies","/app/administration/secret-history","/app/administration/self-registration","/app/administration/users-directory","/app/administration/healthcheck","/app/administration/email-notification","/app/administration/smtp-settings","/app/administration/subscription","/app/administration/ce-downgrade","/app/administration/internationalization","/app/administration/account-recovery","/app/administration/sso","/app/administration/rbacs","/app/administration/content-types/metadata-getting-started","/app/administration/user-provisionning/scim","/app/administration/user-passphrase-policies","/app/administration/password-expiry","/app/administration/content-types/metadata","/app/administration/content-types/metadata-key","/app/administration/migrate-metadata","/app/administration/allow-content-types","/app/administration/subscription-teasing","/app/administration/password-policies-teasing","/app/administration/user-passphrase-policies-teasing","/app/administration/account-recovery-teasing","/app/administration/sso-teasing","/app/administration/mfa-policy-teasing","/app/administration/users-directory-teasing","/app/administration/scim-teasing","/app/administration/offline","/app/passwords","/app/users","/app/settings/profile","/app/settings/passphrase","/app/settings/security-token","/app/settings/theme","/app/settings/mfa","/app/settings/keys","/app/settings/mobile","/app/settings/desktop","/app/settings/account-recovery"],xt=n.createContext({onGoToAdministrationRequested:()=>{},onGoToAdministrationSelfRegistrationRequested:()=>{},onGoToAdministrationMfaRequested:()=>{},onGoToAdministrationUsersDirectoryRequested:()=>{},onGoToAdministrationEmailNotificationsRequested:()=>{},onGoToAdministrationSubscriptionRequested:()=>{},onGoToAdministrationDowngradeToCeRequested:()=>{},onGoToAdministrationInternationalizationRequested:()=>{},onGoToAdministrationAccountRecoveryRequested:()=>{},onGoToAdministrationSmtpSettingsRequested:()=>{},onGoToAdministrationSsoRequested:()=>{},onGoToAdministrationPasswordPoliciesRequested:()=>{},onGoToAdministrationSecretHistoryRequested:()=>{},onGoToAdministrationUserPassphrasePoliciesRequested:()=>{},onGoToAdministrationPasswordExpirySettingsRequested:()=>{},onGoToAdministrationHealthcheckRequested:()=>{},onGoToPasswordsRequested:()=>{},onGoToUsersRequested:()=>{},onGoToTermsRequested:()=>{},onGoToHelpRequested:()=>{},onGoToUserSettingsProfileRequested:()=>{},onGoToUserSettingsPassphraseRequested:()=>{},onGoToUserSettingsSecurityTokenRequested:()=>{},onGoToUserSettingsThemeRequested:()=>{},onGoToUserSettingsMfaRequested:()=>{},onGoToUserSettingsKeysRequested:()=>{},onGoToUserSettingsMobileRequested:()=>{},onGoToUserSettingsDesktopRequested:()=>{},onGoToUserSettingsAccountRecoveryRequested:()=>{},onGoToSubscriptionUpdateQuantityRequested:()=>{},onGoToSubscriptionRenewRequested:()=>{},onGoToAdministrationRbacsRequested:()=>{},onGoToAdministrationMigrateMetadataRequested:()=>{},onGoToAdministrationAllowContentTypesRequested:()=>{},onGoToAdministrationMetadataGettingStartedRequested:()=>{},onGoToAdministrationSubscriptionRequestedTeasing:()=>{},onGoToAdministrationPasswordPoliciesRequestedTeasing:()=>{},onGoToAdministrationUserPassphrasePoliciesRequestedTeasing:()=>{},onGoToAdministrationAccountRecoveryRequestedTeasing:()=>{},onGoToAdministrationSsoRequestedTeasing:()=>{},onGoToAdministrationMfaPolicyRequestedTeasing:()=>{},onGoToAdministrationUsersDirectoryRequestedTeasing:()=>{},onGoToAdministrationScimRequestedTeasing:()=>{},onGoToAdministrationScimRequested:()=>{},onGoToAdministrationOfflineRequested:()=>{}});class At extends n.Component{constructor(e){super(e),this.state=this.defaultState}get defaultState(){return{onGoToAdministrationRequested:this.onGoToAdministrationRequested.bind(this),onGoToAdministrationMfaRequested:this.onGoToAdministrationMfaRequested.bind(this),onGoToAdministrationUsersDirectoryRequested:this.onGoToAdministrationUsersDirectoryRequested.bind(this),onGoToAdministrationEmailNotificationsRequested:this.onGoToAdministrationEmailNotificationsRequested.bind(this),onGoToAdministrationSubscriptionRequested:this.onGoToAdministrationSubscriptionRequested.bind(this),onGoToAdministrationDowngradeToCeRequested:this.onGoToAdministrationDowngradeToCeRequested.bind(this),onGoToAdministrationInternationalizationRequested:this.onGoToAdministrationInternationalizationRequested.bind(this),onGoToAdministrationAccountRecoveryRequested:this.onGoToAdministrationAccountRecoveryRequested.bind(this),onGoToAdministrationSmtpSettingsRequested:this.onGoToAdministrationSmtpSettingsRequested.bind(this),onGoToAdministrationSelfRegistrationRequested:this.onGoToAdministrationSelfRegistrationRequested.bind(this),onGoToAdministrationSsoRequested:this.onGoToAdministrationSsoRequested.bind(this),onGoToAdministrationMfaPolicyRequested:this.onGoToAdministrationMfaPolicyRequested.bind(this),onGoToAdministrationPasswordPoliciesRequested:this.onGoToAdministrationPasswordPoliciesRequested.bind(this),onGoToAdministrationSecretHistoryRequested:this.onGoToAdministrationSecretHistoryRequested.bind(this),onGoToAdministrationUserPassphrasePoliciesRequested:this.onGoToAdministrationUserPassphrasePoliciesRequested.bind(this),onGoToAdministrationPasswordExpirySettingsRequested:this.onGoToAdministrationPasswordExpirySettingsRequested.bind(this),onGoToAdministrationHealthcheckRequested:this.onGoToAdministrationHealthcheckRequested.bind(this),onGoToAdministrationContentTypesEncryptedMetadataRequested:this.onGoToAdministrationContentTypesEncryptedMetadataRequested.bind(this),onGoToAdministrationContentTypesMetadataKeyRequested:this.onGoToAdministrationContentTypesMetadataKeyRequested.bind(this),onGoToAdministrationMigrateMetadataRequested:this.onGoToAdministrationMigrateMetadataRequested.bind(this),onGoToAdministrationAllowContentTypesRequested:this.onGoToAdministrationAllowContentTypesRequested.bind(this),onGoToPasswordsRequested:this.onGoToPasswordsRequested.bind(this),onGoToUsersRequested:this.onGoToUsersRequested.bind(this),onGoToHelpRequested:this.onGoToHelpRequested.bind(this),onGoToTermsRequested:this.onGoToTermsRequested.bind(this),onGoToUserSettingsProfileRequested:this.onGoToUserSettingsProfileRequested.bind(this),onGoToUserSettingsPassphraseRequested:this.onGoToUserSettingsPassphraseRequested.bind(this),onGoToUserSettingsSecurityTokenRequested:this.onGoToUserSettingsSecurityTokenRequested.bind(this),onGoToUserSettingsThemeRequested:this.onGoToUserSettingsThemeRequested.bind(this),onGoToUserSettingsMfaRequested:this.onGoToUserSettingsMfaRequested.bind(this),onGoToUserSettingsKeysRequested:this.onGoToUserSettingsKeysRequested.bind(this),onGoToUserSettingsMobileRequested:this.onGoToUserSettingsMobileRequested.bind(this),onGoToUserSettingsDesktopRequested:this.onGoToUserSettingsDesktopRequested.bind(this),onGoToUserSettingsAccountRecoveryRequested:this.onGoToUserSettingsAccountRecoveryRequested.bind(this),onGoToSubscriptionUpdateQuantityRequested:this.onGoToSubscriptionUpdateQuantityRequested.bind(this),onGoToSubscriptionRenewRequested:this.onGoToSubscriptionRenewRequested.bind(this),onGoToAdministrationRbacsRequested:this.onGoToAdministrationRbacsRequested.bind(this),onGoToAdministrationMetadataGettingStartedRequested:this.onGoToAdministrationMetadataGettingStartedRequested.bind(this),onGoToAdministrationSubscriptionRequestedTeasing:this.onGoToAdministrationSubscriptionRequestedTeasing.bind(this),onGoToAdministrationPasswordPoliciesRequestedTeasing:this.onGoToAdministrationPasswordPoliciesRequestedTeasing.bind(this),onGoToAdministrationUserPassphrasePoliciesRequestedTeasing:this.onGoToAdministrationUserPassphrasePoliciesRequestedTeasing.bind(this),onGoToAdministrationAccountRecoveryRequestedTeasing:this.onGoToAdministrationAccountRecoveryRequestedTeasing.bind(this),onGoToAdministrationSsoRequestedTeasing:this.onGoToAdministrationSsoRequestedTeasing.bind(this),onGoToAdministrationMfaPolicyRequestedTeasing:this.onGoToAdministrationMfaPolicyRequestedTeasing.bind(this),onGoToAdministrationUsersDirectoryRequestedTeasing:this.onGoToAdministrationUsersDirectoryRequestedTeasing.bind(this),onGoToAdministrationScimRequestedTeasing:this.onGoToAdministrationScimRequestedTeasing.bind(this),onGoToAdministrationScimRequested:this.onGoToAdministrationScimRequested.bind(this),onGoToAdministrationOfflineRequested:this.onGoToAdministrationOfflineRequested.bind(this)}}async goTo(e,t){if(!wt.includes(t))throw new Error("The pathname is not part of the allowed list of pathnames.");if(e===this.props.context.name)return void await this.props.history.push({pathname:t});if("api"===e)return void await this.props.context.port.request("passbolt.tabs.open-admin-page",t);const s=`${this.props.context.userSettings?this.props.context.userSettings.getTrustedDomain():this.props.context.trustedDomain}${t}`;window.open(s,"_parent","noopener,noreferrer")}async onGoToAdministrationRequested(){await this.goTo("browser-extension","/app/administration")}async onGoToAdministrationMfaRequested(){await this.goTo("api","/app/administration/mfa")}async onGoToAdministrationMfaPolicyRequested(){await this.goTo("api","/app/administration/mfa-policy")}async onGoToAdministrationPasswordPoliciesRequested(){await this.goTo("browser-extension","/app/administration/password-policies")}async onGoToAdministrationSecretHistoryRequested(){await this.goTo("browser-extension","/app/administration/secret-history")}async onGoToAdministrationOfflineRequested(){await this.goTo("browser-extension","/app/administration/offline")}async onGoToAdministrationSelfRegistrationRequested(){await this.goTo("api","/app/administration/self-registration")}async onGoToAdministrationUsersDirectoryRequested(){await this.goTo("api","/app/administration/users-directory")}async onGoToAdministrationHealthcheckRequested(){await this.goTo("api","/app/administration/healthcheck")}async onGoToAdministrationEmailNotificationsRequested(){await this.goTo("api","/app/administration/email-notification")}async onGoToAdministrationSmtpSettingsRequested(){await this.goTo("api","/app/administration/smtp-settings")}async onGoToAdministrationSubscriptionRequested(){await this.goTo("browser-extension","/app/administration/subscription")}async onGoToAdministrationDowngradeToCeRequested(){await this.goTo("browser-extension","/app/administration/ce-downgrade")}async onGoToAdministrationInternationalizationRequested(){await this.goTo("api","/app/administration/internationalization")}async onGoToAdministrationAccountRecoveryRequested(){await this.goTo("browser-extension","/app/administration/account-recovery")}async onGoToAdministrationSsoRequested(){await this.goTo("browser-extension","/app/administration/sso")}async onGoToAdministrationRbacsRequested(){await this.goTo("api","/app/administration/rbacs")}async onGoToAdministrationMetadataGettingStartedRequested(){await this.goTo("browser-extension","/app/administration/content-types/metadata-getting-started")}async onGoToAdministrationScimRequested(){await this.goTo("browser-extension","/app/administration/user-provisionning/scim")}async onGoToAdministrationUserPassphrasePoliciesRequested(){await this.goTo("browser-extension","/app/administration/user-passphrase-policies")}async onGoToAdministrationPasswordExpirySettingsRequested(){await this.goTo("browser-extension","/app/administration/password-expiry")}async onGoToAdministrationContentTypesEncryptedMetadataRequested(){await this.goTo("browser-extension","/app/administration/content-types/metadata")}async onGoToAdministrationContentTypesMetadataKeyRequested(){await this.goTo("browser-extension","/app/administration/content-types/metadata-key")}async onGoToAdministrationMigrateMetadataRequested(){await this.goTo("browser-extension","/app/administration/migrate-metadata")}async onGoToAdministrationAllowContentTypesRequested(){await this.goTo("browser-extension","/app/administration/allow-content-types")}async onGoToAdministrationSubscriptionRequestedTeasing(){await this.goTo("browser-extension","/app/administration/subscription-teasing")}async onGoToAdministrationPasswordPoliciesRequestedTeasing(){await this.goTo("browser-extension","/app/administration/password-policies-teasing")}async onGoToAdministrationUserPassphrasePoliciesRequestedTeasing(){await this.goTo("browser-extension","/app/administration/user-passphrase-policies-teasing")}async onGoToAdministrationAccountRecoveryRequestedTeasing(){await this.goTo("browser-extension","/app/administration/account-recovery-teasing")}async onGoToAdministrationSsoRequestedTeasing(){await this.goTo("browser-extension","/app/administration/sso-teasing")}async onGoToAdministrationMfaPolicyRequestedTeasing(){await this.goTo("browser-extension","/app/administration/mfa-policy-teasing")}async onGoToAdministrationUsersDirectoryRequestedTeasing(){await this.goTo("browser-extension","/app/administration/users-directory-teasing")}async onGoToAdministrationScimRequestedTeasing(){await this.goTo("browser-extension","/app/administration/scim-teasing")}get isMfaEnabled(){const e=this.props.context.siteSettings;return e&&e.canIUse("multiFactorAuthentication")}get isUserDirectoryEnabled(){const e=this.props.context.siteSettings;return e&&e.canIUse("directorySync")}get isSmtpSettingsEnable(){const e=this.props.context.siteSettings;return e&&e.canIUse("smtpSettings")}get isSelfRegistrationEnable(){const e=this.props.context.siteSettings;return e&&e.canIUse("selfRegistration")}get isPasswordPoliciesEnable(){const e=this.props.context.siteSettings;return e&&e.canIUse("passwordPoliciesUpdate")}get isUserPassphrasePoliciesEnable(){const e=this.props.context.siteSettings;return e&&e.canIUse("userPassphrasePolicies")}get isPasswordExpiryEnable(){const e=this.props.context.siteSettings;return e&&e.canIUse("passwordExpiry")}async onGoToPasswordsRequested(){await this.goTo("browser-extension","/app/passwords")}async onGoToUsersRequested(){await this.goTo("browser-extension","/app/users")}async onGoToHelpRequested(){window.open("https://www.passbolt.com/docs/","_blank","noopener,noreferrer")}async onGoToTermsRequested(){window.open("https://www.passbolt.com/terms","_blank","noopener,noreferrer")}async onGoToSubscriptionUpdateQuantityRequested(e,t){const s=`https://www.passbolt.com/subscription/ee/update/qty?subscription_id=${encodeURIComponent(e)}&customer_id=${encodeURIComponent(t)}`;window.open(s,"_blank","noopener,noreferrer")}async onGoToSubscriptionRenewRequested(e,t){const s=`https://www.passbolt.com/subscription/ee/update/renew?subscription_id=${encodeURIComponent(e)}&customer_id=${encodeURIComponent(t)}`;window.open(s,"_blank","noopener,noreferrer")}async onGoToUserSettingsProfileRequested(){await this.goTo("browser-extension","/app/settings/profile")}async onGoToUserSettingsPassphraseRequested(){await this.goTo("browser-extension","/app/settings/passphrase")}async onGoToUserSettingsSecurityTokenRequested(){await this.goTo("browser-extension","/app/settings/security-token")}async onGoToUserSettingsThemeRequested(){await this.goTo("browser-extension","/app/settings/theme")}async onGoToUserSettingsMfaRequested(){await this.goTo("browser-extension","/app/settings/mfa")}async onGoToUserSettingsKeysRequested(){await this.goTo("browser-extension","/app/settings/keys")}async onGoToUserSettingsMobileRequested(){await this.goTo("browser-extension","/app/settings/mobile")}async onGoToUserSettingsDesktopRequested(){await this.goTo("browser-extension","/app/settings/desktop")}async onGoToUserSettingsAccountRecoveryRequested(){await this.goTo("browser-extension","/app/settings/account-recovery")}render(){return n.createElement(xt.Provider,{value:this.state},this.props.children)}}At.displayName="NavigationContextProvider",At.propTypes={context:c().object,children:c().any,location:c().object,match:c().object,history:c().object},(0,Tt.withRouter)(a(At));const Ct=n.createContext({counter:[],add:()=>{},remove:()=>{}});class Rt extends n.Component{constructor(e){super(e),this.state=this.defaultState}get defaultState(){return{counter:0,add:()=>{this.setState(e=>({counter:e.counter+1}))},remove:()=>{this.setState(e=>({counter:Math.min(e.counter-1,0)}))}}}render(){return n.createElement(Ct.Provider,{value:this.state},this.props.children)}}Rt.propTypes={children:c().any};class qt{}class Nt extends qt{static execute(){return!0}}class kt extends qt{static execute(){return!1}}const _t="Folders.use",Ot="Administration.viewWorkspace",It="GroupsAdd.addPost",Pt="AccountRecoveryRequestsView.view",Dt="AccountRecoveryRequestsIndex.index",Ut="AccountRecoveryResponsesCreate.post",Gt="Allow",Lt="Deny",Mt="AllowIfGroupManagerInOneGroup",Ft={[Gt]:Nt,[Lt]:kt,[Mt]:class extends qt{static execute(e){return e.groups_users.some(e=>e.is_admin)}}},$t={[_t]:Ft[Gt]},Vt={[Ot]:Ft[Lt],[It]:Ft[Lt],[Pt]:Ft[Lt],[Dt]:Ft[Lt],[Ut]:Ft[Lt]};class Kt{static getByRbac(e){return Ft[e.controlFunction]||(console.warn(`Could not find control function for the given rbac entity (${e.id})`),kt)}static getDefaultForAdminAndAction(e){return $t[e]||Nt}static getDefaultForUserAndAction(e){return Vt[e]||Nt}}class Bt extends Error{constructor(e="Collection validation error."){super(e),this.name="CollectionValidationError",this.errors=[]}addItemValidationError(e,t){if(!Number.isInteger(e))throw new TypeError('CollectionValidationError::addEntityValidationError expects "position" to be an integer.');if(!(t instanceof Ht||t instanceof Bt))throw new TypeError('CollectionValidationError::addEntityValidationError expects "entityValidationError" to be an instance of EntityValidationError or CollectionValidationError.');this.errors[e]=t}addCollectionValidationError(e,t){if("string"!=typeof e)throw new TypeError('CollectionValidationError::addCollectionValidationError expects "rule" to be a string.');if("string"!=typeof t)throw new TypeError('CollectionValidationError::addCollectionValidationError expects "error" to be a string.');this.errors[e]=t}hasErrors(){return this.errors.some(e=>Object.keys(e.details).length>0)}get details(){const e={};for(const t in this.errors)this.errors[t]instanceof Ht||this.errors[t]instanceof Bt?e[t]=this.errors[t].details:e[t]=this.errors[t];return e}}const jt=Bt;class zt extends Error{constructor(e="Entity validation error."){super(e),this.name="EntityValidationError",this.details={}}addError(e,t,s){if("string"!=typeof e)throw new TypeError("EntityValidationError addError property should be a string.");if("string"!=typeof t)throw new TypeError("EntityValidationError addError rule should be a string.");if("string"!=typeof s)throw new TypeError("EntityValidationError addError message should be a string.");Object.prototype.hasOwnProperty.call(this.details,e)||(this.details[e]={}),this.details[e][t]=s}addAssociationError(e,t){if("string"!=typeof e)throw new TypeError("EntityValidationError addAssociationError associationName should be a string.");if(!(t instanceof zt||t instanceof jt))throw new TypeError("EntityValidationError addAssociationError errorDetails should be an object.");this.details[e]=t}getError(e,t){if(!this.hasError(e,t))return null;const s=this.details[e];return t?s[t]:s}hasError(e,t){if("string"!=typeof e)throw new TypeError("EntityValidationError hasError property should be a string.");const s=this.details&&Object.prototype.hasOwnProperty.call(this.details,e);if(!s)return!1;if(!t)return s;if("string"!=typeof t)throw new TypeError("EntityValidationError hasError rule should be a string.");return Object.prototype.hasOwnProperty.call(this.details[e],t)}hasErrors(){return Object.keys(this.details).length>0}getFirstRuleErrorByField(e){if(!this.hasError(e))return null;const t=this.details[e];return t[Object.keys(t)[0]]}}const Ht=zt;var Wt=s(57761),Yt=s.n(Wt);class Zt{static validateSchema(e,t){if(!t)throw new TypeError(`Could not validate entity ${e}. No schema for entity ${e}.`);if(!t.type)throw new TypeError(`Could not validate entity ${e}. Type missing.`);if("array"!==t.type){if("object"===t.type){if(!t.required||!Array.isArray(t.required))throw new TypeError(`Could not validate entity ${e}. Schema error: no required properties.`);if(!t.properties||!Object.keys(t).length)throw new TypeError(`Could not validate entity ${e}. Schema error: no properties.`);const s=t.properties;for(const e in s){if(!Object.prototype.hasOwnProperty.call(s,e)||!s[e].type&&!s[e].anyOf)throw TypeError(`Invalid schema. Type missing for ${e}...`);if(s[e].anyOf&&(!Array.isArray(s[e].anyOf)||!s[e].anyOf.length))throw new TypeError(`Invalid schema, prop ${e} anyOf should be an array`)}}}else if(!t.items)throw new TypeError(`Could not validate entity ${e}. Schema error: missing item definition.`)}static validate(e,t,s){if(!e||!t||!s)throw new TypeError(`Could not validate entity ${e}. No data provided.`);switch(s.type){case"object":return Zt.validateObject(e,t,s);case"array":return Zt.validateArray(e,t,s);default:throw new TypeError(`Could not validate entity ${e}. Unsupported type.`)}}static validateArray(e,t,s){let n;const i=Zt.validateProp("items",t,s);if("number"==typeof s.minItems&&(Zt.isGreaterThanOrEqual(t.length,s.minItems)||(n=Zt.handleCollectionValidationError("minItems",`The items array should contain at least ${s.minItems} item(s).`,n))),"number"==typeof s.maxItems&&(Zt.isLessThanOrEqual(t.length,s.maxItems)||(n=Zt.handleCollectionValidationError("maxItems",`The items array should contain at maximum ${s.maxItems} item(s).`,n))),n)throw n;return i}static validateObject(e,t,s){const n=s.required,i=s.properties,r={};let a;for(const s in i)if(Object.prototype.hasOwnProperty.call(i,s))if(null!==t?.[s]||!0!==i[s]?.nullable){if(n.includes(s)){if(!Object.prototype.hasOwnProperty.call(t,s)){a=Zt.getOrInitEntityValidationError(e,a),a.addError(s,"required",`The ${s} is required.`);continue}}else if(!Object.prototype.hasOwnProperty.call(t,s))continue;try{r[s]=Zt.validateProp(s,t[s],i[s])}catch(t){if(!(t instanceof Ht))throw t;a=Zt.getOrInitEntityValidationError(e,a),a.details[s]=t.details[s]}}else r[s]=null;if(a)throw a;return r}static getOrInitEntityValidationError(e,t){return t||new Ht(`Could not validate entity ${e}.`)}static validateProp(e,t,s){if(s.anyOf)return Zt.validateAnyOf(e,t,s.anyOf),t;if(!0===s.nullable&&null===t)return t;if(Zt.validatePropType(e,t,s),s.enum)return Zt.validatePropEnum(e,t,s),t;switch(s.type){case"string":Zt.validatePropTypeString(e,t,s);break;case"integer":case"number":Zt.validatePropTypeNumber(e,t,s);break;case"array":Zt.validatePropTypeArray(e,t,s);break;case"object":case"boolean":case"blob":case"null":break;case"x-custom":Zt.validatePropCustom(e,t,s);break;default:throw new TypeError(`Could not validate property ${e}. Unsupported prop type ${s.type}`)}return t}static validatePropType(e,t,s){if(!Zt.isValidPropType(t,s.type))throw Zt.handlePropertyValidationError(e,"type",`The ${e} is not a valid ${s.type}.`)}static validatePropCustom(e,t,s){try{s.validationCallback(t)}catch(t){throw Zt.handlePropertyValidationError(e,"custom",`The ${e} is not valid: ${t.message}`)}}static validatePropTypeString(e,t,s){let n;if(s.format&&(Zt.isValidStringFormat(t,s.format)||(n=Zt.handlePropertyValidationError(e,"format",`The ${e} is not a valid ${s.format}.`,n))),s.length&&(Zt.isValidStringLength(t,s.length,s.length)||(n=Zt.handlePropertyValidationError(e,"length",`The ${e} should be ${s.length} character in length.`,n))),s.minLength&&(Zt.isValidStringLength(t,s.minLength)||(n=Zt.handlePropertyValidationError(e,"minLength",`The ${e} should be ${s.minLength} character in length minimum.`,n))),s.maxLength&&(Zt.isValidStringLength(t,0,s.maxLength)||(n=Zt.handlePropertyValidationError(e,"maxLength",`The ${e} should be ${s.maxLength} character in length maximum.`,n))),s.pattern&&(Yt().matches(t,s.pattern)||(n=Zt.handlePropertyValidationError(e,"pattern",`The ${e} is not valid.`,n))),s.custom&&(s.custom(t)||(n=Zt.handlePropertyValidationError(e,"custom",`The ${e} is not valid.`,n))),n)throw n}static handlePropertyValidationError(e,t,s,n=null){return(n=n||new Ht(`Could not validate property ${e}.`)).addError(e,t,s),n}static handleCollectionValidationError(e,t,s=null){return(s=s||new jt("Could not validate collection.")).addCollectionValidationError(e,t),s}static validatePropTypeNumber(e,t,s){let n;if("number"==typeof s.minimum&&(Zt.isGreaterThanOrEqual(t,s.minimum)||(n=Zt.handlePropertyValidationError(e,"minimum",`The ${e} should be greater or equal to ${s.minimum}.`,n))),"number"==typeof s.maximum&&(Zt.isLesserThanOrEqual(t,s.maximum)||(n=Zt.handlePropertyValidationError(e,"maximum",`The ${e} should be lesser or equal to ${s.maximum}.`,n))),n)throw n}static validatePropTypeArray(e,t,s){let n;if(s?.items&&"object"==typeof s.items){for(let i=0;i<t.length;i++){const r=`${e}.${i}`;try{this.validateProp(r,t[i],s.items)}catch(t){if(!(t instanceof Ht))throw t;{n=Zt.getOrInitEntityValidationError(e,n);const s=t.details[r];n.details[e]={...n.details[e],[i]:s}}}}if(n)throw n}}static validatePropEnum(e,t,s){if(!Zt.isPropInEnum(t,s.enum)){const t=new Ht(`Could not validate property ${e}.`);throw t.addError(e,"enum",`The ${e} value is not included in the supported list.`),t}}static validateAnyOf(e,t,s){for(let n=0;n<s.length;n++)try{return void Zt.validateProp(e,t,s[n])}catch{}const n=new Ht(`Could not validate property ${e}.`);throw n.addError(e,"type",`The ${e} does not match any of the supported types.`),n}static isValidPropType(e,t){if(Array.isArray(t))throw new TypeError("EntitySchema isValidPropType multiple types are not supported.");if("string"!=typeof t)throw new TypeError("EntitySchema isValidPropType type is invalid.");switch(t){case"null":return null===e;case"boolean":return"boolean"==typeof e;case"string":return"string"==typeof e;case"integer":return Number.isInteger(e);case"number":return"number"==typeof e;case"object":return"object"==typeof e;case"array":return Array.isArray(e);case"blob":return e instanceof Blob;case"x-custom":return!0;default:throw new TypeError("EntitySchema validation type not supported.")}}static isValidStringFormat(e,t){if("string"!=typeof t)throw new TypeError("EntitySchema validPropFormat format is invalid.");switch(t){case"uuid":return Yt().isUUID(e);case"email":case"idn-email":return Yt().isEmail(e);case"date-time":return Yt().isISO8601(e);case"x-hex-color":return Yt().isHexColor(e);case"x-base64":return Yt().isBase64(e);default:throw new TypeError(`EntitySchema string validation format ${t} is not supported.`)}}static isValidStringLength(e,t,s){return t=t||0,Yt().isLength(e,t,s)}static isPropInEnum(e,t){if(!t||!Array.isArray(t)||!t.length)throw new TypeError("EntitySchema enum schema cannot be empty.");return t.includes(e)}static isGreaterThanOrEqual(e,t){return e>=t}static isLessThanOrEqual(e,t){return e<=t}static isLesserThanOrEqual(e,t){return e<=t}}const Xt=Zt;class Jt{constructor(e,t={}){(t?.clone??!0)&&(e=JSON.parse(JSON.stringify(e))),this._props=e}toDto(){return JSON.parse(JSON.stringify(this))}toJSON(){return this._props}_hasProp(e){if(!e.includes(".")){const t=Jt._normalizePropName(e);return Object.prototype.hasOwnProperty.call(this._props,t)}try{return this._getPropByPath(e),!0}catch(t){return console.error(`Failed to check if property "${e}" is set:`,t),!1}}_getPropByPath(e){return Jt._normalizePropName(e).split(".").reduce((e,t)=>{if(Object.prototype.hasOwnProperty.call(e,t))return e[t];throw new Error},this._props)}static _normalizePropName(e){return e.replace(/([A-Z])/g,(e,t)=>`_${t.toLowerCase()}`).replace(/\._/,".").replace(/^_/,"").replace(/^\./,"")}}const Qt=Jt;var es=s(5648);const ts=e=>e?.replace(/_([a-z])/g,(e,t)=>t.toUpperCase());class ss extends Error{constructor(e,t,s){if(super(s=s||"Entity collection error."),"number"!=typeof e)throw new TypeError("EntityCollectionError requires a valid position");if(!t||"string"!=typeof t)throw new TypeError("EntityCollectionError requires a valid rule");if(!s||"string"!=typeof s)throw new TypeError("EntityCollectionError requires a valid message");this.position=e,this.rule=t}}const ns=ss;class is{constructor(e=[],t={}){const s=t?.clone??!0;this._items=[],s&&(e=JSON.parse(JSON.stringify(e))),this._props=e}toDto(){return JSON.parse(JSON.stringify(this._items))}toJSON(){return this.toDto()}get items(){return this._items}get length(){return this._items.length}[Symbol.iterator](){let e=0;return{next:()=>e<this._items.length?{value:this._items[e++],done:!1}:{done:!0}}}getAll(e,t){if("string"!=typeof e)throw new TypeError("EntityCollection excludeAll expects propName to be string.");if("string"!=typeof t)throw new TypeError("EntityCollection excludeAll expects search to be string.");return this._items.filter(s=>Object.prototype.hasOwnProperty.call(s._props,e)&&s._props[e]===t)}getFirst(e,t){if("string"!=typeof e||"string"!=typeof t)throw new TypeError("EntityCollection getFirst by expect propName and search to be strings");const s=this.getAll(e,t);if(s&&s.length)return s[0]}extract(e){if("string"!=typeof e)throw new TypeError("EntityCollection extract expects propName to be a string.");return this._items.reduce((t,s)=>(void 0!==s._props[e]&&t.push(s._props[e]),t),[])}push(e){return this._items.push(e),this._items.length}unshift(e){return this._items.unshift(e),this._items.length}filterByPropertyValueIn(e,t,s=!0){if("string"!=typeof e)throw new TypeError("EntityCollection filterByPropertyValueIn expects propName to be a string.");if(!Array.isArray(t))throw new TypeError("EntityCollection filterByPropertyValueIn expects needles to be an array.");this.filterByCallback(n=>{const i=Object.prototype.hasOwnProperty.call(n._props,e);return!(s&&!i||i&&!t.includes(n._props[e]))})}filterByCallback(e){if("function"!=typeof e)throw new TypeError("EntityCollection filterByCallback expects callback to be a function.");for(let t=this._items.length-1;t>=0;t--)e(this._items[t])||this._items.splice(t,1)}assertUniqueByProperty(e,t){const s=`unique_${e}`,n=this.extract(e),i=new Set;t=t||`The collection should only contain items with unique values for the property: ${e}.`,n.forEach((e,n)=>{if(i.add(e),n!==i.size-1)throw new ns(n,s,t)})}assertNotExist(e,t,s={}){if(void 0===t)return;let n=s?.haystackSet;if(!n){const t=this.extract(e);n=new Set(t)}if(n.has(t)){const t=new Ht,n=s?.message||`The collection already includes an element that has a property (${e}) with an identical value.`;throw t.addError(e,"unique",n),t}}}const rs=is,as=["string","number","integer","boolean"];class os extends Qt{static _cachedSchema={};constructor(e={},t={}){const s=t?.validate??!0;super(e,t),this.marshall(),s&&this.validateSchema({schema:t?.schema,skipSchemaAssociationValidation:t?.skipSchemaAssociationValidation}),this.createAssociations(t),s&&this.validateBuildRules(t?.validateBuildRules)}marshall(){}validate(e={}){try{this.validateSchema({schema:e?.schema,skipSchemaAssociationValidation:e?.skipSchemaAssociationValidation}),this.validateBuildRules(e?.validateBuildRules),this.validateAssociations(e)}catch(e){if(!(e instanceof Ht))throw e;return e}return null}validateSchema(e=null){let t=e?.schema??this.cachedSchema;if(e?.skipSchemaAssociationValidation){t={...t};const e=Object.keys(this.constructor.associations),s=t.required.filter(t=>!e.includes(t));t.required=s}this._props=Xt.validate(this.constructor.name,this._props,t)}get cachedSchema(){return this.constructor._cachedSchema[this.constructor.name]||(this.constructor._cachedSchema[this.constructor.name]=this.constructor.getSchema()),this.constructor._cachedSchema[this.constructor.name]}static getSchema(){throw new Error("The entity class should declare its schema.")}validateBuildRules(e={}){}createAssociations(e={}){if(Object.keys(this.constructor.associations).length>0){const t=new Ht;for(const[s,n]of Object.entries(this.constructor.associations))try{this._props[s]&&(this[`_${ts(s)}`]=new n(this._props[s],{...e,clone:!1}),delete this._props[s])}catch(e){if(!(e instanceof Ht))throw e;t.addAssociationError(s,e)}if(t.hasErrors())throw t}}static get associations(){return{}}get(e){(0,es.A)(e);const t=this.constructor.getSchema().properties[e];if(!t)throw new Error(`The property "${e}" has no schema definition.`);if(!as.includes(t?.type))throw new Error('The property "associated_entity" should reference scalar properties only.');return this._props[e]}set(e,t,s={}){(0,es.A)(e);const n=s?.validate??!0;if(this.isAssociation(e))this.setAssociation(e,t,s);else{const i=e.split(".")[0],r=this.constructor.getSchema().properties[i];if(!r)throw new Error(`The property "${i}" has no schema definition.`);if("array"===r?.type)this.setArrayProp(e,t,s);else{if(r?.type&&!as.includes(r?.type))throw new Error('The property "associated_entity" should reference scalar properties only.');if(r?.anyOf?.some(e=>!as.includes(e.type)))throw new Error('The property "associated_entity" should reference scalar properties only.');n&&Xt.validateProp(i,t,r),this._props[i]=t}}}setArrayProp(e,t,s){(0,es.A)(e);const n=e.split("."),i=n[0];let r=null;const a=this.constructor.getSchema().properties[i],o=s?.validate??!0;if(2!==n.length)throw new Error(`The property "${n[0]}" has no index passed.`);{const e=n[1].match(/^(\d+)$/);if(!e)throw new Error(`The property "${n[0]}" has an invalid index format. Expected format: digits.`);r=parseInt(e[1],10)}if(!as.includes(a.items.type))throw new Error('The property "associated_entity" with array type should reference scalar properties only.');o&&Xt.validateProp(i,t,a.items),this._props[i]||(this._props[i]=[]),null!=t?this._props[i][r]=t:this._props[i].splice(r,1)}setCollection(e,t,s){(0,es.A)(e);const n=e.split("."),i=n[0];let r=null;if(1===n.length)t instanceof this.constructor.associations[e]?this[`_${i}`]=t:this[`_${i}`]=new this.constructor.associations[e](t,s);else{if(!(n.length>1))throw new Error(`The property "${n[0]}" has no index passed.`);{const e=n[1].match(/^(\d+)$/);if(!e)throw new Error(`The property "${n[0]}" has an invalid index format. Expected format: digits.`);r=parseInt(e[1],10)}}if(!this[`_${i}`])throw new Error(`The collection "${n[0]}" has no item".`);if(null!=t)if(n.length>2){if(!this[`_${i}`]._items[r])throw new Error(`The collection "${n[0]}" has no item at the index "${n[1]}".`);const e=n.slice(2).join(".");this[`_${i}`]._items[r].set(e,t,s)}else this[`_${i}`].push(t,s,s);else this[`_${i}`].items.splice(r,1)}setAssociation(e,t,s={}){if((0,es.A)(e),this.isAssociation(e)){const n=e.split("."),i=ts(n[0]);if(n.length>1)if(this[`_${i}`]||(this[`_${i}`]=new this.constructor.associations[n[0]]({},{validate:!1})),this[`_${i}`]instanceof rs){const e=n.toSpliced(0,1,i).join(".");this.setCollection(e,t,s)}else{const e=n.slice(1).join(".");this[`_${i}`].set(e,t,s)}else t instanceof this.constructor.associations[e]?this[`_${i}`]=t:this[`_${i}`]=new this.constructor.associations[e](t,s)}}validateAssociations(e={}){const t=new Ht;if(Object.keys(this.constructor.associations).length>0&&Object.keys(this.constructor.associations).forEach(s=>{const n=ts(s);if(this[`_${n}`]){const i=this[n].validate(e);i&&t.addAssociationError(s,i)}}),t.hasErrors())throw t}diffProps(e){if(!(e instanceof os))throw new TypeError('The property "compareEntity" should be of "EntityV2" type.');const t={},s=this.constructor.getSchema(),n=Object.keys(s.properties).filter(e=>as.includes(s.properties[e].type));for(const s of n){const n=this.get(s),i=e.get(s);n!==i&&(t[s]=i)}return t}hasDiffProps(e){const t=this.diffProps(e);return Object.keys(t).length>0}isAssociation(e){const t=e.split(".")[0];return Boolean(this.constructor.associations?.[t])}}const ls=os;class cs extends ls{static getSchema(){return{type:"object",required:["name"],properties:{id:{type:"string",format:"uuid"},name:{type:"string",minLength:1,maxLength:50},description:{type:"string",maxLength:255,nullable:!0},created:{type:"string",format:"date-time"},modified:{type:"string",format:"date-time"}}}}validateBuildRules(){this.assertNoTrailingSpaces("name",this._props.name)}get id(){return this._props.id||null}get name(){return this._props.name}isAdmin(){return this.name.toLowerCase()===cs.ROLE_ADMIN}isUser(){return this.name.toLowerCase()===cs.ROLE_USER}isGuest(){return this.name.toLowerCase()===cs.ROLE_GUEST}isAReservedRole(){return this.isAdmin()||this.isUser()||this.isGuest()}verifyHealth(){let e=null;return 50===this.name.length&&(e=new Ht,e.addError("name","maxLength","name reached maximum length limit")),e}assertNoTrailingSpaces(e,t){if(t.trim()!==t){const t=new Ht;throw t.addError(e,"trailing-spaces",`The property (${e}) contains forbidden trailing spaces.`),t}}static get ENTITY_NAME(){return"Role"}static get ROLE_ADMIN(){return"admin"}static get ROLE_USER(){return"user"}static get ROLE_GUEST(){return"guest"}static get ROLE_NAME_MAX_LENGTH(){return 50}toUpdateDto(){return{name:this.name}}}class ds{static canRoleUseAction(e,t,s){if("undefined"!=typeof window&&window.chrome?.webview){const n=t.findRbacByActionName(s);if(n)return Kt.getByRbac(n).execute(e)}const n=new cs(e.role);if(n.isAdmin())return Kt.getDefaultForAdminAndAction(s).execute();const i=t.findRbacByRoleAndActionName(n,s);return this.getByRbacOrDefault(i,s,e)}static getByRbacOrDefault(e,t,s){return e?Kt.getByRbac(e).execute(s):Kt.getDefaultForUserAndAction(t).execute()}}const hs=n.createContext({canIUseAction:()=>{}});class ps extends n.Component{constructor(e){super(e),this.state=this.defaultState}get defaultState(){return{canIUseAction:this.canIUseAction.bind(this)}}canIUseAction(e){return ds.canRoleUseAction(this.props.context.loggedInUser,this.props.context.rbacs,e)}render(){return n.createElement(hs.Provider,{value:this.state},this.props.children)}}ps.propTypes={context:c().any,children:c().any},a(ps);const us=n.createContext({selectedAdministration:null,can:{save:!1},must:{save:!1,editSubscriptionKey:!1,refreshSubscriptionKey:!1},administrationWorkspaceAction:null,setDisplayAdministrationWorkspaceAction:()=>{},resetDisplayAdministrationWorkspaceAction:()=>{},onUpdateSubscriptionKeyRequested:()=>{},onSaveEnabled:()=>{},onMustSaveSettings:()=>{},onMustEditSubscriptionKey:()=>{},onMustRefreshSubscriptionKey:()=>{},onResetActionsSettings:()=>{}});class ms extends n.Component{constructor(e){super(e),this.state=this.defaultState}get defaultState(){return{selectedAdministration:ys.NONE,can:{save:!1},must:{save:!1,editSubscriptionKey:!1,refreshSubscriptionKey:!1},administrationWorkspaceAction:()=>n.createElement(n.Fragment,null),setDisplayAdministrationWorkspaceAction:this.setDisplayAdministrationWorkspaceAction.bind(this),resetDisplayAdministrationWorkspaceAction:this.resetDisplayAdministrationWorkspaceAction.bind(this),onSaveEnabled:this.handleSaveEnabled.bind(this),onMustSaveSettings:this.handleMustSaveSettings.bind(this),onMustEditSubscriptionKey:this.handleMustEditSubscriptionKey.bind(this),onMustRefreshSubscriptionKey:this.handleMustRefreshSubscriptionKey.bind(this),onResetActionsSettings:this.handleResetActionsSettings.bind(this)}}componentDidMount(){this.handleAdministrationMenuRouteChange()}componentDidUpdate(e){this.handleRouteChange(e.location)}handleSaveEnabled(){this.setState({can:{...this.state.can,save:!0}})}handleMustSaveSettings(){this.setState({must:{...this.state.must,save:!0}})}handleMustEditSubscriptionKey(){this.setState({must:{...this.state.must,editSubscriptionKey:!0}})}handleMustRefreshSubscriptionKey(){this.setState({must:{...this.state.must,refreshSubscriptionKey:!0}})}handleResetActionsSettings(){this.setState({must:{save:!1,test:!1,synchronize:!1,editSubscriptionKey:!1,refreshSubscriptionKey:!1}})}handleRouteChange(e){this.props.location.key!==e.key&&this.handleAdministrationMenuRouteChange()}handleAdministrationMenuRouteChange(){const e={can:{save:!1,test:!1,synchronize:!1},must:{save:!1,test:!1,synchronize:!1,editSubscriptionKey:!1,refreshSubscriptionKey:!1}};if(!this.props.rbacContext.canIUseAction(Ot))return e.selectedAdministration=ys.HTTP_403_ACCESS_DENIED,void this.setState(e);const t=this.props.location.pathname,s=fs.homePage.test(t),n=fs.mfa.test(t),i=fs.mfaPolicy.test(t),r=fs.passwordPolicies.test(t),a=fs.usersDirectory.test(t),o=fs.emailNotification.test(t),l=fs.subscription.test(t),c=fs.internationalization.test(t),d=fs.accountRecovery.test(t),h=fs.smtpSettings.test(t),p=fs.selfRegistration.test(t),u=fs.sso.test(t),m=fs.rbac.test(t),g=fs.userPassphrasePolicies.test(t),E=fs.passwordExpirySettings.test(t),y=fs.healthcheck.test(t),b=fs.contentTypesEncryptedMetadata.test(t),f=fs.contentTypesMetadataKey.test(t),v=fs.migrateEncryptedMetadata.test(t),S=fs.allowContentTypes.test(t),T=fs.gettingStarted.test(t),w=fs.scim.test(t),x=fs.secretHistory.test(t),A=fs.ceDowngrade.test(t),C=fs.offline.test(t),R=fs.mfaPolicyTeasing.test(t),q=fs.passwordPoliciesTeasing.test(t),N=fs.usersDirectoryTeasing.test(t),k=fs.subscriptionTeasing.test(t),_=fs.accountRecoveryTeasing.test(t),O=fs.userPassphrasePoliciesTeasing.test(t),I=fs.ssoTeasing.test(t),P=fs.scimTeasing.test(t);let D;if(s?D=ys.HOME:i||R?D=ys.MFA_POLICY:r||q?D=ys.PASSWORD_POLICIES:n?D=ys.MFA:a||N?D=ys.USER_DIRECTORY:o?D=ys.EMAIL_NOTIFICATION:l||k?D=ys.SUBSCRIPTION:c?D=ys.INTERNATIONALIZATION:d||_?D=ys.ACCOUNT_RECOVERY:h?D=ys.SMTP_SETTINGS:p?D=ys.SELF_REGISTRATION:u||I?D=ys.SSO:m?D=ys.RBAC:g||O?D=ys.USER_PASSPHRASE_POLICIES:E?D=ys.PASSWORD_EXPIRY:y?D=ys.HEALTHCHECK:b?D=ys.CONTENT_TYPES_ENCRYPTED_METADATA:f?D=ys.CONTENT_TYPES_METADATA_KEY:v?D=ys.MIGRATE_METADATA:S?D=ys.ALLOW_CONTENT_TYPES:T?D=ys.METADATA_GETTING_STARTED:w||P?D=ys.SCIM:x?D=ys.SECRET_HISTORY:A?D=ys.CE_DOWNGRADE:C&&(D=ys.OFFLINE),!D)return e.selectedAdministration=ys.HTTP_404_NOT_FOUND,void this.setState(e);const U=bs?.[D];e.selectedAdministration=U&&!(this.props.context.siteSettings.canIUse(U)||vs.includes(D)&&this.props.context.siteSettings.isCommunityEdition)?ys.HTTP_404_NOT_FOUND:D,this.setState(e)}setDisplayAdministrationWorkspaceAction(e){this.setState({administrationWorkspaceAction:e})}resetDisplayAdministrationWorkspaceAction(){this.setState({administrationWorkspaceAction:()=>n.createElement(n.Fragment,null)})}render(){return n.createElement(us.Provider,{value:this.state},this.props.children)}}var gs;function Es(e){return class extends n.Component{render(){return n.createElement(us.Consumer,null,t=>n.createElement(e,{administrationWorkspaceContext:t,...this.props}))}}}ms.displayName="AdministrationWorkspaceContextProvider",ms.propTypes={context:c().object,children:c().any,location:c().object,match:c().object,history:c().object,loadingContext:c().object,rbacContext:c().object},(0,Tt.withRouter)(a(function(e){return class extends n.Component{render(){return n.createElement(hs.Consumer,null,t=>n.createElement(e,{rbacContext:t,...this.props}))}}}((gs=ms,class extends n.Component{render(){return n.createElement(Ct.Consumer,null,e=>n.createElement(gs,{loadingContext:e,...this.props}))}}))));const ys={NONE:"NONE",HOME:"HOME",MFA:"MFA",MFA_POLICY:"MFA-POLICY",PASSWORD_POLICIES:"PASSWORD-POLICIES",USER_DIRECTORY:"USER-DIRECTORY",EMAIL_NOTIFICATION:"EMAIL-NOTIFICATION",SUBSCRIPTION:"SUBSCRIPTION",INTERNATIONALIZATION:"INTERNATIONALIZATION",ACCOUNT_RECOVERY:"ACCOUNT-RECOVERY",SMTP_SETTINGS:"SMTP-SETTINGS",SELF_REGISTRATION:"SELF-REGISTRATION",SSO:"SSO",RBAC:"RBAC",USER_PASSPHRASE_POLICIES:"USER-PASSPHRASE-POLICIES",PASSWORD_EXPIRY:"PASSWORD-EXPIRY",HTTP_403_ACCESS_DENIED:"403-ACCESS-DENIED",HTTP_404_NOT_FOUND:"404-NOT-FOUND",HEALTHCHECK:"HEALTHCHECK",CONTENT_TYPES_ENCRYPTED_METADATA:"CONTENT_TYPES_ENCRYPTED_METADATA",CONTENT_TYPES_METADATA_KEY:"CONTENT_TYPES_METADATA_KEY",MIGRATE_METADATA:"MIGRATE_METADATA",ALLOW_CONTENT_TYPES:"ALLOW_CONTENT_TYPES",METADATA_GETTING_STARTED:"METADATA_GETTING_STARTED",SCIM:"SCIM",SECRET_HISTORY:"SECRET_HISTORY",CE_DOWNGRADE:"DOWNGRADE-TO-CE",OFFLINE:"OFFLINE"},bs={[ys.MFA]:"multiFactorAuthentication",[ys.MFA_POLICY]:"mfaPolicies",[ys.PASSWORD_POLICIES]:"passwordPoliciesUpdate",[ys.USER_DIRECTORY]:"directorySync",[ys.SUBSCRIPTION]:"ee",[ys.INTERNATIONALIZATION]:"locale",[ys.ACCOUNT_RECOVERY]:"accountRecovery",[ys.SMTP_SETTINGS]:"smtpSettings",[ys.SELF_REGISTRATION]:"selfRegistration",[ys.SSO]:"sso",[ys.RBAC]:"rbacs",[ys.USER_PASSPHRASE_POLICIES]:"userPassphrasePolicies",[ys.PASSWORD_EXPIRY]:"passwordExpiry",[ys.HEALTHCHECK]:"healthcheckUi",[ys.CONTENT_TYPES_ENCRYPTED_METADATA]:"metadata",[ys.CONTENT_TYPES_METADATA_KEY]:"metadata",[ys.MIGRATE_METADATA]:"metadata",[ys.ALLOW_CONTENT_TYPES]:"metadata",[ys.METADATA_GETTING_STARTED]:"metadata",[ys.SCIM]:"scim",[ys.SECRET_HISTORY]:"secretRevisions",[ys.CE_DOWNGRADE]:"ee",[ys.OFFLINE]:"offlineMode"},fs={homePage:/^\/app\/administration\/?$/,mfa:/^\/app\/administration\/mfa\/?$/,mfaPolicy:/^\/app\/administration\/mfa-policy\/?$/,mfaPolicyTeasing:/^\/app\/administration\/mfa-policy-teasing\/?$/,passwordPolicies:/^\/app\/administration\/password-policies\/?$/,passwordPoliciesTeasing:/^\/app\/administration\/password-policies-teasing\/?$/,usersDirectory:/^\/app\/administration\/users-directory\/?$/,usersDirectoryTeasing:/^\/app\/administration\/users-directory-teasing\/?$/,emailNotification:/^\/app\/administration\/email-notification\/?$/,subscription:/^\/app\/administration\/subscription\/?$/,subscriptionTeasing:/^\/app\/administration\/subscription-teasing\/?$/,internationalization:/^\/app\/administration\/internationalization\/?$/,accountRecovery:/^\/app\/administration\/account-recovery\/?$/,accountRecoveryTeasing:/^\/app\/administration\/account-recovery-teasing\/?$/,smtpSettings:/^\/app\/administration\/smtp-settings\/?$/,selfRegistration:/^\/app\/administration\/self-registration\/?$/,sso:/^\/app\/administration\/sso\/?$/,ssoTeasing:/^\/app\/administration\/sso-teasing\/?$/,rbac:/^\/app\/administration\/rbacs\/?$/,userPassphrasePolicies:/^\/app\/administration\/user-passphrase-policies\/?$/,userPassphrasePoliciesTeasing:/^\/app\/administration\/user-passphrase-policies-teasing\/?$/,passwordExpirySettings:/^\/app\/administration\/password-expiry\/?$/,healthcheck:/^\/app\/administration\/healthcheck\/?$/,contentTypesEncryptedMetadata:/^\/app\/administration\/content-types\/metadata\/?$/,contentTypesMetadataKey:/^\/app\/administration\/content-types\/metadata-key\/?$/,migrateEncryptedMetadata:/^\/app\/administration\/migrate-metadata\/?$/,allowContentTypes:/^\/app\/administration\/allow-content-types\/?$/,gettingStarted:/^\/app\/administration\/content-types\/metadata-getting-started\/?$/,scim:/^\/app\/administration\/user-provisionning\/scim\/?$/,scimTeasing:/^\/app\/administration\/scim-teasing\/?$/,secretHistory:/^\/app\/administration\/secret-history\/?$/,ceDowngrade:/^\/app\/administration\/ce-downgrade\/?$/,offline:/^\/app\/administration\/offline\/?$/},vs=[ys.SUBSCRIPTION,ys.PASSWORD_POLICIES,ys.USER_PASSPHRASE_POLICIES,ys.ACCOUNT_RECOVERY,ys.SSO,ys.MFA_POLICY,ys.USER_DIRECTORY,ys.SCIM],Ss=class{constructor(e){this.customerId=e?.customer_id||"",this.subscriptionId=e?"subscription_id"in e?e.subscription_id:"N/A":"",this.users=e?.users||null,this.email=e?"email"in e?e.email:"N/A":"",this.expiry=e?.expiry||null,this.created=e?.created||null,this.data=e?.data||null}},Ts=n.createContext({getSubscription:()=>{},findSubscriptionKey:()=>{},isProcessing:()=>{},setProcessing:()=>{},getActiveUsers:()=>{},clearContext:()=>{}});class ws extends n.Component{constructor(e){super(e),this.state=this.defaultState}get defaultState(){return{subscription:new Ss,processing:!1,getSubscription:this.getSubscription.bind(this),findSubscriptionKey:this.findSubscriptionKey.bind(this),isProcessing:this.isProcessing.bind(this),setProcessing:this.setProcessing.bind(this),getActiveUsers:this.getActiveUsers.bind(this),clearContext:this.clearContext.bind(this)}}async findSubscriptionKey(){this.setProcessing(!0);let e=new Ss;try{const t=await this.props.context.onGetSubscriptionKeyRequested();e=new Ss(t.toDto())}catch(t){"PassboltSubscriptionError"===t.name&&(e=new Ss(t.subscription))}finally{this.setState({subscription:e}),this.setProcessing(!1)}}async getActiveUsers(){return(await this.props.context.port.request("passbolt.users.get-all")).filter(e=>e.active).length}getSubscription(){return this.state.subscription}isProcessing(){return this.state.processing}setProcessing(e){this.setState({processing:e})}clearContext(){const{subscription:e,processing:t}=this.defaultState;this.setState({subscription:e,processing:t})}render(){return n.createElement(Ts.Provider,{value:this.state},this.props.children)}}function xs(e){return class extends n.Component{render(){return n.createElement(Ts.Consumer,null,t=>n.createElement(e,{adminSubscriptionContext:t,...this.props}))}}}var As;function Cs(){return Cs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)({}).hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},Cs.apply(null,arguments)}ws.propTypes={context:c().any,children:c().any},a(ws);const Rs=function(e){return n.createElement("svg",Cs({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16"},e),As||(As=n.createElement("path",{stroke:"var(--icon-color)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m12 4-8 8M4 4l8 8"})))};class qs extends n.Component{constructor(e){super(e),this.bindCallbacks()}bindCallbacks(){this.handleCloseClick=this.handleCloseClick.bind(this)}handleCloseClick(){this.props.onClose()}render(){return n.createElement("button",{type:"button",disabled:this.props.disabled,className:"dialog-close button button-transparent",onClick:this.handleCloseClick},n.createElement(Rs,{className:"svg-icon close"}),n.createElement("span",{className:"visually-hidden"},n.createElement(I.x,null,"Close")))}}qs.propTypes={onClose:c().func,disabled:c().bool};const Ns=(0,P.C)("common")(qs);var ks;function _s(){return _s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)({}).hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},_s.apply(null,arguments)}const Os=function(e){return n.createElement("svg",_s({xmlns:"http://www.w3.org/2000/svg",width:17,height:18,fill:"none",viewBox:"0 0 17 18"},e),ks||(ks=n.createElement("path",{stroke:"var(--icon-color)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M8.5 16.5a7.5 7.5 0 1 0 0-15 7.5 7.5 0 0 0 0 15M8.5 12V9M8.5 6h.008"})))};class Is extends n.Component{constructor(e){super(e),this.bindCallbacks()}bindCallbacks(){this.handleKeyDown=this.handleKeyDown.bind(this),this.handleClose=this.handleClose.bind(this)}handleKeyDown(e){27===e.keyCode&&this.handleClose()}handleClose(){this.props.disabled||this.props.onClose()}componentDidMount(){document.addEventListener("keydown",this.handleKeyDown,{capture:!1})}componentWillUnmount(){document.removeEventListener("keydown",this.handleKeyDown,{capture:!1})}render(){return n.createElement("div",{className:`${this.props.className} dialog-wrapper`},n.createElement("div",{className:"dialog"},n.createElement("div",{className:"dialog-header"},n.createElement("div",{className:"dialog-title-wrapper"},n.createElement("h2",null,n.createElement("span",{className:"dialog-header-title"},this.props.title),this.props.subtitle&&n.createElement("span",{className:"dialog-header-subtitle"},this.props.subtitle)),this.props.tooltip&&""!==this.props.tooltip&&n.createElement(Et,{message:this.props.tooltip},n.createElement(Os,null))),n.createElement(Ns,{onClose:this.handleClose,disabled:this.props.disabled})),n.createElement("div",{className:"dialog-content"},this.props.children)))}}Is.propTypes={children:c().node,className:c().string,title:c().oneOfType([c().arrayOf(c().node),c().node,c().string]),subtitle:c().string,tooltip:c().node,disabled:c().bool,onClose:c().func};const Ps=Is,Ds=n.createContext({feedbacks:[],displaySuccess:()=>{},displayWarning:()=>{},displayError:()=>{},remove:()=>{}});class Us extends n.Component{constructor(e){super(e),this.state=this.defaultState}get defaultState(){return{feedbacks:[],displaySuccess:this.displaySuccess.bind(this),displayWarning:this.displayWarning.bind(this),displayError:this.displayError.bind(this),remove:this.remove.bind(this)}}displaySuccess(e){this.setState({feedbacks:[...this.state.feedbacks,{id:(0,bt.A)(),type:"success",message:e}]})}displayWarning(e){this.setState({feedbacks:[...this.state.feedbacks,{id:(0,bt.A)(),type:"warning",message:e}]})}displayError(e){this.setState({feedbacks:[...this.state.feedbacks,{id:(0,bt.A)(),type:"error",message:e}]})}remove(e){this.setState(t=>({feedbacks:t.feedbacks.filter(t=>e.id!==t.id)}))}render(){return n.createElement(Ds.Provider,{value:this.state},this.props.children)}}Us.displayName="ActionFeedbackContextProvider",Us.propTypes={children:c().any};class Gs extends n.Component{constructor(e){super(e),this.state=this.defaultState,this.bindCallbacks()}get defaultState(){return{showErrorDetails:!1}}bindCallbacks(){this.handleKeyDown=this.handleKeyDown.bind(this),this.handleErrorDetailsToggle=this.handleErrorDetailsToggle.bind(this)}componentDidMount(){document.addEventListener("keydown",this.handleKeyDown,{capture:!0})}componentWillUnmount(){document.removeEventListener("keydown",this.handleKeyDown,{capture:!0})}getTitle(){return this.props.title?this.props.title:this.props.t("There was an unexpected error...")}getMessage(){return this.props.error.message}handleKeyDown(e){27!==e.keyCode&&13!==e.keyCode||(e.stopPropagation(),this.props.onClose())}handleErrorDetailsToggle(){this.setState({showErrorDetails:!this.state.showErrorDetails})}get hasErrorDetails(){return Boolean(this.props.error.data?.body)||Boolean(this.props.error.details)}formatErrors(){const e=this.props.error?.details||this.props.error?.data;return JSON.stringify(e,null,4)}render(){return n.createElement(Ps,{className:"dialog-wrapper error-dialog",onClose:this.props.onClose,title:this.getTitle()},n.createElement("div",{className:"form-content"},n.createElement("p",null,this.getMessage()),this.hasErrorDetails&&n.createElement("div",{className:"accordion error-details"},n.createElement("div",{className:"accordion-header"},n.createElement("button",{type:"button",className:"link no-border",onClick:this.handleErrorDetailsToggle},n.createElement("span",null,n.createElement(I.x,null,"Error details")),this.state.showErrorDetails?n.createElement(te,{className:"baseline svg-icon"}):n.createElement(ie,{className:"baseline svg-icon"}))),this.state.showErrorDetails&&n.createElement("div",{className:"accordion-content"},n.createElement("div",{className:"input text"},n.createElement("label",{htmlFor:"js_field_debug",className:"visuallyhidden"},n.createElement(I.x,null,"Error details")),n.createElement("textarea",{id:"js_field_debug",defaultValue:this.formatErrors(),readOnly:!0}))))),n.createElement("div",{className:"submit-wrapper clearfix"},n.createElement("button",{type:"button",className:"button primary warning",onClick:this.props.onClose},"Ok")))}}Gs.propTypes={title:c().string,error:c().object.isRequired,onClose:c().func,t:c().func};const Ls=(0,P.C)("common")(Gs);class Ms extends n.Component{constructor(e){super(e),this.bindCallbacks()}bindCallbacks(){this.getClassName=this.getClassName.bind(this)}getClassName(){let e="button primary form";return this.props.warning?e+=" warning":this.props.attention&&(e+=" attention"),this.props.disabled&&(e+=" disabled"),this.props.processing&&(e+=" processing"),this.props.big&&(e+=" big"),this.props.medium&&(e+=" medium"),this.props.fullWidth&&(e+=" full-width"),e}render(){return n.createElement("button",{type:"submit",className:this.getClassName(),disabled:this.props.disabled},this.props.value||n.createElement(I.x,null,"Save"),this.props.processing&&n.createElement(U,null))}}Ms.defaultProps={warning:!1,attention:!1},Ms.propTypes={processing:c().bool,disabled:c().bool,value:c().oneOfType([c().arrayOf(c().node),c().node,c().string]),warning:c().bool,attention:c().bool,big:c().bool,medium:c().bool,fullWidth:c().bool};const Fs=(0,P.C)("common")(Ms);class $s extends n.Component{constructor(e){super(e),this.bindCallbacks()}bindCallbacks(){this.handleClick=this.handleClick.bind(this)}handleClick(){this.props.disabled||this.props.onClick()}render(){return n.createElement("button",{type:"button",disabled:this.props.disabled,className:"link cancel",onClick:this.handleClick},this.props.value)}}$s.defaultProps={value:n.createElement(I.x,null,"Cancel")},$s.propTypes={disabled:c().bool,onClick:c().func,value:c().oneOfType([c().arrayOf(c().node),c().node,c().string])};const Vs=(0,P.C)("common")($s),Ks=class extends ls{static getSchema(){return{type:"object",required:["subscription_id","users","expiry","created","data"],properties:{customer_id:{type:"string"},subscription_id:{type:"string"},users:{type:"integer"},email:{type:"string",format:"email"},created:{type:"string",format:"date-time"},expiry:{type:"string",format:"date-time"},data:{type:"string"}}}}get expiry(){return this._props.expiry}toDto(){return Object.assign({},this._props)}toJSON(){return this.toDto()}static get ENTITY_NAME(){return"Subscription"}},Bs=class{constructor(e){this.port=e}async createOrganizationSubscriptionKey(e){(0,es.A)(e);const t=await this.port.request("passbolt.subscription.create",{data:e});return new Ks(t)}async findOrganizationSubscriptionKey(){const e=await this.port.request("passbolt.subscription.get");return new Ks(e)}async updateOrganizationSubscriptionKey(e){(0,es.A)(e);const t=await this.port.request("passbolt.subscription.update",{data:e});return new Ks(t)}async deleteOrganizationSubscriptionKey(){await this.port.request("passbolt.subscription.downgrade")}};class js extends n.Component{constructor(e){super(e),this.state=this.getDefaultState(),this.initEventHandlers(),this.createInputRef(),this.subscriptionKeyService=new Bs(e.context.port)}getDefaultState(){return{selectedFile:null,key:"",keyError:"",processing:!1,hasBeenValidated:!1}}initEventHandlers(){this.handleCloseClick=this.handleCloseClick.bind(this),this.handleFormSubmit=this.handleFormSubmit.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleKeyInputKeyUp=this.handleKeyInputKeyUp.bind(this),this.handleSelectSubscriptionKeyFile=this.handleSelectSubscriptionKeyFile.bind(this),this.handleSelectFile=this.handleSelectFile.bind(this)}createInputRef(){this.keyInputRef=n.createRef(),this.fileUploaderRef=n.createRef()}componentDidMount(){this.setState({key:this.props.context.editSubscriptionKey?.key||""})}async handleFormSubmit(e){e.preventDefault(),this.state.processing||await this.save()}handleInputChange(e){const t=e.target,s=t.value,n=t.name;this.setState({[n]:s})}handleKeyInputKeyUp(){if(this.state.hasAlreadyBeenValidated){const e=this.validateNameInput();this.setState(e)}}handleCloseClick(){this.props.context.setContext({editSubscriptionKey:null}),this.props.onClose()}handleSelectFile(){this.fileUploaderRef.current.click()}get selectedFilename(){return this.state.selectedFile?this.state.selectedFile.name:""}async handleSelectSubscriptionKeyFile(e){const[t]=e.target.files,s=await this.readSubscriptionKeyFile(t);this.setState({key:s,selectedFile:t}),this.state.hasBeenValidated&&await this.validate()}readSubscriptionKeyFile(e){const t=new FileReader;return new Promise((s,n)=>{t.onloadend=()=>{try{s(t.result)}catch(e){n(e)}},t.readAsText(e)})}async save(){if(!this.state.processing){if(this.setState({hasBeenValidated:!0,processing:!0}),!await this.validate())return this.handleValidateError(),void this.setState({processing:!1});try{this.props.onSave?await this.props.onSave(this.state.key):await this.subscriptionKeyService.updateOrganizationSubscriptionKey(this.state.key),await this.handleSaveSuccess(),await this.props.adminSubscriptionContext.findSubscriptionKey()}catch(e){this.setState({processing:!1}),this.handleSaveError(e),this.focusFieldError()}}}handleValidateError(){this.focusFieldError()}async handleSaveSuccess(){await this.props.actionFeedbackContext.displaySuccess(this.translate("The subscription key has been updated successfully.")),this.props.administrationWorkspaceContext.onMustRefreshSubscriptionKey(),this.props.context.setContext({editSubscriptionKey:null,refreshSubscriptionAnnouncement:!0}),this.props.onClose()}handleSaveError(e){if("PassboltSubscriptionError"===e.name)this.setState({keyError:e.message});else if("EntityValidationError"===e.name)this.setState({keyError:this.translate("The subscription key is invalid.")});else if("PassboltApiFetchError"===e.name&&e.data&&400===e.data.code)this.setState({keyError:e.message});else{console.error(e);const t={error:e};this.props.dialogContext.open(Ls,t)}}focusFieldError(){this.state.keyError&&this.keyInputRef.current.focus()}validateKeyInput(){const e=this.state.key.trim();let t="";return e.length||(t=this.translate("A subscription key is required.")),new Promise(e=>{this.setState({keyError:t},e)})}async validate(){return this.setState({keyError:""}),await this.validateKeyInput(),""===this.state.keyError}hasAllInputDisabled(){return this.state.processing}get translate(){return this.props.t}render(){return n.createElement(Ps,{title:this.props.title??this.translate("Edit subscription key"),onClose:this.handleCloseClick,disabled:this.state.processing,className:"edit-subscription-dialog"},n.createElement("form",{onSubmit:this.handleFormSubmit,noValidate:!0},n.createElement("div",{className:"form-content"},n.createElement("div",{className:`input textarea required ${this.state.keyError?"error":""} ${this.hasAllInputDisabled()?"disabled":""}`},n.createElement("label",{htmlFor:"edit-tag-form-name"},n.createElement(I.x,null,"Subscription key")),n.createElement("textarea",{id:"edit-subscription-form-key",name:"key",value:this.state.key,onKeyUp:this.handleKeyInputKeyUp,onChange:this.handleInputChange,disabled:this.hasAllInputDisabled(),ref:this.keyInputRef,className:"required full_report",required:"required",autoComplete:"off",autoFocus:!0})),n.createElement("div",{className:"input file "+(this.hasAllInputDisabled()?"disabled":"")},n.createElement("input",{type:"file",ref:this.fileUploaderRef,disabled:this.hasAllInputDisabled(),onChange:this.handleSelectSubscriptionKeyFile}),n.createElement("div",{className:"input-file-inline"},n.createElement("input",{type:"text",disabled:!0,placeholder:this.translate("No key file selected"),value:this.selectedFilename}),n.createElement("button",{type:"button",className:"button primary",onClick:this.handleSelectFile,disabled:this.hasAllInputDisabled()},n.createElement("span",null,n.createElement(I.x,null,"Choose a file")))),this.state.keyError&&n.createElement("div",{className:"key error-message"},this.state.keyError),this.props.warning&&n.createElement("p",null,this.props.warning))),n.createElement("div",{className:"submit-wrapper clearfix"},n.createElement(Vs,{disabled:this.hasAllInputDisabled(),onClick:this.handleCloseClick}),n.createElement(Fs,{disabled:this.hasAllInputDisabled(),processing:this.state.processing,value:this.translate("Save")}))))}}js.propTypes={context:c().any,onClose:c().func,actionFeedbackContext:c().any,adminSubscriptionContext:c().object,dialogContext:c().any,administrationWorkspaceContext:c().any,title:c().string,warning:c().string,onSave:c().func,t:c().func};const zs=a(xs(Es(function(e){return class extends n.Component{render(){return n.createElement(Ds.Consumer,null,t=>n.createElement(e,{actionFeedbackContext:t,...this.props}))}}}(St((0,P.C)("common")(js))))));class Hs{constructor(e){this.context=e.context,this.dialogContext=e.dialogContext,this.subscriptionContext=e.adminSubscriptionContext}static getInstance(e){return this.instance||(this.instance=new Hs(e)),this.instance}static killInstance(){this.instance=null}editSubscription(){const e={key:this.subscriptionContext.getSubscription().data};this.context.setContext({editSubscriptionKey:e}),this.dialogContext.open(zs)}}const Ws=Hs;var Ys=s(40961);var Zs,Xs;function Js(){return Js=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)({}).hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},Js.apply(null,arguments)}const Qs=function(e){return n.createElement("svg",Js({xmlns:"http://www.w3.org/2000/svg",width:18,height:18,fill:"none",viewBox:"0 0 18 18"},e),Zs||(Zs=n.createElement("path",{stroke:"var(--icon-color)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M15 3H3a1.5 1.5 0 0 0-1.5 1.5v9A1.5 1.5 0 0 0 3 15h12a1.5 1.5 0 0 0 1.5-1.5v-9A1.5 1.5 0 0 0 15 3"})),Xs||(Xs=n.createElement("path",{stroke:"var(--icon-color)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M16.5 5.25 9.773 9.525a1.46 1.46 0 0 1-1.546 0L1.5 5.25"})))};var en;function tn(){return tn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)({}).hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},tn.apply(null,arguments)}const sn=function(e){return n.createElement("svg",tn({xmlns:"http://www.w3.org/2000/svg",width:18,height:18,fill:"none",viewBox:"0 0 18 18"},e),en||(en=n.createElement("path",{stroke:"var(--icon-color)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m16.298 13.5-6-10.5a1.5 1.5 0 0 0-2.61 0l-6 10.5A1.5 1.5 0 0 0 3 15.75h12a1.5 1.5 0 0 0 1.297-2.25M9 6.75v3M9 12.75h.008"})))},nn="Pro Edition",rn="Community Edition";class an extends n.Component{constructor(e){super(e),this.state=this.defaultState,this.bindCallbacks(),this.subscriptionActionService=Ws.getInstance(this.props),this.subscriptionKeyService=new Bs(this.props.context.port)}get defaultState(){return{activeUsers:null}}async componentDidMount(){this.props.context.siteSettings.isCommunityEdition&&this.hasEditionPlugin()||this.props.adminSubscriptionContext.findSubscriptionKey();const e=await this.props.adminSubscriptionContext.getActiveUsers();this.setState({activeUsers:e})}componentWillUnmount(){this.props.adminSubscriptionContext.clearContext(),Ws.killInstance()}bindCallbacks(){this.handleRenewKey=this.handleRenewKey.bind(this),this.handleUpdateKey=this.handleUpdateKey.bind(this),this.handleDowngradeClick=this.handleDowngradeClick.bind(this),this.handleAddSubscriptionKey=this.handleAddSubscriptionKey.bind(this),this.handleSaveSubscriptionKey=this.handleSaveSubscriptionKey.bind(this)}handleSaveSubscriptionKey(e){return this.subscriptionKeyService.createOrganizationSubscriptionKey(e)}handleAddSubscriptionKey(){this.props.dialogContext.open(zs,{title:this.props.t("New subscription key"),onSave:this.handleSaveSubscriptionKey,warning:this.translate("You and your team will be disconnected at the end of the process.")})}handleDowngradeClick(){this.props.navigationContext.onGoToAdministrationDowngradeToCeRequested()}handleRenewKey(){const e=this.props.adminSubscriptionContext.getSubscription();this.hasLimitUsersExceeded()?this.props.navigationContext.onGoToSubscriptionUpdateQuantityRequested(e.subscriptionId,e.customerId):(this.hasSubscriptionKeyExpired()||this.hasSubscriptionKeyGoingToExpire())&&this.props.navigationContext.onGoToSubscriptionRenewRequested(e.subscriptionId,e.customerId)}handleUpdateKey(){this.subscriptionActionService.editSubscription()}hasEditionPlugin(){return this.props.context.siteSettings.canIUse("edition")}hasSubscriptionKeyExpired(){return yt.c9.fromISO(this.props.adminSubscriptionContext.getSubscription().expiry)<yt.c9.now()}hasSubscriptionKeyGoingToExpire(){return!this.hasSubscriptionKeyExpired()&&yt.c9.fromISO(this.props.adminSubscriptionContext.getSubscription().expiry)<yt.c9.now().plus({days:30})}shouldShowDowngradeSection(){return this.hasEditionPlugin()&&!this.props.context.siteSettings.isCommunityEdition&&(this.hasSubscriptionKeyExpired()||this.hasSubscriptionKeyGoingToExpire())}hasLimitUsersExceeded(){return this.props.adminSubscriptionContext.getSubscription().users<this.state.activeUsers}hasValidSubscription(){return!this.props.context.siteSettings.isCommunityEdition&&!this.hasLimitUsersExceeded()&&!this.hasSubscriptionKeyExpired()}hasInvalidSubscription(){return!this.props.context.siteSettings.isCommunityEdition&&!this.props.adminSubscriptionContext.getSubscription().data}formatDate(e){try{return yt.c9.fromISO(e).setLocale(this.props.context.locale).toLocaleString(yt.c9.DATE_SHORT)}catch(t){return console.error(`Failed to format date "${e}":`,t),""}}get translate(){return this.props.t}render(){const e=this.props.adminSubscriptionContext.getSubscription(),t=this.props.adminSubscriptionContext.isProcessing();return n.createElement("div",{className:"row"},!t&&n.createElement("div",{className:"subscription-key main-column"},n.createElement("div",{className:"main-content"},n.createElement("h1",null,n.createElement(I.x,null,"Subscription")),n.createElement("h3",null,n.createElement(I.x,null,"Details")),n.createElement("div",{className:"subscription-information"},n.createElement("div",{className:"information container"},n.createElement("div",{className:"information"},n.createElement("div",{className:"information-label"},n.createElement("span",{className:"edition label"},n.createElement(I.x,null,"Edition:")),n.createElement("span",{className:"server-version label"},n.createElement(I.x,null,"Server version:")),n.createElement("span",{className:"client-version label"},n.createElement(I.x,null,"Client version:")),!this.props.context.siteSettings.isCommunityEdition&&n.createElement(n.Fragment,null,n.createElement("span",{className:"email label"},n.createElement(I.x,null,"Email:")),n.createElement("span",{className:"users label"},n.createElement(I.x,null,"Users limit:")))),n.createElement("div",{className:"information-value"},n.createElement("span",{className:"edition value"},!this.props.context.siteSettings.isCommunityEdition&&nn,this.props.context.siteSettings.isCommunityEdition&&n.createElement(n.Fragment,null,rn,n.createElement("span",{className:"subtitle"},n.createElement(I.x,null,"(Free forever)")))),n.createElement("span",{className:"server-version value"},this.props.context.siteSettings.version),n.createElement("span",{className:"client-version value"},this.props.context.extensionVersion),!this.props.context.siteSettings.isCommunityEdition&&n.createElement(n.Fragment,null,n.createElement("span",{className:"email value"},e.email),n.createElement("span",{className:"users value "+(this.hasLimitUsersExceeded()?"error":"")},e.users," ",n.createElement("span",{className:"secondary-information"},"(",n.createElement(I.x,null,"currently:")," ",this.state.activeUsers,")"))))),n.createElement("div",{className:"information"},n.createElement("div",{className:"information-label"},!this.props.context.siteSettings.isCommunityEdition&&n.createElement(n.Fragment,null,n.createElement("span",{className:"customer-id label"},n.createElement(I.x,null,"Customer id:")),n.createElement("span",{className:"subscription-id label"},n.createElement(I.x,null,"Subscription id:")),n.createElement("span",{className:"created label"},n.createElement(I.x,null,"Valid from:")),n.createElement("span",{className:"expiry label"},n.createElement(I.x,null,"Expires on:")))),n.createElement("div",{className:"information-value"},!this.props.context.siteSettings.isCommunityEdition&&n.createElement(n.Fragment,null,n.createElement("span",{className:"customer-id value"},e.customerId),n.createElement("span",{className:"subscription-id value"},e.subscriptionId),n.createElement("span",{className:"created value"},this.formatDate(e.created)),n.createElement("span",{className:`expiry value ${this.hasSubscriptionKeyExpired()?"error":""} ${this.hasSubscriptionKeyGoingToExpire()?"warning":""}`},this.formatDate(e.expiry)," ",n.createElement("span",{className:"secondary-information",title:e.expiry},"(",`${this.hasSubscriptionKeyExpired()?this.translate("expired "):""}${((e,t,s)=>{if(null===e)return"n/a";if("Infinity"===e)return t("Never");const n=yt.c9.fromISO(e),i=n.diffNow().toMillis();return i>-1e3&&i<0?t("Just now"):n.toRelative({locale:s})})(e.expiry,this.props.t,this.props.context.locale)}`,")"))))))),!this.props.context.siteSettings.isCommunityEdition&&n.createElement(n.Fragment,null,!this.props.context.siteSettings.isCommunityEdition&&n.createElement("div",{className:"subscription-actions"},this.hasSubscriptionKeyExpired()&&n.createElement("div",{className:"subscription-warning"},n.createElement(sn,null),n.createElement(I.x,null,"Your subscription key is expired.")),this.hasLimitUsersExceeded()&&n.createElement("div",{className:"subscription-warning"},n.createElement(sn,null),n.createElement(I.x,null,"Your users limit has been reached.")),this.hasInvalidSubscription()&&n.createElement("div",{className:"subscription-warning"},n.createElement(sn,null),n.createElement(I.x,null,"Your subscription key is either missing or not valid.")))),n.createElement("div",{className:"subscription-actions"},!this.props.context.siteSettings.isCommunityEdition&&n.createElement(n.Fragment,null,(this.shouldShowDowngradeSection()||this.hasLimitUsersExceeded())&&n.createElement("button",{className:"button",type:"button",onClick:this.handleRenewKey},n.createElement(I.x,null,"Renew subscription key")),n.createElement("button",{className:"button primary form",type:"button",onClick:this.handleUpdateKey},n.createElement(I.x,null,"Update subscription key"))),this.props.context.siteSettings.isCommunityEdition&&this.hasEditionPlugin()&&n.createElement(n.Fragment,null,n.createElement("button",{className:"button primary form",type:"button",onClick:this.handleAddSubscriptionKey},n.createElement(I.x,null,"Upload subscription key")))),n.createElement("h3",{className:"title"},n.createElement(I.x,null,"Plans")),n.createElement("div",{className:"subscription-editions"},n.createElement("div",{className:"edition "+(this.props.context.siteSettings.isCommunityEdition?"current-edition":"")},n.createElement("div",{className:"content"},n.createElement("div",{className:"title"},n.createElement("div",{className:"community-title"},n.createElement("h3",null,rn),n.createElement("span",{className:"subtitle"},n.createElement(I.x,null,"(Free forever)"))),this.props.context.siteSettings.isCommunityEdition&&n.createElement("div",{className:"current-edition-indicator-wrapper"},n.createElement("div",{className:"current-edition-indicator"},n.createElement(I.x,null,"Current plan")))),n.createElement("div",{className:"features"},n.createElement("span",{className:"subtitle"},n.createElement(I.x,null,"Features included:")),n.createElement("ul",null,n.createElement("li",null,n.createElement(I.x,null,"Open source under AGPLV3 license")),n.createElement("li",null,n.createElement(I.x,null,"Passwords management & sharing")),n.createElement("li",null,n.createElement(I.x,null,"Private and shared folders")),n.createElement("li",null,n.createElement(I.x,null,"Users and groups management")),n.createElement("li",null,n.createElement(I.x,null,"Secret key authentication (2FA)")),n.createElement("li",null,n.createElement(I.x,null,"Additional factor authentication (3-step verification)")),n.createElement("li",null,n.createElement(I.x,null,"Open API")),n.createElement("li",null,n.createElement(I.x,null,"Role Based Access Control")),n.createElement("li",null,n.createElement(I.x,null,"Password expiry")),n.createElement("li",null,n.createElement(I.x,null,"Secret history")),n.createElement("li",null,n.createElement(I.x,null,"Community support"))))),this.shouldShowDowngradeSection()&&n.createElement("div",{className:"subscription-actions"},n.createElement("button",{className:"button",type:"button",onClick:this.handleDowngradeClick},n.createElement(I.x,null,"Downgrade to ",{edition:"Community"})))),n.createElement("div",{className:"edition "+(this.props.context.siteSettings.isCommunityEdition?"":"current-edition")},n.createElement("div",{className:"content"},n.createElement("div",{className:"title"},n.createElement("h3",null,nn),!this.props.context.siteSettings.isCommunityEdition&&n.createElement("div",{className:"current-edition-indicator-wrapper"},n.createElement("div",{className:"current-edition-indicator"},n.createElement(I.x,null,"Current plan")))),n.createElement("div",{className:"features"},n.createElement("span",{className:"subtitle"},n.createElement(I.x,null,"Features include everything in Community, plus:")),n.createElement("ul",null,n.createElement("li",null,n.createElement(I.x,null,"Account recovery (Escrow)")),n.createElement("li",null,n.createElement(I.x,null,"Users provisioning (AD / OpenLDAP / SCIM)")),n.createElement("li",null,n.createElement(I.x,null,"Single Sign On (SSO) with Microsoft, Google and more")),n.createElement("li",null,n.createElement(I.x,null,"Activity log (audit changes)")),n.createElement("li",null,n.createElement(I.x,null,"Additional policies")),n.createElement("li",null,n.createElement(I.x,null,"Tags management")),n.createElement("li",null,n.createElement(I.x,null,"VM appliance")),n.createElement("li",null,n.createElement(I.x,null,"Next business day support"))),n.createElement("div",null,n.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:"https://www.passbolt.com/pricing/pro?utm_campaign=21060976-CE%20to%20Pro&utm_source=product"},n.createElement(I.x,null,"See pricing page"))))),this.props.context.siteSettings.isCommunityEdition&&n.createElement("div",{className:"subscription-actions"},n.createElement("a",{className:"button primary",target:"_blank",rel:"noopener noreferrer",href:"https://www.passbolt.com/pricing/pro?utm_campaign=21060976-CE%20to%20Pro&utm_source=product"},n.createElement(I.x,null,"Buy now")),n.createElement("a",{className:"button",target:"_blank",rel:"noopener noreferrer",href:"https://www.passbolt.com/contact/pro/free-trial?utm_campaign=21060976-CE%20to%20Pro&utm_source=product"},n.createElement(I.x,null,"Start a free trial"))))))),(s=n.createElement("div",{className:"sidebar-help-section"},n.createElement("h3",null,n.createElement(I.x,null,"Need help?")),n.createElement("p",null,n.createElement(I.x,null,"For any change or question related to your passbolt subscription, kindly contact our sales team.")),n.createElement("a",{className:"button",target:"_blank",rel:"noopener noreferrer",href:"https://www.passbolt.com/contact"},n.createElement(Qs,null),n.createElement("span",null,n.createElement(I.x,null,"Contact Sales")))),i=document.getElementById("administration-help-panel"),n.createElement(n.Fragment,null,i&&(0,Ys.createPortal)(s,i,void 0))));var s,i}}a(function(e){return class extends n.Component{render(){return n.createElement(xt.Consumer,null,t=>n.createElement(e,{navigationContext:t,...this.props}))}}}(xs(Es(St((0,P.C)("common")(an))))));class on extends n.Component{get privacyUrl(){return this.props.context.siteSettings.privacyLink}get creditsUrl(){return"https://www.passbolt.com/terms"}get unsafeUrl(){return"https://www.passbolt.com/docs/hosting/faq/why-I-see-unsafe-mode-banner/"}get termsUrl(){return this.props.context.siteSettings.termsLink}get versions(){const e=this.props.context.extensionVersion,t=this.props.context.siteSettings.version;return n.createElement("div",null,e&&n.createElement("div",null,this.props.t("Client")," ",e),t&&n.createElement(n.Fragment,null,e&&n.createElement("hr",null),n.createElement("div",null,this.props.t("Server")," ",t)))}get isUnsafeMode(){if(!this.props.context.siteSettings)return!1;const e=this.props.context.siteSettings.debug,t=this.props.context.siteSettings.url.startsWith("http://");return e||t}get isCloud(){const e=new URL(this.props.context.siteSettings.url);return"https:"===e.protocol&&Boolean(e.hostname.match(/cloud.passbolt.com$/))}render(){return n.createElement("footer",{className:"footer"},n.createElement("ul",{className:"footer-links"},this.isUnsafeMode&&n.createElement("li",{className:"error-message"},n.createElement("a",{href:this.unsafeUrl,target:"_blank",rel:"noopener noreferrer"},n.createElement(I.x,null,"Unsafe mode"))),!this.isCloud&&n.createElement(n.Fragment,null,this.props.context.siteSettings.isCommunityEdition&&n.createElement("li",null,rn,n.createElement("span",{className:"edition-suffix"},n.createElement(I.x,null," (free)"))),!this.props.context.siteSettings.isCommunityEdition&&n.createElement("li",null,nn)),this.isCloud&&n.createElement("li",null,"Cloud"),n.createElement("li",null,this.versions&&n.createElement(Et,{message:this.versions,direction:"top-left"},n.createElement("a",{className:"button button-transparent inline",href:this.creditsUrl,target:"_blank",rel:"noopener noreferrer"},n.createElement(mt,null))),!this.versions&&n.createElement("a",{className:"button button-transparent inline",href:this.creditsUrl,target:"_blank",rel:"noopener noreferrer"},n.createElement(mt,null)))))}}on.propTypes={context:c().any,t:c().func};const ln=a((0,P.C)("common")(on)),cn=(e,t)=>t.split(".").reduce((e,t)=>e?.[t],e);s.dn(cn);const dn=(e,t)=>{if(void 0===e||"string"!=typeof e||!e.length)return!1;if((t=t||{}).whiteListedProtocols&&!Array.isArray(t.whiteListedProtocols))throw new TypeError("The whiteListedProtocols should be an array of string.");if(t.defaultProtocol&&"string"!=typeof t.defaultProtocol)throw new TypeError("The defaultProtocol should be a string.");const s=t.whiteListedProtocols||[hn.HTTP,hn.HTTPS],n=[hn.JAVASCRIPT],i=t.defaultProtocol||"";!/^(?:(?!:\/\/).)*:\/\//.test(e)&&i&&(e=`${i}//${e}`);try{const t=new URL(e);return!n.includes(t.protocol)&&!!s.includes(t.protocol)&&t.href}catch(e){return console.error("Failed to sanitize URL:",e),!1}};s.dn(dn);const hn={FTP:"http:",FTPS:"https:",HTTP:"http:",HTTPS:"https:",JAVASCRIPT:"javascript:",SSH:"ssh:"},pn="enabled",un="disabled",mn="not found";class gn extends ls{static getSchema(){return{type:"object",required:[],properties:{status:{type:"string",enum:[pn,un,mn]},app:{type:"object"},passbolt:{type:"object"},serverTimeDiff:{type:"integer",nullable:!0}}}}marshall(){void 0===this._props.status&&(this._props.status=pn),gn.sanitizeEmailValidateRegex(this._props)}static sanitizeEmailValidateRegex(e){const t=e?.passbolt?.email?.validate?.regex;t&&"string"==typeof t&&t.trim().length&&(e.passbolt.email.validate.regex=t.trim().replace(/^\/+/,"").replace(/\/+$/,""))}static get disabledSiteSettings(){return{status:un}}toDto(){return{...this._props}}toJSON(){return this.toDto()}canIUse(e){const t=this._props?.passbolt?.plugins?.[e];return!(!t||"object"!=typeof t||void 0!==t.enabled&&!0!==t.enabled&&"true"!==t.enabled)}isPluginEnabled(e){return this.canIUse(e)}isFeatureBeta(e){return(0,es.A)(e),cn(this._props,`passbolt.plugins.${e}.isInBeta`)||!1}getPluginSettings(e){return cn(this._props,`passbolt.plugins.${e}`)}getRememberMeOptions(){return(this.getPluginSettings("rememberMe")||{}).options||{}}get hasRememberMeUntilILogoutOption(){return void 0!==(this.getRememberMeOptions()||{})[-1]}get generatorConfiguration(){return cn(this._props,"passbolt.plugins.generator.configuration")}get locale(){return cn(this._props,"app.locale")||gn.DEFAULT_LOCALE.locale}async setLocale(e){this._props.app||(this._props.app={}),this._props.app.locale=e}get supportedLocales(){return cn(this._props,"passbolt.plugins.locale.options")||gn.DEFAULT_SUPPORTED_LOCALES}getServerTimezone(){return cn(this._props,"passbolt.app.server_timezone")}get termsLink(){const e=cn(this._props,"passbolt.legal.terms.url");return!!e&&dn(e)}get privacyLink(){const e=cn(this._props,"passbolt.legal.privacy_policy.url");return!!e&&dn(e)}get registrationPublic(){return!0===cn(this._props,"passbolt.registration.public")}get debug(){return!0===cn(this._props,"app.debug")}get url(){return cn(this._props,"app.url")||""}get version(){return cn(this._props,"app.version.number")}get isCommunityEdition(){return"ce"===cn(this._props,"passbolt.edition")}get emailValidateRegex(){return cn(this._props,"passbolt.email.validate.regex")||null}isServerInPast(){return(this._props.serverTimeDiff||0)<0}get serverTime(){const e=this._props.serverTimeDiff||0;return(new Date).getTime()+e}static get ENTITY_NAME(){return"SiteSettings"}static get ORGANIZATION_ENABLED(){return pn}static get ORGANIZATION_DISABLED(){return un}static get ORGANIZATION_NOT_FOUND(){return mn}static get DEFAULT_LOCALE(){return{locale:"en-UK",label:"English"}}static get DEFAULT_SUPPORTED_LOCALES(){return[gn.DEFAULT_LOCALE]}}const En=gn;var yn=s(72635),bn=s(51831),fn=s(32107);class vn extends n.Component{constructor(e){super(e),this.state=this.defaultState}get defaultState(){return{ready:!1}}async componentDidMount(){await(0,yn.Yx)(bn.r).use(fn.A).init({lng:this.locale,load:"currentOnly",interpolation:{escapeValue:!1},react:{useSuspense:!1},backend:{loadPath:(e,t)=>this.getTranslationPath(e,t)},supportedLngs:this.supportedLocales,fallbackLng:!1,ns:["common"],defaultNS:"common",keySeparator:!1,nsSeparator:!1,debug:!1}),this.setState({ready:!0})}getTranslationPath(e,t){const s=e[0],n=t[0],i="en-GB"===s?"en-UK":s;return(this.props.loadingPath||"/locales/{{lng}}/{{ns}}.json").replace("{{lng}}",i).replace("{{ns}}",n)}get supportedLocales(){let e=[];return this.props.context.siteSettings?.supportedLocales?e=this.props.context.siteSettings?.supportedLocales.map(e=>e.locale):e.push(this.locale),e.includes("en-UK")&&e.push("en-GB"),e}get locale(){return this.props.context.locale}async componentDidUpdate(e){await this.handleLocaleChange(e.context.locale)}async handleLocaleChange(e){this.locale!==e&&await(0,yn.v2)(this.locale)}get isReady(){return this.state.ready}render(){return n.createElement(n.Fragment,null,this.isReady&&this.props.children)}}vn.propTypes={context:c().any,loadingPath:c().any,children:c().any};const Sn=a(vn),Tn=new class{allPropTypes=(...e)=>(...t)=>{const s=e.map(e=>e(...t)).filter(Boolean);if(0===s.length)return;const n=s.map(e=>e.message).join("\n");return new Error(n)}};var wn;function xn(){return xn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)({}).hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},xn.apply(null,arguments)}const An=function(e){return n.createElement("svg",xn({width:25,height:24,fill:"none",viewBox:"0 0 25 24"},e),wn||(wn=n.createElement("path",{stroke:"var(--icon-color)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M11.597 19a8 8 0 1 0 0-16 8 8 0 0 0 0 16M21.597 21l-4.35-4.35"})))};class Cn extends n.Component{constructor(e){super(e),this.state=this.getDefaultState(e),this.bindCallback(),this.createRefs()}getDefaultState(e){return{selectedValue:e.value,search:"",open:!1,style:void 0}}get listItemsFiltered(){const e=this.props.items.filter(e=>e.value!==this.state.selectedValue);return this.props.search&&""!==this.state.search?this.getItemsMatch(e,this.state.search):e}get selectedItemLabel(){const e=this.props.items&&this.props.items.find(e=>e.value===this.state.selectedValue);return e&&e.label||n.createElement(n.Fragment,null," ")}static getDerivedStateFromProps(e,t){return void 0!==e.value&&e.value!==t.selectedValue?{selectedValue:e.value}:null}bindCallback(){this.handleDocumentClickEvent=this.handleDocumentClickEvent.bind(this),this.handleDocumentContextualMenuEvent=this.handleDocumentContextualMenuEvent.bind(this),this.handleDocumentDragStartEvent=this.handleDocumentDragStartEvent.bind(this),this.handleDocumentScrollEvent=this.handleDocumentScrollEvent.bind(this),this.handleSelectClick=this.handleSelectClick.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleItemClick=this.handleItemClick.bind(this),this.handleSelectKeyDown=this.handleSelectKeyDown.bind(this),this.handleItemKeyDown=this.handleItemKeyDown.bind(this),this.handleBlur=this.handleBlur.bind(this)}createRefs(){this.selectedItemRef=n.createRef(),this.selectItemsRef=n.createRef(),this.itemsRef=n.createRef()}componentDidMount(){document.addEventListener("click",this.handleDocumentClickEvent,{capture:!0}),document.addEventListener("contextmenu",this.handleDocumentContextualMenuEvent,{capture:!0}),document.addEventListener("dragstart",this.handleDocumentDragStartEvent,{capture:!0}),document.addEventListener("scroll",this.handleDocumentScrollEvent,{capture:!0})}componentWillUnmount(){document.removeEventListener("click",this.handleDocumentClickEvent,{capture:!0}),document.removeEventListener("contextmenu",this.handleDocumentContextualMenuEvent,{capture:!0}),document.removeEventListener("dragstart",this.handleDocumentDragStartEvent,{capture:!0}),document.removeEventListener("scroll",this.handleDocumentScrollEvent,{capture:!0})}handleDocumentClickEvent(e){this.selectedItemRef.current.contains(e.target)||this.selectItemsRef.current.contains(e.target)||this.closeSelect()}handleDocumentContextualMenuEvent(e){this.selectedItemRef.current.contains(e.target)||this.selectItemsRef.current.contains(e.target)||this.closeSelect()}handleDocumentDragStartEvent(){this.closeSelect()}handleDocumentScrollEvent(e){this.itemsRef.current.contains(e.target)||this.selectItemsRef.current.contains(e.target)||this.closeSelect()}handleSelectClick(){if(this.props.disabled)this.closeSelect();else{const e=!this.state.open;e?this.forceVisibilitySelect():this.resetStyleSelect(),this.setState({open:e})}}getFirstParentWithTransform(){let e=this.selectedItemRef.current.parentElement;for(;null!==e&&""===e.style.getPropertyValue("transform");)e=e.parentElement;return e}forceVisibilitySelect(){const e=this.selectedItemRef.current.getBoundingClientRect(),{width:t,height:s}=e;let{top:n,left:i}=e;const r=this.getFirstParentWithTransform();if(r){const e=r.getBoundingClientRect();n-=e.top,i-=e.left}const a={position:"fixed",zIndex:1,width:t,height:s,top:n,left:i};this.setState({style:a})}handleBlur(e){e.currentTarget.contains(e.relatedTarget)||this.closeSelect()}closeSelect(){this.resetStyleSelect(),this.setState({open:!1})}resetStyleSelect(){this.setState({style:void 0})}handleInputChange(e){const t=e.target,s=t.value,n=t.name;this.setState({[n]:s})}handleItemClick(e){if(this.setState({selectedValue:e.value,open:!1}),"function"==typeof this.props.onChange){const t={target:{value:e.value,name:this.props.name}};this.props.onChange(t)}this.closeSelect()}getItemsMatch(e,t){const s=t&&t.split(/\s+/)||[""];return e.filter(e=>s.every(t=>((e,t)=>(e=>new RegExp((e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))(e),"i"))(e).test(t))(t,e.label)))}handleSelectKeyDown(e){switch(e.keyCode){case 13:return e.stopPropagation(),void this.handleSelectClick();case 40:return e.preventDefault(),e.stopPropagation(),void(this.state.open?this.focusItem(0):this.handleSelectClick());case 38:return e.preventDefault(),e.stopPropagation(),void(this.state.open?this.focusItem(this.listItemsFiltered.length-1):this.handleSelectClick());case 27:return e.stopPropagation(),void this.closeSelect();default:return}}focusItem(e){this.itemsRef.current.childNodes[e]?.focus()}handleItemKeyDown(e,t){switch(e.keyCode){case 13:return e.stopPropagation(),void this.handleItemClick(t);case 40:return e.stopPropagation(),e.preventDefault(),void(e.target.nextSibling?e.target.nextSibling.focus():this.focusItem(0));case 38:return e.stopPropagation(),e.preventDefault(),void(e.target.previousSibling?e.target.previousSibling.focus():this.focusItem(this.listItemsFiltered.length-1));default:return}}hasFilteredItems(){return this.listItemsFiltered.length>0}render(){return n.createElement("div",{className:`select-container ${this.props.className}`,style:{width:this.state.style?.width,height:this.state.style?.height}},n.createElement("div",{onKeyDown:this.handleSelectKeyDown,onBlur:this.handleBlur,id:this.props.id,className:`select ${this.props.direction} ${this.state.open?"open":""}`,style:this.state.style},n.createElement("div",{ref:this.selectedItemRef,className:"selected-value "+(this.props.disabled?"disabled":""),tabIndex:this.props.disabled?-1:0,onClick:this.handleSelectClick},n.createElement("span",{className:"value"},this.selectedItemLabel),n.createElement(te,null)),n.createElement("div",{ref:this.selectItemsRef,className:"select-items "+(this.state.open?"visible":"")},this.props.search&&n.createElement(n.Fragment,null,n.createElement("input",{className:"search-input",name:"search",value:this.state.search,onChange:this.handleInputChange,type:"text"}),n.createElement(An,{className:"search"})),n.createElement("ul",{ref:this.itemsRef,className:"items"},this.hasFilteredItems()&&this.listItemsFiltered.map(e=>n.createElement("li",{tabIndex:e.disabled?-1:0,key:e.value,title:e.title,className:`option ${e.value}`,onKeyDown:t=>this.handleItemKeyDown(t,e),onClick:()=>this.handleItemClick(e)},e.label)),!this.hasFilteredItems()&&this.props.search&&n.createElement("li",{className:"option no-results"},n.createElement(I.x,null,"No results match")," ",n.createElement("span",null,this.state.search))))))}}Cn.defaultProps={id:"",name:"select",className:"",direction:"bottom"},Cn.propTypes={id:c().string,name:c().string,className:c().string,direction:c().oneOf(Object.values({top:"top",bottom:"bottom",left:"left",right:"right"})),search:c().bool,items:c().array,value:Tn.allPropTypes(c().oneOfType([c().string,c().number,c().bool]),(e,t,s)=>{const n=e[t],i=e.items;if(null!==n&&i.length>0&&i.every(e=>e.value!==n))return new Error(`Invalid prop ${t} passed to ${s}. Expected the value ${n} in items.`)}),disabled:c().bool,onChange:c().func};const Rn=(0,P.C)("common")(Cn);class qn extends n.Component{constructor(e){super(e),this.state=this.defaultState,this.bindHandlers()}componentDidMount(){this.initLocale()}componentDidUpdate(e){this.handleLocaleChange(e.context.locale)}handleLocaleChange(e){this.props.context.locale!==e&&this.setState({locale:this.props.context.locale})}get defaultState(){return{loading:!0,locale:null,processing:!1}}get areActionsAllowed(){return!this.state.processing}bindHandlers(){this.handleLocaleInputChange=this.handleLocaleInputChange.bind(this)}async handleLocaleInputChange(e){const t=e.target.value;this.updateLocale(t)}async updateLocale(e){this.setState({processing:!0}),await this.props.context.onUpdateLocaleRequested(e),this.setState({processing:!1})}initLocale(){this.setState({locale:this.props.context.locale,loading:!1})}isLoading(){return this.state.loading}get supportedLocales(){return this.props.context.siteSettings.supportedLocales?this.props.context.siteSettings.supportedLocales.map(e=>({value:e.locale,label:e.label})):[]}render(){return n.createElement(n.Fragment,null,!this.isLoading()&&n.createElement("div",{className:"select-wrapper input"},n.createElement(Rn,{id:"user-locale-input",className:"setup-extension",name:"locale",value:this.state.locale,disabled:!this.areActionsAllowed,items:this.supportedLocales,onChange:this.handleLocaleInputChange})))}}qn.propTypes={context:c().any};const Nn=a(qn);class kn extends n.Component{get statesToHideLocaleSwitch(){return[N.INITIAL_STATE]}get mustDisplayLocaleSwitch(){return!this.statesToHideLocaleSwitch.includes(this.props.apiSetupContext.state)}render(){return n.createElement(n.Fragment,null,this.mustDisplayLocaleSwitch&&n.createElement(Nn,null))}}kn.propTypes={apiSetupContext:c().any};const _n=q(kn);var On,In,Pn,Dn,Un;function Gn(){return Gn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)({}).hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},Gn.apply(null,arguments)}const Ln=function(e){return n.createElement("svg",Gn({xmlns:"http://www.w3.org/2000/svg",width:151,height:27,fill:"none","aria-labelledby":"logo-title logo-description",viewBox:"0 0 151 27"},e),On||(On=n.createElement("title",{id:"logo-title"},"Passbolt logo")),In||(In=n.createElement("desc",{id:"logo-description"},"This is the logo of passbolt.")),Pn||(Pn=n.createElement("path",{fill:"var(--icon-color)",d:"M4.648 9.234v8.607h2.48c1.646 0 2.786-.349 3.47-1.012.685-.664 1.013-1.823 1.013-3.395 0-1.52-.305-2.595-.938-3.218-.633-.673-1.695-.972-3.24-.972zM.597 5.963h7.797c2.357 0 4.178.676 5.496 2.048q1.976 2.058 1.974 5.689a8.6 8.6 0 0 1-.406 2.749 7.1 7.1 0 0 1-1.24 2.278 5.9 5.9 0 0 1-2.38 1.773c-.937.349-2.152.524-3.697.524H4.648V26.5H.597zM24.016 18.016h5.064v-3.119h-4.76c-.937 0-1.594.124-1.95.375-.357.25-.517.698-.517 1.321 0 .524.15.899.429 1.122.28.223.848.301 1.734.301M18.649 5.963h8.268c2.103 0 3.672.476 4.736 1.423 1.065.947 1.594 2.347 1.594 4.217v9.456H22.37c-1.52 0-2.708-.375-3.52-1.121-.81-.747-1.2-1.823-1.2-3.22 0-1.722.454-2.945 1.392-3.692s2.483-1.134 4.697-1.134h5.315v-.365c0-.898-.276-1.518-.809-1.896-.532-.377-1.47-.55-2.86-.55H18.65zM36.55 17.915h8.525c.76 0 1.318-.124 1.646-.35.183-.122.328-.29.423-.486.094-.197.134-.414.115-.63a1.2 1.2 0 0 0-.112-.632 1.24 1.24 0 0 0-.42-.492c-.355-.253-.91-.374-1.646-.374h-3.494c-2.067 0-3.467-.325-4.203-.947-.737-.623-1.088-1.747-1.088-3.32 0-1.62.431-2.82 1.318-3.592.886-.772 2.255-1.152 4.064-1.152h8.684v3.142h-7.134q-1.75 0-2.279.301c-.354.198-.532.547-.532 1.071-.017.193.016.387.096.564s.204.332.361.449c.302.223.809.324 1.468.324h3.676c1.672 0 2.961.397 3.824 1.172s1.315 1.871 1.315 3.32c0 1.397-.405 2.53-1.188 3.417-.37.427-.833.768-1.354.996-.522.23-1.09.34-1.661.325H36.549zM53.822 17.915h8.526c.76 0 1.318-.124 1.646-.35a1.23 1.23 0 0 0 .42-.487c.093-.196.132-.413.112-.629a1.2 1.2 0 0 0-.111-.632 1.24 1.24 0 0 0-.421-.492c-.354-.253-.91-.374-1.646-.374h-3.493c-2.067 0-3.467-.325-4.204-.947-.736-.623-1.088-1.752-1.088-3.324 0-1.62.432-2.82 1.318-3.593.886-.772 2.253-1.147 4.075-1.147h8.686v3.142h-7.141q-1.747 0-2.28.301c-.353.198-.531.547-.531 1.071-.017.193.016.387.096.564s.204.332.361.449c.302.223.809.324 1.468.324h3.671c1.672 0 2.963.397 3.824 1.172s1.315 1.871 1.315 3.32c0 1.397-.403 2.53-1.188 3.417-.37.427-.832.767-1.354.996a3.9 3.9 0 0 1-1.66.325H53.769v-3.106zM75.387.5v5.463h3.47c1.55 0 2.759.175 3.694.55.946.362 1.77.976 2.38 1.772a7.2 7.2 0 0 1 1.243 2.296c.281.888.417 1.814.403 2.744q0 3.63-1.974 5.689c-1.315 1.372-3.14 2.046-5.493 2.046h-7.8V.5zm2.462 8.734h-2.483v8.608h2.785c1.55 0 2.633-.324 3.243-.95s.935-1.721.935-3.268-.354-2.694-1.033-3.367c-.68-.673-1.832-1.023-3.447-1.023M92.3 13.525c0 1.445.328 2.532 1.013 3.367s1.62 1.198 2.86 1.198 2.152-.398 2.863-1.198 1.033-1.921 1.033-3.367-.356-2.547-1.033-3.344c-.677-.798-1.62-1.198-2.863-1.198a3.64 3.64 0 0 0-1.57.279 3.6 3.6 0 0 0-1.29.919c-.685.797-1.013 1.921-1.013 3.344m12.002 0q0 3.544-2.202 5.689c-1.47 1.397-3.42 2.121-5.901 2.121s-4.457-.699-5.924-2.121-2.202-3.292-2.202-5.664q0-3.558 2.202-5.69c1.467-1.424 3.444-2.145 5.919-2.145s4.431.724 5.901 2.144 2.207 3.294 2.207 5.666M110.935 21.06h-4.202V.5h4.202zM112.884 5.963h2.86V.5h4.052v5.463h4.278v3.02h-4.278v6.09c0 1.12.204 1.895.581 2.343.377.449 1.064.649 2.026.649h1.671v3.02h-3.72c-1.494 0-2.636-.4-3.444-1.223-.809-.823-1.189-1.995-1.189-3.519v-7.36h-2.863v-3.02z"})),Dn||(Dn=n.createElement("path",{fill:"var(--Passbolt-logo-passbolt-logo)",d:"m149.951 10.68-9.059-8.36a2.12 2.12 0 0 0-1.421-.543c-.526 0-1.033.194-1.421.544l-5.684 5.268c.745.271 1.414.71 1.952 1.282.539.572.933 1.26 1.149 2.01h7.673a.73.73 0 0 1 .504.204.69.69 0 0 1 .207.494v1.147a.68.68 0 0 1-.207.494.72.72 0 0 1-.504.204h-.886v1.623a.68.68 0 0 1-.205.494.72.72 0 0 1-.503.205h-1.945a.73.73 0 0 1-.503-.205.69.69 0 0 1-.205-.494v-1.623h-3.426a4.84 4.84 0 0 1-1.135 2.033 5 5 0 0 1-1.966 1.287l5.71 5.276c.388.349.895.543 1.421.543a2.12 2.12 0 0 0 1.421-.543l9.043-8.355a2.03 2.03 0 0 0-.01-2.985"})),Un||(Un=n.createElement("path",{fill:"var(--Passbolt-logo-passbolt-logo)",d:"M130.683 9.867a2.6 2.6 0 0 0-1.064.253c-.371.18-.686.455-.913.794a2.242 2.242 0 0 0-.113 2.305 2.3 2.3 0 0 0 .831.877 2.36 2.36 0 0 0 2.355.059c.362-.197.664-.484.875-.833a2.24 2.24 0 0 0 .324-1.153 2.21 2.21 0 0 0-.653-1.625 2.3 2.3 0 0 0-.751-.5 2.3 2.3 0 0 0-.891-.177"})))};class Mn extends n.Component{constructor(e){super(e),this.state=this.defaultState,this.userId=null,this.token=null,this.initializeProperties()}get defaultState(){return{siteSettings:null,trustedDomain:this.baseUrl,getApiClientOptions:this.getApiClientOptions.bind(this),locale:null,onUpdateLocaleRequested:this.onUpdateLocaleRequested.bind(this)}}async componentDidMount(){const e=await this.getSiteSettings();this.initLocale(e)}initializeProperties(){const e="[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[0-5][a-fA-F0-9]{3}-[089aAbB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}",t=new RegExp(`setup/(install|start)/(${e})/(${e})$`),s=window.location.pathname.match(t);s?(this.userId=s[2],this.token=s[3]):console.error("Unable to retrieve the user id and token from the url")}get baseUrl(){const e=document.getElementsByTagName("base")&&document.getElementsByTagName("base")[0];return e?e.attributes.href.value.replace(/\/*$/g,""):(console.error("Unable to retrieve the page base tag"),"")}getApiClientOptions(){return(new k).setBaseUrl(this.state.trustedDomain)}async getSiteSettings(){const e=this.getApiClientOptions().setResourceName("settings"),t=new y(e),{body:s}=await t.findAll(),n=new En(s);return this.setState({siteSettings:n}),n}initLocale(e){const t=this.getUrlLocale(e)||this.getBrowserLocale(e)||this.getBrowserSimilarLocale(e)||e.locale;this.setState({locale:t}),this.setUrlLocale(t)}getUrlLocale(e){const t=new URL(window.location.href).searchParams.get("locale");if(t){const s=e.supportedLocales.find(e=>t===e.locale);if(s)return s.locale}}getBrowserLocale(e){const t=e.supportedLocales.find(e=>navigator.language===e.locale);if(t)return t.locale}getBrowserSimilarLocale(e){const t=navigator.language.split("-")[0],s=e.supportedLocales.find(e=>t===e.locale.split("-")[0]);if(s)return s.locale}onUpdateLocaleRequested(e){this.setState({locale:e}),this.setUrlLocale(e)}setUrlLocale(e){const t=new URL(window.location.href);t.searchParams.set("locale",e),window.history.replaceState(null,null,t)}isReady(){return null!==this.state.siteSettings&&null!==this.state.locale}render(){return n.createElement(o.Provider,{value:this.state},this.isReady()&&n.createElement(Sn,{loadingPath:`${this.state.trustedDomain}/locales/{{lng}}/{{ns}}.json`},n.createElement(R,{value:{userId:this.userId,token:this.token}},n.createElement("div",{id:"container",className:"container page login"},n.createElement("div",{className:"content"},n.createElement("div",{className:"header"},n.createElement("div",{className:"logo-svg"},n.createElement(Ln,{role:"img",width:"20rem",height:"3.5rem"}))),n.createElement("div",{className:"login-form"},n.createElement(ht,null)),n.createElement(_n,null)),n.createElement(ln,null)))))}}const Fn=Mn,$n=document.createElement("div");document.body.appendChild($n),(0,i.H)($n).render(n.createElement(Fn,null))}};const t={};function s(n){const i=t[n];if(void 0!==i)return i.exports;const r=t[n]={exports:{}};return e[n].call(r.exports,r,r.exports,s),r.exports}s.m=e,(()=>{const e=[];s.O=(t,n,i)=>{if(!n){for(var r=0;r<e.length;r++){let[n,i]=e[r],o=!0;for(var a=0;a<n.length;a++)s.O.j(n[a])?n.splice(a--,1):o=!1;if(o){e.splice(r--,1);const s=i();void 0!==s&&(t=s)}}return t}e.push([n,i])}})(),s.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.cw=e=>{var t;return()=>{if(e){var s=e;e=0,t={exports:{}},s.call(t.exports,t,t.exports)}return t.exports}},s.d=(e,t)=>{if(Array.isArray(t))for(var n=0;n<t.length;){var i=t[n++],r=t[n++],a=0===r?{enumerable:!0,value:t[n++]}:{enumerable:!0,get:r};s.o(e,i)||Object.defineProperty(e,i,a)}else for(var i in t)s.o(t,i)&&!s.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.j=7793,s.dn=e=>{var t=Object.getOwnPropertyDescriptor(e,"name");(!t||!t.writable&&t.configurable)&&Object.defineProperty(e,"name",{value:"default",configurable:!0})},(()=>{const e={7793:0};s.O.j=t=>0===e[t];const t=(t,n)=>{let[i,r,a]=n;var o,l,c=0;if(i.some(t=>0!==e[t])){for(o in r)s.o(r,o)&&(s.m[o]=r[o]);if(a)var d=a(s)}for(t&&t(n);c<i.length;c++)l=i[c],s.o(e,l)&&e[l]&&e[l][0](),e[l]=0;return s.O(d)},n=self.webpackChunkpassbolt_styleguide=self.webpackChunkpassbolt_styleguide||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();let n=s.O(void 0,[3847],()=>s(19375));n=s.O(n)})();
|