"use strict";(self.webpackChunkhws_app_captain_password=self.webpackChunkhws_app_captain_password||[]).push([[378],{600:(e,n,s)=>{s.d(n,{A:()=>w,H:()=>P});var t=s(4848),o=s(6782),a=s.n(o),r=s(3863),i=s(5678),d=function(e,n,s,t){return new(s||(s=Promise))(function(o,a){function r(e){try{d(t.next(e))}catch(e){a(e)}}function i(e){try{d(t.throw(e))}catch(e){a(e)}}function d(e){var n;e.done?o(e.value):(n=e.value,n instanceof s?n:new s(function(e){e(n)})).then(r,i)}d((t=t.apply(e,n||[])).next())})};const l=a().lazy(()=>s.e(295).then(s.t.bind(s,5295,23))),c={passwords:[],isLoading:!0,refreshPasswords:()=>d(void 0,void 0,void 0,function*(){})},P=(0,o.createContext)(c),w=function({children:e}){const[n,a]=(0,o.useState)([]),[c,w]=(0,o.useState)(!0),p=e=>{var n,s,t;return null!==(t=null===(s=null===(n=null===window||void 0===window?void 0:window.HWS)||void 0===n?void 0:n.I18n)||void 0===s?void 0:s.t(e))&&void 0!==t?t:e},u=()=>d(this,void 0,void 0,function*(){w(!0);try{const{runAction:e}=yield s.e(479).then(s.t.bind(s,4479,23)),n=yield e(i.a.GetPasswords.action,{});n.Success?a(n.Data):a([])}catch(e){a([])}finally{w(!1)}});(0,o.useEffect)(()=>{var e;const n=null===(e=null===window||void 0===window?void 0:window.HWS)||void 0===e?void 0:e.Navigation;n&&r.A&&(n.removeAll(),n.toggleNavbarDisplay(!0),r.A.forEach(e=>{n.prepend(Object.assign(Object.assign({},e),{translate:p(e.translate)}))})),u()},[]);const S=(0,o.useMemo)(()=>({passwords:n,isLoading:c,refreshPasswords:u}),[n,c]);return(0,t.jsx)(P.Provider,Object.assign({value:S},{children:c?(0,t.jsx)(l,{}):e}))}},3863:(e,n,s)=>{s.d(n,{A:()=>t});const t=[{id:"generate-password",title:"Generate Password",type:"item",url:"/app/captain-password/generate-password",icon:"widgets",translate:"GENERATE_PASSWORD"},{id:"passwords",title:"Passwords",type:"item",url:"/app/captain-password/passwords",icon:"widgets",translate:"PASSWORDS"}]},5678:(e,n,s)=>{s.d(n,{a:()=>t});const t={CreatePassword:{action:"HWS_APP_CAPTAIN_PASSWORD_CREATE_PASSWORD",description:"Create Password",inputInterface:"interface CreatePasswordRequest {\n    Name: string;\n    Login: string;\n    Url: string;\n    Password: string;\n    Folder?: string | null;\n    Note?: string | null\n    }",example:{Name:"Password Name",Login:"Login",Url:"Url",Password:"Password",Folder:"Folder",Note:"Note"}},UpdatePassword:{action:"HWS_APP_CAPTAIN_PASSWORD_UPDATE_PASSWORD",description:"Update Password",inputInterface:"interface UpdatePasswordRequest {\n    Id: string;\n    Name: string;\n    Login: string;\n    Url: string;\n    Password: string;\n    Folder?: string | null;\n    Note?: string | null\n    }",example:{Id:"Password Id",Name:"Password Name",Login:"Login",Url:"Url",Password:"Password",Folder:"Folder",Note:"Note"}},DeletePassword:{action:"HWS_APP_CAPTAIN_PASSWORD_DELETE_PASSWORD",description:"Delete Password",inputInterface:"interface DeletePasswordRequest {\n    Id: string;\n    }",example:{Id:"Password Id"}},GetPasswordById:{action:"HWS_APP_CAPTAIN_PASSWORD_GET_PASSWORD_BY_ID",description:"Get Password By Id",inputInterface:"interface GetPasswordByIdRequest {\n    Id: string;\n    }",example:{Id:"Password Id"}},GetPasswords:{action:"HWS_APP_CAPTAIN_PASSWORD_GET_PASSWORDS",description:"Get Passwords",inputInterface:"interface GetPasswordsRequest {\n    FilterText: string;\n    SelectSettings: any;\n    }",example:{FilterText:"Filter Text",SelectSettings:{PageSize:10,Page:1}}},DeletePasswords:{action:"HWS_APP_CAPTAIN_PASSWORD_DELETE_PASSWORDS",description:"Delete Passwords",inputInterface:"interface DeletePasswordsRequest {\n    Ids: string[];\n    }",example:{Ids:["Password Id 1","Password Id 2"]}},Export:{action:"HWS_APP_CAPTAIN_PASSWORD_EXPORT",description:"Export Passwords",inputInterface:"interface ExportPasswordsRequest {\n      Type: string;\n      Id?: string | null;\n    }",example:{Type:"Google"}},Import:{action:"HWS_APP_CAPTAIN_PASSWORD_IMPORT",description:"Import Passwords",inputInterface:"interface ImportPasswordsRequest {\n      Type: string;\n      Id?: string | null;\n    }",example:{Type:"Google"}}}},8378:(e,n,s)=>{s.r(n),s.d(n,{default:()=>c});var t=s(4848),o=s(2943),a=s(6782),r=s.n(a),i=s(3863),d=s(600);const l=r().lazy(()=>s.e(596).then(s.t.bind(s,8596,23))),c=function(){const e=(0,o.useNavigate)(),n=(0,o.useLocation)(),[s,r]=(0,a.useState)(null);return(0,a.useEffect)(()=>{var e,n,s;const t=(null!==(s=null===(n=null===(e=null===window||void 0===window?void 0:window.HWS)||void 0===e?void 0:e.Home)||void 0===n?void 0:n.getComponents())&&void 0!==s?s:[]).find(e=>{var n;return"captain-password"===(null===(n=null==e?void 0:e.Info)||void 0===n?void 0:n.Slug)});r(!0===(null==t?void 0:t.Allowed))},[]),(0,a.useEffect)(()=>{if("/app/captain-password"===n.pathname){const n=i.A[i.A.length-1];(null==n?void 0:n.url)&&e(n.url,{replace:!0})}},[n.pathname,e]),0==s?(0,t.jsx)(l,{}):(0,t.jsx)(d.A,{children:(0,t.jsx)(o.Outlet,{})})}}}]);