UNPKG

@peculiar/fortify-webcomponents

Version:

Web-components for creating CSR or Certificate and viewing certificates list using Fortify

104 lines 45.7 kB
var __awaiter=this&&this.__awaiter||function(e,a,o,r){function n(e){return e instanceof o?e:new o((function(a){a(e)}))}return new(o||(o=Promise))((function(o,t){function i(e){try{s(r.next(e))}catch(e){t(e)}}function c(e){try{s(r["throw"](e))}catch(e){t(e)}}function s(e){e.done?o(e.value):n(e.value).then(i,c)}s((r=r.apply(e,a||[])).next())}))};var __generator=this&&this.__generator||function(e,a){var o={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},r,n,t,i;return i={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function c(e){return function(a){return s([e,a])}}function s(c){if(r)throw new TypeError("Generator is already executing.");while(i&&(i=0,c[0]&&(o=0)),o)try{if(r=1,n&&(t=c[0]&2?n["return"]:c[0]?n["throw"]||((t=n["return"])&&t.call(n),0):n.next)&&!(t=t.call(n,c[1])).done)return t;if(n=0,t)c=[c[0]&2,t.value];switch(c[0]){case 0:case 1:t=c;break;case 4:o.label++;return{value:c[1],done:false};case 5:o.label++;n=c[1];c=[0];continue;case 7:c=o.ops.pop();o.trys.pop();continue;default:if(!(t=o.trys,t=t.length>0&&t[t.length-1])&&(c[0]===6||c[0]===2)){o=0;continue}if(c[0]===3&&(!t||c[1]>t[0]&&c[1]<t[3])){o.label=c[1];break}if(c[0]===6&&o.label<t[1]){o.label=t[1];t=c;break}if(t&&o.label<t[2]){o.label=t[2];o.ops.push(c);break}if(t[2])o.ops.pop();o.trys.pop();continue}c=a.call(e,o)}catch(e){c=[6,e];n=0}finally{r=t=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}}; /*! * © Peculiar Ventures https://peculiarventures.com/ - BSD 3-Clause License */System.register(["./p-0e5b5fce.system.js","./p-9a94c69a.system.js","./p-920e4680.system.js","./p-2f264b96.system.js","./p-f40583a2.system.js","./p-1567eb81.system.js"],(function(e){"use strict";var a,o,r,n,t,i,c,s,l,d,v,p,m,u,h,f,b,g,y,x,w,_,k,z;return{setters:[function(e){a=e.h;o=e.r;r=e.c;n=e.H},function(e){t=e.E;i=e.k;c=e.l;s=e.F;l=e.a;d=e.N;v=e.c;p=e.d;m=e.e;u=e.f;h=e.g;f=e.h;b=e.i;g=e.j},function(e){y=e.D;x=e.bi;w=e.C},function(e){_=e.g;k=e.l},function(e){z=e.T},function(){}],execute:function(){ /** * @license * Copyright (c) Peculiar Ventures, LLC. * * This source code is licensed under the BSD 3-Clause license found in the * LICENSE file in the root directory of this source tree. */ var S=function(e){return a("svg",Object.assign({},e,{width:"6px",height:"6px",fill:"none",xmlns:"http://www.w3.org/2000/svg"}),a("path",{fill:"currentColor","fill-rule":"evenodd","clip-rule":"evenodd",d:"M.611 0A.608.608 0 000 .605a.6.6 0 00.204.451c.003.003 0 .007 0 .01l4.739 4.75c.002.002.006 0 .007.002a.604.604 0 001.038-.423L6 1.597C6 .715 5.285 0 4.403 0H.611z"}))}; /** * @license * Copyright (c) Peculiar Ventures, LLC. * * This source code is licensed under the BSD 3-Clause license found in the * LICENSE file in the root directory of this source tree. */var C=function(e){return a("svg",Object.assign({},e,{viewBox:"0 0 24 24",width:"24px",height:"24px",fill:"none",xmlns:"http://www.w3.org/2000/svg"}),a("path",{d:"M12.39 14.512a.5.5 0 01-.78 0l-2.96-3.7A.5.5 0 019.04 10h5.92a.5.5 0 01.39.812l-2.96 3.7z",fill:"currentColor"}))}; /** * @license * Copyright (c) Peculiar Ventures, LLC. * * This source code is licensed under the BSD 3-Clause license found in the * LICENSE file in the root directory of this source tree. */var M=function(e){return a("svg",Object.assign({},e,{viewBox:"0 0 24 24",width:"24px",height:"24px",fill:"none",xmlns:"http://www.w3.org/2000/svg"}),a("path",{fill:"currentColor",d:"M4.338 11.656l5.98 5.667a1 1 0 001.452-.081l7.144-8.453a.51.51 0 00-.043-.716l-.38-.338a.508.508 0 00-.717.043l-6.84 7.7-5.584-4.96a.509.509 0 00-.717.042l-.337.38a.51.51 0 00.042.716z"}))};var j=function(){var e;return{subject:{fields:(e={},e[t.CommonName]={required:true},e[t.Organization]={required:false},e[t.OrganizationUnit]={required:false},e[t.Country]={required:false,defaultValue:"US"},e[t.Region]={required:false},e[t.State]={required:false},e)},publicKey:{fields:{signatureAlgorithm:{required:true,defaultValue:i.RSA2048},hashAlgorithm:{required:true,defaultValue:c.SHA_256}}},options:{fields:{useSelfSignedCertificate:{required:false}}}}}; /** * @license * Copyright (c) Peculiar Ventures, LLC. * * This source code is licensed under the BSD 3-Clause license found in the * LICENSE file in the root directory of this source tree. */var A=function(e){var o=e.onCancel,r=e.onAccept;return a(l,{title:_("enrollment.error.title"),description:_("If you want to try again click the button below")},a(s,{onClick:o},_("actions.cancel")),a(s,{variant:"primary",onClick:r},_("actions.tryAgain")))}; /** * @license * Copyright (c) Peculiar Ventures, LLC. * * This source code is licensed under the BSD 3-Clause license found in the * LICENSE file in the root directory of this source tree. */var O=function(e){var o=e.pem,r=e.type,n=e.name,t=e.onClose;var i=function(){if(r==="pkcs10"){y.csr.asPEM(o,n)}else{y.cert.asPEM(o,n)}};return a("div",{class:"enrollment_form"},a("header",{class:"enrollment_form_header"},a(z,{variant:"h5",color:"black"},r==="pkcs10"?_("enrollment.success.csr.title"):_("enrollment.success.certificate.title"))),a("div",{class:"enrollment_form_content"},a("textarea",{class:"form_field form_field_result t-b3",readOnly:true},o)),a("footer",{class:"enrollment_form_footer container_actions"},a(s,{onClick:t},_("actions.close")),a(s,{variant:"primary",onClick:i},"Download PEM")))}; /** * @license * Copyright (c) Peculiar Ventures, LLC. * * This source code is licensed under the BSD 3-Clause license found in the * LICENSE file in the root directory of this source tree. */var I=function(e){var o=e.label,r=e.options,n=e.disabled,t=e.name,i=e.required,c=e.defaultValue,s=e.readOnly;var l=function(){if(!i){return null}return a(S,{class:"form_field_icon_required"})};var d=function(){return a(C,{class:"form_field_icon_arrow_down"})};return a("label",null,a(z,{variant:"c2",color:"gray-10",component:"span"},o),a("div",{class:"form_field_container"},a("select",{class:"form_field t-b3",name:t,disabled:n,required:i,tabIndex:s?-1:undefined},r.map((function(e){return a("option",{key:e.value,value:e.value,selected:c===e.value},e.name)}))),l(),d()))}; /** * @license * Copyright (c) Peculiar Ventures, LLC. * * This source code is licensed under the BSD 3-Clause license found in the * LICENSE file in the root directory of this source tree. */var T=function(e){var o=e.label,r=e.name,n=e.disabled,t=e.defaultChecked,i=e.required,c=e.readOnly;return a("label",{class:"form_checkbox_root"},a("div",{class:"form_checkbox_container"},a("input",{type:"checkbox",name:r,disabled:n,defaultChecked:t,required:i,tabIndex:c?-1:undefined,readOnly:c,class:"form_checkbox",onClick:function(e){if(c){e.preventDefault();return false}return undefined}}),a(M,{"aria-hidden":"true",class:"form_checkbox_icon_check"})),a(z,{variant:"b3",color:"black",component:"span"},o))}; /** * @license * Copyright (c) Peculiar Ventures, LLC. * * This source code is licensed under the BSD 3-Clause license found in the * LICENSE file in the root directory of this source tree. */var G=undefined&&undefined.__rest||function(e,a){var o={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&a.indexOf(r)<0)o[r]=e[r];if(e!=null&&typeof Object.getOwnPropertySymbols==="function")for(var n=0,r=Object.getOwnPropertySymbols(e);n<r.length;n++){if(a.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n]))o[r[n]]=e[r[n]]}return o};var P=function(e){var o=e.formPolicy,r=G(e,["formPolicy"]);var n=function(){return Object.keys(o).map((function(e){var r=o[e];var n=e==="signatureAlgorithm"?i:c;return a(I,{name:e,label:r.label||_("enrollment.label.".concat(e)),options:Object.entries(n).map((function(e){return{value:e[1],name:e[1]}})),required:r.required,defaultValue:r.defaultValue,readOnly:r.readOnly})}))};return a("div",Object.assign({},r),n(),a("div",null),a("div",{class:"mt_2"},a(z,{variant:"c2",color:"gray-10"},_("enrollment.title.usage")),a("div",{class:"enrollment_form_group_fields_usage mt_4"},a(T,{label:_("enrollment.label.sign"),name:"sign",defaultChecked:true,readOnly:true}),a(T,{label:_("enrollment.label.verify"),name:"verify",defaultChecked:true,readOnly:true}))))};var B=[{code:"AF",name:"Afghanistan"},{code:"AX",name:"Åland Islands"},{code:"AL",name:"Albania"},{code:"DZ",name:"Algeria"},{code:"AS",name:"American Samoa"},{code:"AD",name:"AndorrA"},{code:"AO",name:"Angola"},{code:"AI",name:"Anguilla"},{code:"AQ",name:"Antarctica"},{code:"AG",name:"Antigua and Barbuda"},{code:"AR",name:"Argentina"},{code:"AM",name:"Armenia"},{code:"AW",name:"Aruba"},{code:"AU",name:"Australia"},{code:"AT",name:"Austria"},{code:"AZ",name:"Azerbaijan"},{code:"BS",name:"Bahamas"},{code:"BH",name:"Bahrain"},{code:"BD",name:"Bangladesh"},{code:"BB",name:"Barbados"},{code:"BY",name:"Belarus"},{code:"BE",name:"Belgium"},{code:"BZ",name:"Belize"},{code:"BJ",name:"Benin"},{code:"BM",name:"Bermuda"},{code:"BT",name:"Bhutan"},{code:"BO",name:"Bolivia"},{code:"BA",name:"Bosnia and Herzegovina"},{code:"BW",name:"Botswana"},{code:"BV",name:"Bouvet Island"},{code:"BR",name:"Brazil"},{code:"IO",name:"British Indian Ocean Territory"},{code:"CA",name:"Canada"},{code:"BN",name:"Brunei Darussalam"},{code:"BG",name:"Bulgaria"},{code:"BF",name:"Burkina Faso"},{code:"BI",name:"Burundi"},{code:"KH",name:"Cambodia"},{code:"CM",name:"Cameroon"},{code:"CV",name:"Cape Verde"},{code:"KY",name:"Cayman Islands"},{code:"CF",name:"Central African Republic"},{code:"TD",name:"Chad"},{code:"CL",name:"Chile"},{code:"CN",name:"China"},{code:"CX",name:"Christmas Island"},{code:"CC",name:"Cocos (Keeling) Islands"},{code:"CO",name:"Colombia"},{code:"KM",name:"Comoros"},{code:"CG",name:"Congo"},{code:"CD",name:"Congo, The Democratic Republic of the"},{code:"CK",name:"Cook Islands"},{code:"CR",name:"Costa Rica"},{code:"CI",name:'Cote D"Ivoire'},{code:"HR",name:"Croatia"},{code:"CU",name:"Cuba"},{code:"CY",name:"Cyprus"},{code:"CZ",name:"Czech Republic"},{code:"DK",name:"Denmark"},{code:"DJ",name:"Djibouti"},{code:"DM",name:"Dominica"},{code:"DO",name:"Dominican Republic"},{code:"EC",name:"Ecuador"},{code:"EG",name:"Egypt"},{code:"SV",name:"El Salvador"},{code:"GQ",name:"Equatorial Guinea"},{code:"ER",name:"Eritrea"},{code:"EE",name:"Estonia"},{code:"ET",name:"Ethiopia"},{code:"FK",name:"Falkland Islands (Malvinas)"},{code:"FO",name:"Faroe Islands"},{code:"FJ",name:"Fiji"},{code:"FI",name:"Finland"},{code:"FR",name:"France"},{code:"GF",name:"French Guiana"},{code:"PF",name:"French Polynesia"},{code:"TF",name:"French Southern Territories"},{code:"GA",name:"Gabon"},{code:"GM",name:"Gambia"},{code:"GE",name:"Georgia"},{code:"DE",name:"Germany"},{code:"GH",name:"Ghana"},{code:"GI",name:"Gibraltar"},{code:"GR",name:"Greece"},{code:"GL",name:"Greenland"},{code:"GD",name:"Grenada"},{code:"GP",name:"Guadeloupe"},{code:"GU",name:"Guam"},{code:"GT",name:"Guatemala"},{code:"GG",name:"Guernsey"},{code:"GN",name:"Guinea"},{code:"GW",name:"Guinea-Bissau"},{code:"GY",name:"Guyana"},{code:"HT",name:"Haiti"},{code:"HM",name:"Heard Island and Mcdonald Islands"},{code:"VA",name:"Holy See (Vatican City State)"},{code:"HN",name:"Honduras"},{code:"HK",name:"Hong Kong"},{code:"HU",name:"Hungary"},{code:"IS",name:"Iceland"},{code:"IN",name:"India"},{code:"ID",name:"Indonesia"},{code:"IR",name:"Iran, Islamic Republic Of"},{code:"IQ",name:"Iraq"},{code:"IE",name:"Ireland"},{code:"IM",name:"Isle of Man"},{code:"IL",name:"Israel"},{code:"IT",name:"Italy"},{code:"JM",name:"Jamaica"},{code:"JP",name:"Japan"},{code:"JE",name:"Jersey"},{code:"JO",name:"Jordan"},{code:"KZ",name:"Kazakhstan"},{code:"KE",name:"Kenya"},{code:"KI",name:"Kiribati"},{code:"KP",name:'Korea, Democratic People"S Republic of'},{code:"KR",name:"Korea, Republic of"},{code:"KW",name:"Kuwait"},{code:"KG",name:"Kyrgyzstan"},{code:"LA",name:'Lao People"S Democratic Republic'},{code:"LV",name:"Latvia"},{code:"LB",name:"Lebanon"},{code:"LS",name:"Lesotho"},{code:"LR",name:"Liberia"},{code:"LY",name:"Libyan Arab Jamahiriya"},{code:"LI",name:"Liechtenstein"},{code:"LT",name:"Lithuania"},{code:"LU",name:"Luxembourg"},{code:"MO",name:"Macao"},{code:"MK",name:"Macedonia, The Former Yugoslav Republic of"},{code:"MG",name:"Madagascar"},{code:"MW",name:"Malawi"},{code:"MY",name:"Malaysia"},{code:"MV",name:"Maldives"},{code:"ML",name:"Mali"},{code:"MT",name:"Malta"},{code:"MH",name:"Marshall Islands"},{code:"MQ",name:"Martinique"},{code:"MR",name:"Mauritania"},{code:"MU",name:"Mauritius"},{code:"YT",name:"Mayotte"},{code:"MX",name:"Mexico"},{code:"FM",name:"Micronesia, Federated States of"},{code:"MD",name:"Moldova, Republic of"},{code:"MC",name:"Monaco"},{code:"MN",name:"Mongolia"},{code:"MS",name:"Montserrat"},{code:"MA",name:"Morocco"},{code:"MZ",name:"Mozambique"},{code:"MM",name:"Myanmar"},{code:"NA",name:"Namibia"},{code:"NR",name:"Nauru"},{code:"NP",name:"Nepal"},{code:"NL",name:"Netherlands"},{code:"AN",name:"Netherlands Antilles"},{code:"NC",name:"New Caledonia"},{code:"NZ",name:"New Zealand"},{code:"NI",name:"Nicaragua"},{code:"NE",name:"Niger"},{code:"NG",name:"Nigeria"},{code:"NU",name:"Niue"},{code:"NF",name:"Norfolk Island"},{code:"MP",name:"Northern Mariana Islands"},{code:"NO",name:"Norway"},{code:"OM",name:"Oman"},{code:"PK",name:"Pakistan"},{code:"PW",name:"Palau"},{code:"PS",name:"Palestinian Territory, Occupied"},{code:"PA",name:"Panama"},{code:"PG",name:"Papua New Guinea"},{code:"PY",name:"Paraguay"},{code:"PE",name:"Peru"},{code:"PH",name:"Philippines"},{code:"PN",name:"Pitcairn"},{code:"PL",name:"Poland"},{code:"PT",name:"Portugal"},{code:"PR",name:"Puerto Rico"},{code:"QA",name:"Qatar"},{code:"RE",name:"Reunion"},{code:"RO",name:"Romania"},{code:"RU",name:"Russian Federation"},{code:"RW",name:"RWANDA"},{code:"SH",name:"Saint Helena"},{code:"KN",name:"Saint Kitts and Nevis"},{code:"LC",name:"Saint Lucia"},{code:"PM",name:"Saint Pierre and Miquelon"},{code:"VC",name:"Saint Vincent and the Grenadines"},{code:"WS",name:"Samoa"},{code:"SM",name:"San Marino"},{code:"ST",name:"Sao Tome and Principe"},{code:"SA",name:"Saudi Arabia"},{code:"SN",name:"Senegal"},{code:"CS",name:"Serbia and Montenegro"},{code:"SC",name:"Seychelles"},{code:"SL",name:"Sierra Leone"},{code:"SG",name:"Singapore"},{code:"SK",name:"Slovakia"},{code:"SI",name:"Slovenia"},{code:"SB",name:"Solomon Islands"},{code:"SO",name:"Somalia"},{code:"ZA",name:"South Africa"},{code:"GS",name:"South Georgia and the South Sandwich Islands"},{code:"ES",name:"Spain"},{code:"LK",name:"Sri Lanka"},{code:"SD",name:"Sudan"},{code:"SR",name:"Suriname"},{code:"SJ",name:"Svalbard and Jan Mayen"},{code:"SZ",name:"Swaziland"},{code:"SE",name:"Sweden"},{code:"CH",name:"Switzerland"},{code:"SY",name:"Syrian Arab Republic"},{code:"TW",name:"Taiwan, Province of China"},{code:"TJ",name:"Tajikistan"},{code:"TZ",name:"Tanzania, United Republic of"},{code:"TH",name:"Thailand"},{code:"TL",name:"Timor-Leste"},{code:"TG",name:"Togo"},{code:"TK",name:"Tokelau"},{code:"TO",name:"Tonga"},{code:"TT",name:"Trinidad and Tobago"},{code:"TN",name:"Tunisia"},{code:"TR",name:"Turkey"},{code:"TM",name:"Turkmenistan"},{code:"TC",name:"Turks and Caicos Islands"},{code:"TV",name:"Tuvalu"},{code:"UG",name:"Uganda"},{code:"UA",name:"Ukraine"},{code:"AE",name:"United Arab Emirates"},{code:"GB",name:"United Kingdom"},{code:"US",name:"United States"},{code:"UM",name:"United States Minor Outlying Islands"},{code:"UY",name:"Uruguay"},{code:"UZ",name:"Uzbekistan"},{code:"VU",name:"Vanuatu"},{code:"VE",name:"Venezuela"},{code:"VN",name:"Viet Nam"},{code:"VG",name:"Virgin Islands, British"},{code:"VI",name:"Virgin Islands, U.S."},{code:"WF",name:"Wallis and Futuna"},{code:"EH",name:"Western Sahara"},{code:"YE",name:"Yemen"},{code:"ZM",name:"Zambia"},{code:"ZW",name:"Zimbabwe"}]; /** * @license * Copyright (c) Peculiar Ventures, LLC. * * This source code is licensed under the BSD 3-Clause license found in the * LICENSE file in the root directory of this source tree. */var N=function(e){var o=e.label,r=e.disabled,n=e.maxLength,t=e.name,i=e.placeholder,c=e.readOnly,s=e.required,l=e.defaultValue;var d=function(){if(!s){return null}return a(S,{class:"form_field_icon_required"})};return a("label",null,a(z,{variant:"c2",color:"gray-10",component:"span"},o),a("div",{class:"form_field_container"},a("input",{class:"form_field t-b3",type:"text",disabled:r,maxLength:n,name:t,placeholder:i,readOnly:c,required:s,defaultValue:l}),d()))}; /** * @license * Copyright (c) Peculiar Ventures, LLC. * * This source code is licensed under the BSD 3-Clause license found in the * LICENSE file in the root directory of this source tree. */var R=undefined&&undefined.__rest||function(e,a){var o={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&a.indexOf(r)<0)o[r]=e[r];if(e!=null&&typeof Object.getOwnPropertySymbols==="function")for(var n=0,r=Object.getOwnPropertySymbols(e);n<r.length;n++){if(a.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n]))o[r[n]]=e[r[n]]}return o};var E=function(e){var o=e.formPolicy,r=R(e,["formPolicy"]);var n=function(){if("subjectName"in o){var e=o.subjectName;return a(N,{name:"subjectName",label:e.label,required:e.required,defaultValue:e.defaultValue,readOnly:e.readOnly})}var r=Object.values(t);return Object.keys(o).map((function(e){var n=o[e];if(!r.includes(e)){return null}if(e===t.Country){return a(I,{name:e,label:n.label||_("enrollment.label.".concat(e)),options:B.map((function(e){return{name:e.name,value:e.code}})),required:n.required,defaultValue:n.defaultValue,readOnly:n.readOnly})}return a(N,{name:e,label:n.label||_("enrollment.label.".concat(e)),required:n.required,defaultValue:n.defaultValue,readOnly:n.readOnly})}))};return a("div",Object.assign({},r),n())}; /** * @license * Copyright (c) Peculiar Ventures, LLC. * * This source code is licensed under the BSD 3-Clause license found in the * LICENSE file in the root directory of this source tree. */var L=undefined&&undefined.__rest||function(e,a){var o={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&a.indexOf(r)<0)o[r]=e[r];if(e!=null&&typeof Object.getOwnPropertySymbols==="function")for(var n=0,r=Object.getOwnPropertySymbols(e);n<r.length;n++){if(a.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n]))o[r[n]]=e[r[n]]}return o};var K=function(e){var o=e.formPolicy,r=L(e,["formPolicy"]);var n=o.useSelfSignedCertificate;return a("div",Object.assign({},r),a(T,{name:"useSelfSignedCertificate",label:n.label||_("enrollment.label.useSelfSignedCertificate"),defaultChecked:n.defaultValue,required:n.required,readOnly:n.readOnly}))}; /** * @license * Copyright (c) Peculiar Ventures, LLC. * * This source code is licensed under the BSD 3-Clause license found in the * LICENSE file in the root directory of this source tree. */var D=undefined&&undefined.__rest||function(e,a){var o={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&a.indexOf(r)<0)o[r]=e[r];if(e!=null&&typeof Object.getOwnPropertySymbols==="function")for(var n=0,r=Object.getOwnPropertySymbols(e);n<r.length;n++){if(a.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n]))o[r[n]]=e[r[n]]}return o};var F=function(e){var o=e.providers,r=o===void 0?[]:o,n=D(e,["providers"]);return a("div",Object.assign({},n),a(I,{label:_("enrollment.label.provider"),options:r.map((function(e){return{name:e.name,value:e.id}})),name:"providerId",required:true}))}; /** * @license * Copyright (c) Peculiar Ventures, LLC. * * This source code is licensed under the BSD 3-Clause license found in the * LICENSE file in the root directory of this source tree. */var V="enrollment-form";var q=function(e){var o=e.formPolicy,r=e.providers,n=r===void 0?[]:r,l=e.onSubmit,d=e.onCancel;var v=function(e){e.preventDefault();if(e.target instanceof HTMLFormElement){var a=new FormData(e.target);var o=Object.values(t);var r={subjectName:"",useSelfSignedCertificate:false,providerId:"",signatureAlgorithm:i.RSA2048,hashAlgorithm:c.SHA_256};a.forEach((function(e,a){if(a in r){r[a]=e}if(a==="useSelfSignedCertificate"){r[a]=true}if(o.includes(a)&&e){if(!r.subjectName){r.subjectName="".concat(a,"=").concat(e)}else{r.subjectName=r.subjectName.concat(", ".concat(a,"=").concat(e))}}}));l(r)}};return a("div",{class:"enrollment_form"},a("header",{class:"enrollment_form_header"},a(z,{variant:"h5",color:"black"},_("enrollment.title"))),a("form",{onSubmit:v,class:"enrollment_form_content",id:V},a("div",{class:"enrollment_form_group"},a(z,{variant:"s2",color:"black"},_("enrollment.title.provider")),a(F,{class:"enrollment_form_group_fields mt_2",providers:n})),a("div",{class:"enrollment_form_group"},a(z,{variant:"s2",color:"black"},o.subject.title||_("enrollment.title.subject")),a(E,{class:"enrollment_form_group_fields mt_2",formPolicy:o.subject.fields})),a("div",{class:"enrollment_form_group"},a(z,{variant:"s2",color:"black"},o.publicKey.title||_("enrollment.title.publicKey")),a(P,{class:"enrollment_form_group_fields mt_2",formPolicy:o.publicKey.fields})),a("div",{class:"enrollment_form_group"},a(z,{variant:"s2",color:"black"},o.options.title||_("enrollment.title.options")),a(K,{class:"mt_6",formPolicy:o.options.fields}))),a("footer",{class:"enrollment_form_footer container_actions"},a(s,{onClick:d},_("actions.cancel")),a(s,{variant:"primary",type:"submit",ref:function(e){return e===null||e===void 0?void 0:e.setAttribute("form",V)}},_("actions.create"))))};var U="*{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-moz-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none;-webkit-text-size-adjust:none;-webkit-tap-highlight-color:transparent;font-family:var(--pv-font-family, inherit)}.t-h1{font-weight:var(--pv-text-h1-weight);font-size:var(--pv-text-h1-size);line-height:var(--pv-text-h1-height);letter-spacing:var(--pv-text-h1-spacing)}.t-h2{font-weight:var(--pv-text-h2-weight);font-size:var(--pv-text-h2-size);line-height:var(--pv-text-h2-height);letter-spacing:var(--pv-text-h2-spacing)}.t-h3{font-weight:var(--pv-text-h3-weight);font-size:var(--pv-text-h3-size);line-height:var(--pv-text-h3-height);letter-spacing:var(--pv-text-h3-spacing)}.t-h4{font-weight:var(--pv-text-h4-weight);font-size:var(--pv-text-h4-size);line-height:var(--pv-text-h4-height);letter-spacing:var(--pv-text-h4-spacing)}.t-h5{font-weight:var(--pv-text-h5-weight);font-size:var(--pv-text-h5-size);line-height:var(--pv-text-h5-height);letter-spacing:var(--pv-text-h5-spacing)}.t-s1{font-weight:var(--pv-text-s1-weight);font-size:var(--pv-text-s1-size);line-height:var(--pv-text-s1-height);letter-spacing:var(--pv-text-s1-spacing)}.t-s2{font-weight:var(--pv-text-s2-weight);font-size:var(--pv-text-s2-size);line-height:var(--pv-text-s2-height);letter-spacing:var(--pv-text-s2-spacing)}.t-b1{font-weight:var(--pv-text-b1-weight);font-size:var(--pv-text-b1-size);line-height:var(--pv-text-b1-height);letter-spacing:var(--pv-text-b1-spacing)}.t-b2{font-weight:var(--pv-text-b2-weight);font-size:var(--pv-text-b2-size);line-height:var(--pv-text-b2-height);letter-spacing:var(--pv-text-b2-spacing)}.t-b3{font-weight:var(--pv-text-b3-weight);font-size:var(--pv-text-b3-size);line-height:var(--pv-text-b3-height);letter-spacing:var(--pv-text-b3-spacing)}.t-btn1{font-weight:var(--pv-text-btn1-weight);font-size:var(--pv-text-btn1-size);line-height:var(--pv-text-btn1-height);letter-spacing:var(--pv-text-btn1-spacing)}.t-btn2{font-weight:var(--pv-text-btn2-weight);font-size:var(--pv-text-btn2-size);line-height:var(--pv-text-btn2-height);letter-spacing:var(--pv-text-btn2-spacing)}.t-c1{font-weight:var(--pv-text-c1-weight);font-size:var(--pv-text-c1-size);line-height:var(--pv-text-c1-height);letter-spacing:var(--pv-text-c1-spacing)}.t-c2{font-weight:var(--pv-text-c2-weight);font-size:var(--pv-text-c2-size);line-height:var(--pv-text-c2-height);letter-spacing:var(--pv-text-c2-spacing)}.c-primary-tint-5{--pv-color-base:var(--pv-color-primary-tint-5)}.c-primary-tint-4{--pv-color-base:var(--pv-color-primary-tint-4)}.c-primary-tint-3{--pv-color-base:var(--pv-color-primary-tint-3)}.c-primary-tint-2{--pv-color-base:var(--pv-color-primary-tint-2)}.c-primary-tint-1{--pv-color-base:var(--pv-color-primary-tint-1)}.c-primary{--pv-color-base:var(--pv-color-primary)}.c-primary-shade-1{--pv-color-base:var(--pv-color-primary-shade-1)}.c-primary-shade-2{--pv-color-base:var(--pv-color-primary-shade-2)}.c-primary-shade-3{--pv-color-base:var(--pv-color-primary-shade-3)}.c-primary-shade-4{--pv-color-base:var(--pv-color-primary-shade-4)}.c-primary-shade-5{--pv-color-base:var(--pv-color-primary-shade-5)}.c-primary-contrast{--pv-color-base:var(--pv-color-primary-contrast)}.c-secondary-tint-5{--pv-color-base:var(--pv-color-secondary-tint-5)}.c-secondary-tint-4{--pv-color-base:var(--pv-color-secondary-tint-4)}.c-secondary-tint-3{--pv-color-base:var(--pv-color-secondary-tint-3)}.c-secondary-tint-2{--pv-color-base:var(--pv-color-secondary-tint-2)}.c-secondary-tint-1{--pv-color-base:var(--pv-color-secondary-tint-1)}.c-secondary{--pv-color-base:var(--pv-color-secondary)}.c-secondary-shade-1{--pv-color-base:var(--pv-color-secondary-shade-1)}.c-secondary-shade-2{--pv-color-base:var(--pv-color-secondary-shade-2)}.c-secondary-shade-3{--pv-color-base:var(--pv-color-secondary-shade-3)}.c-secondary-shade-4{--pv-color-base:var(--pv-color-secondary-shade-4)}.c-secondary-shade-5{--pv-color-base:var(--pv-color-secondary-shade-5)}.c-secondary-contrast{--pv-color-base:var(--pv-color-secondary-contrast)}.c-wrong-tint-5{--pv-color-base:var(--pv-color-wrong-tint-5)}.c-wrong-tint-4{--pv-color-base:var(--pv-color-wrong-tint-4)}.c-wrong-tint-3{--pv-color-base:var(--pv-color-wrong-tint-3)}.c-wrong-tint-2{--pv-color-base:var(--pv-color-wrong-tint-2)}.c-wrong-tint-1{--pv-color-base:var(--pv-color-wrong-tint-1)}.c-wrong{--pv-color-base:var(--pv-color-wrong)}.c-wrong-shade-1{--pv-color-base:var(--pv-color-wrong-shade-1)}.c-wrong-shade-2{--pv-color-base:var(--pv-color-wrong-shade-2)}.c-wrong-shade-3{--pv-color-base:var(--pv-color-wrong-shade-3)}.c-wrong-shade-4{--pv-color-base:var(--pv-color-wrong-shade-4)}.c-wrong-shade-5{--pv-color-base:var(--pv-color-wrong-shade-5)}.c-wrong-contrast{--pv-color-base:var(--pv-color-wrong-contrast)}.c-attention-tint-5{--pv-color-base:var(--pv-color-attention-tint-5)}.c-attention-tint-4{--pv-color-base:var(--pv-color-attention-tint-4)}.c-attention-tint-3{--pv-color-base:var(--pv-color-attention-tint-3)}.c-attention-tint-2{--pv-color-base:var(--pv-color-attention-tint-2)}.c-attention-tint-1{--pv-color-base:var(--pv-color-attention-tint-1)}.c-attention{--pv-color-base:var(--pv-color-attention)}.c-attention-shade-1{--pv-color-base:var(--pv-color-attention-shade-1)}.c-attention-shade-2{--pv-color-base:var(--pv-color-attention-shade-2)}.c-attention-shade-3{--pv-color-base:var(--pv-color-attention-shade-3)}.c-attention-shade-4{--pv-color-base:var(--pv-color-attention-shade-4)}.c-attention-shade-5{--pv-color-base:var(--pv-color-attention-shade-5)}.c-success-tint-5{--pv-color-base:var(--pv-color-success-tint-5)}.c-success-tint-4{--pv-color-base:var(--pv-color-success-tint-4)}.c-success-tint-3{--pv-color-base:var(--pv-color-success-tint-3)}.c-success-tint-2{--pv-color-base:var(--pv-color-success-tint-2)}.c-success-tint-1{--pv-color-base:var(--pv-color-success-tint-1)}.c-success{--pv-color-base:var(--pv-color-success)}.c-success-shade-1{--pv-color-base:var(--pv-color-success-shade-1)}.c-success-shade-2{--pv-color-base:var(--pv-color-success-shade-2)}.c-success-shade-3{--pv-color-base:var(--pv-color-success-shade-3)}.c-success-shade-4{--pv-color-base:var(--pv-color-success-shade-4)}.c-success-shade-5{--pv-color-base:var(--pv-color-success-shade-5)}.c-black{--pv-color-base:var(--pv-color-black)}.c-gray-10{--pv-color-base:var(--pv-color-gray-10)}.c-gray-9{--pv-color-base:var(--pv-color-gray-9)}.c-gray-8{--pv-color-base:var(--pv-color-gray-8)}.c-gray-7{--pv-color-base:var(--pv-color-gray-7)}.c-gray-6{--pv-color-base:var(--pv-color-gray-6)}.c-gray-5{--pv-color-base:var(--pv-color-gray-5)}.c-gray-4{--pv-color-base:var(--pv-color-gray-4)}.c-gray-3{--pv-color-base:var(--pv-color-gray-3)}.c-gray-2{--pv-color-base:var(--pv-color-gray-2)}.c-gray-1{--pv-color-base:var(--pv-color-gray-1)}.c-white{--pv-color-base:var(--pv-color-white)}.c-extra-1{--pv-color-base:var(--pv-color-extra-1)}.c-extra-2{--pv-color-base:var(--pv-color-extra-2)}.typography{color:var(--pv-color-base)}.button{display:-ms-inline-flexbox;display:inline-flex;cursor:pointer;background:transparent;border:1px solid transparent;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;text-decoration:none;outline:none;font-family:inherit;border-radius:4px;height:var(--pv-size-base-7);min-width:var(--pv-size-base-7);padding:0 var(--pv-size-base-3);-webkit-transition:background-color 200ms ease 0s;transition:background-color 200ms ease 0s;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;gap:var(--pv-size-base);font-size:0;-webkit-transition:background-color 200ms ease 0s, color 200ms ease 0s, border-color 200ms ease 0s, -webkit-box-shadow 200ms ease 0s;transition:background-color 200ms ease 0s, color 200ms ease 0s, border-color 200ms ease 0s, -webkit-box-shadow 200ms ease 0s;transition:background-color 200ms ease 0s, color 200ms ease 0s, box-shadow 200ms ease 0s, border-color 200ms ease 0s;transition:background-color 200ms ease 0s, color 200ms ease 0s, box-shadow 200ms ease 0s, border-color 200ms ease 0s, -webkit-box-shadow 200ms ease 0s}.button_child_text{color:inherit}.button:disabled{pointer-events:none;-webkit-box-shadow:none;box-shadow:none}.button_default{color:var(--pv-color-secondary)}.button_default:hover{background-color:var(--pv-color-secondary-tint-5)}.button_default:focus-visible{background-color:var(--pv-color-secondary-tint-4)}.button_default:active{background-color:var(--pv-color-secondary-tint-3)}.button_default:disabled{color:var(--pv-color-gray-7)}.button_secondary{border-color:var(--pv-color-gray-8);color:var(--pv-color-black)}.button_secondary:hover{background-color:var(--pv-color-gray-3)}.button_secondary:focus-visible{background-color:var(--pv-color-gray-4)}.button_secondary:active{background-color:var(--pv-color-gray-5)}.button_secondary:disabled{color:var(--pv-color-gray-7);border-color:var(--pv-color-gray-4)}.button_primary{background-color:var(--pv-color-primary);color:var(--pv-color-primary-contrast);-webkit-box-shadow:var(--pv-shadow-light-low);box-shadow:var(--pv-shadow-light-low)}.button_primary:hover{background-color:var(--pv-color-primary-tint-1)}.button_primary:focus-visible{background-color:var(--pv-color-primary-tint-2)}.button_primary:active{background-color:var(--pv-color-primary-tint-2);-webkit-box-shadow:var(--pv-shadow-light-medium);box-shadow:var(--pv-shadow-light-medium)}.button_primary:disabled{color:var(--pv-color-gray-8);background-color:var(--pv-color-gray-4)}.button_text{color:var(--pv-color-base);text-decoration:none;background:transparent;display:-ms-inline-flexbox;display:inline-flex;border:none;cursor:pointer;-webkit-transition:opacity 200ms ease 0s;transition:opacity 200ms ease 0s}.button_text:hover{opacity:0.7}.layout{height:100%;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:var(--pv-color-white);border-radius:3px;overflow:hidden}.layout_main{-ms-flex:1 1 auto;flex:1 1 auto;overflow:auto;position:relative}.layout_footer{-ms-flex:0 0 auto;flex:0 0 auto;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;height:var(--pv-size-base-10);-ms-flex-align:center;align-items:center;padding:0px var(--pv-size-base-3);border-top:1px solid var(--pv-color-gray-5);gap:var(--pv-size-base-2);color:var(--pv-color-footer-text);background-color:var(--pv-color-footer)}.layout_footer_text{color:inherit}.mt_2{margin-top:var(--pv-size-base-2)}.mt_4{margin-top:var(--pv-size-base-4)}.mt_6{margin-top:var(--pv-size-base-6)}.container_status{height:100%;text-align:center;padding:var(--pv-size-base-12)}.container_status_logo{display:block;margin:0 auto var(--pv-size-base-6)}.container_status_illustration{margin-top:var(--pv-size-base-12);margin-bottom:var(--pv-size-base-10)}.container_status_actions{display:-ms-flexbox;display:flex;gap:var(--pv-size-base-2);-ms-flex-pack:center;justify-content:center}.container_status_authorization_number{height:var(--pv-size-base-8);width:var(--pv-size-base-6);border-radius:4px;border:1px solid var(--pv-color-gray-5);text-align:center;line-height:var(--pv-size-base-8)}.container_actions{display:-ms-flexbox;display:flex;gap:var(--pv-size-base-2)}[hidden]{display:none}:host{display:block;min-height:550px;height:550px}.enrollment_form{height:100%;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:hidden}.enrollment_form_header{padding:var(--pv-size-base-6) var(--pv-size-base-6) var(--pv-size-base-4)}.enrollment_form_content{-ms-flex:1 1 auto;flex:1 1 auto;overflow:auto;padding:0 var(--pv-size-base-6)}.enrollment_form_footer{padding:var(--pv-size-base-6);-ms-flex-pack:end;justify-content:flex-end}.enrollment_form_group{padding:var(--pv-size-base-6) 0}.enrollment_form_group:not(:first-child){border-top:1px solid var(--pv-color-gray-4)}.enrollment_form_group_fields{display:grid;grid-column-gap:var(--pv-size-base-2);grid-row-gap:var(--pv-size-base-2);grid-template-columns:repeat(3, minmax(100px, 1fr))}.enrollment_form_group_fields_usage{display:-ms-flexbox;display:flex;gap:var(--pv-size-base-4)}form.enrollment_form_content{border-top:1px solid var(--pv-color-gray-5);border-bottom:1px solid var(--pv-color-gray-5)}.form_field{width:100%;height:var(--pv-size-base-7);border-radius:4px;padding:0 var(--pv-size-base-2);color:var(--pv-color-black);outline:none;background-color:var(--pv-color-gray-1);border:1px solid var(--pv-color-gray-8);-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-transition:background-color 200ms ease 0s, color 200ms ease 0s, border-color 200ms ease 0s;transition:background-color 200ms ease 0s, color 200ms ease 0s, border-color 200ms ease 0s}.form_field::-webkit-input-placeholder{color:var(--pv-color-gray-9)}.form_field::-moz-placeholder{color:var(--pv-color-gray-9)}.form_field:-ms-input-placeholder{color:var(--pv-color-gray-9)}.form_field::-ms-input-placeholder{color:var(--pv-color-gray-9)}.form_field::placeholder{color:var(--pv-color-gray-9)}.form_field:hover{background-color:var(--pv-color-gray-3);border-color:var(--pv-color-gray-7)}.form_field:focus-visible{background-color:var(--pv-color-secondary-tint-5);border-color:var(--pv-color-secondary-tint-3)}.form_field:disabled{background-color:var(--pv-color-gray-1);border-color:var(--pv-color-gray-5);color:var(--pv-color-gray-7)}.form_field_container{position:relative;margin-top:3px}.form_field_icon_required{position:absolute;top:2px;right:2px;color:var(--pv-color-wrong)}.form_field_icon_arrow_down{position:absolute;right:0px;top:calc(50% - 12px);pointer-events:none;margin:0px var(--pv-size-base);color:var(--pv-color-gray-10)}.form_field_result{height:calc(100% - var(--pv-size-base));resize:none;margin:0;overflow:auto;padding:var(--pv-size-base-2)}select.form_field{padding-right:var(--pv-size-base-6)}.form_checkbox{width:100%;height:100%;margin:0px;padding:0px;outline:0px;border-radius:2px;-webkit-appearance:none;-moz-appearance:none;appearance:none;color:var(--pv-color-gray-9);border:2px solid currentcolor;background-color:transparent;cursor:pointer}.form_checkbox:checked{color:var(--pv-color-primary-shade-1);background-color:var(--pv-color-primary)}.form_checkbox:checked+[aria-hidden]{opacity:1}.form_checkbox_container{position:relative;width:var(--pv-size-base-4);height:var(--pv-size-base-4)}.form_checkbox_icon_check{display:block;position:absolute;top:0px;left:0px;width:100%;height:100%;opacity:0;color:var(--pv-color-white);pointer-events:none}.form_checkbox_root{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:var(--pv-size-base-2);text-transform:capitalize}";var H=U; /** * @license * Copyright (c) Peculiar Ventures, LLC. * * This source code is licensed under the BSD 3-Clause license found in the * LICENSE file in the root directory of this source tree. */var J=undefined&&undefined.__classPrivateFieldGet||function(e,a,o,r){if(o==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof a==="function"?e!==a||!r:!a.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return o==="m"?r:o==="a"?r.call(e):r?r.value:a.get(e)};var Z=undefined&&undefined.__classPrivateFieldSet||function(e,a,o,r,n){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof a==="function"?e!==a||!n:!a.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?n.call(e,o):n?n.value=o:a.set(e,o),o};var W;var Y=e("peculiar_fortify_enrollment",function(){function e(e){var a=this;o(this,e);this.creationCancel=r(this,"creationCancel",7);this.creationClose=r(this,"creationClose",7);this.creationSuccess=r(this,"creationSuccess",7);this.creationFail=r(this,"creationFail",7);W.set(this,void 0);this.debugEvents=[];this.handleDocumentKeydown=function(e){if(e.shiftKey&&e.code==="KeyR"){J(a,W,"f").options.filters={};a.tryGetData()}if(e.shiftKey&&e.code==="KeyD"){x(w.FromString(JSON.stringify(a.debugEvents,undefined,2)),"debug-fortify-wc.".concat(Date.now()),"json","text/json")}};this.handleClickCancel=function(){a.creationCancel.emit()};this.handleClickEnrollRerun=function(){a.deleteFetching("enroll");a.enrollResult=undefined;a.tryGetData()};this.handleClickClose=function(){a.creationClose.emit()};this.handleClickTryAgain=function(){return __awaiter(a,void 0,void 0,(function(){var e;return __generator(this,(function(a){switch(a.label){case 0:return[4,this.tryLogin()];case 1:e=a.sent();if(!e){return[2]}return[4,this.tryGetData()];case 2:a.sent();return[2]}}))}))};this.handleSubmit=function(e){return __awaiter(a,void 0,void 0,(function(){var a,o,r,n;return __generator(this,(function(i){switch(i.label){case 0:this.setFetching("enroll","pending");i.label=1;case 1:i.trys.push([1,6,,7]);a=new d(e.subjectName).toJSON();o="";r=void 0;a.forEach((function(e){if(!o&&e[t.CommonName]&&e[t.CommonName].length){o=e[t.CommonName][0]}}));if(!e.useSelfSignedCertificate)return[3,3];return[4,J(this,W,"f").createX509(e.providerId,e)];case 2:r=i.sent();return[3,5];case 3:return[4,J(this,W,"f").createPKCS10(e.providerId,e)];case 4:r=i.sent();i.label=5;case 5:this.enrollResult={pem:r.pem,name:o,type:e.useSelfSignedCertificate?"x509":"pkcs10"};this.setFetching("enroll","resolved");this.creationSuccess.emit({providerId:e.providerId,raw:r.der,privateKey:r.privateKey,publicKey:r.publicKey,socketProvider:J(this,W,"f").server});return[3,7];case 6:n=i.sent();this.setFetching("enroll","rejected");this.creationFail.emit(n);return[3,7];case 7:return[2]}}))}))};this.language=undefined;this.downloadAppLink="https://fortifyapp.com";this.helpPageLink="https://fortifyapp.com/help";this.hideFooter=false;this.filters={};this.formPolicy=undefined;this.providers=[];this.challenge=undefined;this.isFetching={connectionDetect:"pending"};this.enrollResult=undefined}e.prototype.componentWillLoad=function(){k.setLocale(this.language);this.formPolicy=this.formPolicy||j()};e.prototype.componentDidLoad=function(){var e=this;Z(this,W,new v({onDebug:function(a){e.debugEvents.push(a)},onClose:this.handleCloseConnection.bind(this),onProvidersAdded:this.tryGetData.bind(this),onProvidersRemoved:this.tryGetData.bind(this),filters:this.filters}),"f");this.start();document.addEventListener("keydown",this.handleDocumentKeydown)};e.prototype.disconnectedCallback=function(){J(this,W,"f").finish();document.removeEventListener("keydown",this.handleDocumentKeydown)};e.prototype.handleCloseConnection=function(){this.providers=[];this.setFetching("connectionDetect","rejected")};e.prototype.start=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(a){switch(a.label){case 0:this.setFetching("connectionDetect","pending");if(!J(this,W,"f").isConnectionSupported()){this.setFetching("connectionSupport","rejected");return[2]}return[4,J(this,W,"f").isConnectionDetected()];case 1:if(!a.sent()){this.setFetching("connectionDetect","rejected")}return[4,J(this,W,"f").isConnectionDetectedAuto()];case 2:a.sent();this.setFetching("connectionDetect","pending");return[4,J(this,W,"f").connect()];case 3:a.sent();return[4,this.tryLogin()];case 4:e=a.sent();if(!e){return[2]}return[4,this.tryGetData()];case 5:a.sent();return[2]}}))}))};e.prototype.tryGetData=function(){return __awaiter(this,void 0,void 0,(function(){var e,a;return __generator(this,(function(o){switch(o.label){case 0:this.setFetching("providers","pending");this.providers=[];o.label=1;case 1:o.trys.push([1,3,,4]);e=this;return[4,J(this,W,"f").getProviders()];case 2:e.providers=o.sent();this.setFetching("providers","resolved");return[3,4];case 3:a=o.sent();this.setFetching("providers","rejected");return[3,4];case 4:return[2]}}))}))};e.prototype.tryLogin=function(){return __awaiter(this,void 0,void 0,(function(){var e,a;return __generator(this,(function(o){switch(o.label){case 0:this.challenge=undefined;this.setFetching("connectionApprove","pending");o.label=1;case 1:o.trys.push([1,5,,6]);return[4,J(this,W,"f").challenge()];case 2:e=o.sent();if(!e)return[3,4];this.challenge=e;return[4,J(this,W,"f").login()];case 3:o.sent();o.label=4;case 4:this.setFetching("connectionApprove","resolved");return[3,6];case 5:a=o.sent();this.setFetching("connectionApprove","rejected");return[2,undefined];case 6:return[2,true]}}))}))};e.prototype.setFetching=function(e,a){var o;this.isFetching=Object.assign(Object.assign({},this.isFetching),(o={},o[e]=a,o))};e.prototype.deleteFetching=function(e){var a;this.isFetching=Object.assign(Object.assign({},this.isFetching),(a={},a[e]=undefined,a))};e.renderConnecting=function(){return a(m,null)};e.renderFortifyAuthorization=function(e){return a(u,{pin:e})};e.prototype.renderFortifyNotDetected=function(){return a(h,{downloadAppLink:this.downloadAppLink})};e.prototype.renderFortifyNotSupported=function(){return a(f,{onCancel:this.handleClickCancel})};e.prototype.renderChallengeNotApproved=function(){return a(b,{onCancel:this.handleClickCancel,onTryAgain:this.handleClickTryAgain})};e.prototype.renderProvidersEmpty=function(){return a(g,{onCancel:this.handleClickCancel,helpPageLink:this.helpPageLink})};e.prototype.renderEnrollForm=function(){return a(q,{providers:this.providers,formPolicy:this.formPolicy,onSubmit:this.handleSubmit,onCancel:this.handleClickCancel})};e.prototype.renderEnrollResolved=function(){return a(O,{type:this.enrollResult.type,pem:this.enrollResult.pem,name:this.enrollResult.name,onClose:this.handleClickClose})};e.prototype.renderEnrollRejected=function(){return a(A,{onCancel:this.handleClickCancel,onAccept:this.handleClickEnrollRerun})};e.renderUnresolvedStatus=function(){return a(l,{title:"Someting went wrong for status",description:"ERROR"})};e.prototype.render=function(){var e=null;switch(true){case this.isFetching.connectionSupport==="rejected":e=this.renderFortifyNotSupported();break;case this.isFetching.connectionDetect==="rejected":e=this.renderFortifyNotDetected();break;case this.isFetching.connectionApprove==="rejected":e=this.renderChallengeNotApproved();break;case this.isFetching.connectionApprove==="pending"&&!!this.challenge:e=Y.renderFortifyAuthorization(this.challenge);break;case this.isFetching.enroll==="pending":e=Y.renderConnecting();break;case this.isFetching.enroll==="rejected":e=this.renderEnrollRejected();break;case this.isFetching.enroll==="resolved":e=this.renderEnrollResolved();break;case this.isFetching.providers==="resolved"&&!this.providers.length:e=this.renderProvidersEmpty();break;case this.isFetching.providers==="resolved":e=this.renderEnrollForm();break;case this.isFetching.connectionDetect==="pending":case this.isFetching.connectionSupport==="pending":case this.isFetching.connectionApprove==="pending":case this.isFetching.providers==="pending":e=Y.renderConnecting();break;default:e=Y.renderUnresolvedStatus()}return a(n,{key:"61480d70163ec440ce93745c124b1f74e0dc10dd"},a(p,{key:"211d16e679d77909878565a95765f5e85c8eb66c",hideFooter:this.hideFooter},e))};return e}());W=new WeakMap;Y.style=H}}})); //# sourceMappingURL=p-0b9cbaa9.system.entry.js.map