@nocobase/plugin-auth 2.1.0-beta.22 → 2.1.0-beta.24
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/client-v2.d.ts +2 -0
- package/client-v2.js +1 -0
- package/dist/client/index.js +1 -1
- package/dist/client-v2/authenticator.d.ts +19 -0
- package/dist/client-v2/components/PoweredByLite.d.ts +10 -0
- package/dist/client-v2/components/SwitchLanguage.d.ts +10 -0
- package/dist/client-v2/forms/BasicSignInForm.d.ts +13 -0
- package/dist/client-v2/forms/BasicSignUpForm.d.ts +14 -0
- package/dist/client-v2/hooks.d.ts +13 -0
- package/dist/client-v2/index.d.ts +20 -0
- package/dist/client-v2/index.js +10 -0
- package/dist/client-v2/locale.d.ts +180 -0
- package/dist/client-v2/pages/AuthLayout.d.ts +10 -0
- package/dist/client-v2/pages/ForgotPasswordPage.d.ts +10 -0
- package/dist/client-v2/pages/ResetPasswordPage.d.ts +10 -0
- package/dist/client-v2/pages/SignInPage.d.ts +19 -0
- package/dist/client-v2/pages/SignUpPage.d.ts +12 -0
- package/dist/client-v2/plugin.d.ts +34 -0
- package/dist/client-v2/providers/AuthProvider.d.ts +11 -0
- package/dist/client-v2/providers/AuthenticatorsContextProvider.d.ts +11 -0
- package/dist/externalVersion.js +11 -10
- package/dist/node_modules/cron/package.json +1 -1
- package/dist/node_modules/ms/package.json +1 -1
- package/package.json +3 -2
package/client-v2.d.ts
ADDED
package/client-v2.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./dist/client-v2/index.js');
|
package/dist/client/index.js
CHANGED
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react-i18next"),require("@emotion/css"),require("react-router-dom"),require("@formily/antd-v5"),require("@formily/react"),require("@ant-design/icons"),require("@formily/shared"),require("react"),require("antd"),require("@nocobase/client"),require("@formily/core"),require("@nocobase/utils/client")):"function"==typeof define&&define.amd?define("@nocobase/plugin-auth",["react-i18next","@emotion/css","react-router-dom","@formily/antd-v5","@formily/react","@ant-design/icons","@formily/shared","react","antd","@nocobase/client","@formily/core","@nocobase/utils/client"],t):"object"==typeof exports?exports["@nocobase/plugin-auth"]=t(require("react-i18next"),require("@emotion/css"),require("react-router-dom"),require("@formily/antd-v5"),require("@formily/react"),require("@ant-design/icons"),require("@formily/shared"),require("react"),require("antd"),require("@nocobase/client"),require("@formily/core"),require("@nocobase/utils/client")):e["@nocobase/plugin-auth"]=t(e["react-i18next"],e["@emotion/css"],e["react-router-dom"],e["@formily/antd-v5"],e["@formily/react"],e["@ant-design/icons"],e["@formily/shared"],e.react,e.antd,e["@nocobase/client"],e["@formily/core"],e["@nocobase/utils/client"])}(self,function(e,t,n,r,o,i,a,u,c,l,s,p){return function(){var f,d,m,y={432:function(e,t,n){e.exports=n(36).Symbol},77:function(e,t,n){var r=n(432),o=n(444),i=n(371),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?o(e):i(e)}},625:function(e,t,n){var r=n(531),o=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(o,""):e}},565:function(e,t,n){e.exports="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g},444:function(e,t,n){var r=n(432),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,u=r?r.toStringTag:void 0;e.exports=function(e){var t=i.call(e,u),n=e[u];try{e[u]=void 0;var r=!0}catch(e){}var o=a.call(e);return r&&(t?e[u]=n:delete e[u]),o}},371:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},36:function(e,t,n){var r=n(565),o="object"==typeof self&&self&&self.Object===Object&&self;e.exports=r||o||Function("return this")()},531:function(e){var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},738:function(e,t,n){var r=n(130),o=n(593),i=n(909),a=Math.max,u=Math.min;e.exports=function(e,t,n){var c,l,s,p,f,d,m=0,y=!1,v=!1,b=!0;if("function"!=typeof e)throw TypeError("Expected a function");function h(t){var n=c,r=l;return c=l=void 0,m=t,p=e.apply(r,n)}function g(e){var n=e-d,r=e-m;return void 0===d||n>=t||n<0||v&&r>=s}function x(){var e,n,r,i=o();if(g(i))return w(i);f=setTimeout(x,(e=i-d,n=i-m,r=t-e,v?u(r,s-n):r))}function w(e){return(f=void 0,b&&c)?h(e):(c=l=void 0,p)}function S(){var e,n=o(),r=g(n);if(c=arguments,l=this,d=n,r){if(void 0===f)return m=e=d,f=setTimeout(x,t),y?h(e):p;if(v)return clearTimeout(f),f=setTimeout(x,t),h(d)}return void 0===f&&(f=setTimeout(x,t)),p}return t=i(t)||0,r(n)&&(y=!!n.leading,s=(v="maxWait"in n)?a(i(n.maxWait)||0,t):s,b="trailing"in n?!!n.trailing:b),S.cancel=function(){void 0!==f&&clearTimeout(f),m=0,c=d=l=f=void 0},S.flush=function(){return void 0===f?p:w(o())},S}},130:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},189:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},733:function(e,t,n){var r=n(77),o=n(189);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},593:function(e,t,n){var r=n(36);e.exports=function(){return r.Date.now()}},909:function(e,t,n){var r=n(625),o=n(130),i=n(733),a=0/0,u=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,l=/^0o[0-7]+$/i,s=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(i(e))return a;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=c.test(e);return n||l.test(e)?s(e.slice(2),n?2:8):u.test(e)?a:+e}},574:function(e,t,n){"use strict";n.r(t),n.d(t,{AuthLayout:function(){return z},default:function(){return G},useRedirect:function(){return i.useRedirect},PluginAuthClient:function(){return H},AuthenticatorsContext:function(){return v.m},useAuthenticator:function(){return v.p},AuthenticatorsContextProvider:function(){return K},useSignIn:function(){return i.useSignIn}});var r=n(342),o=n(768),i=n(751),a=n(738),u=n.n(a),c={EMPTY_TOKEN:"EMPTY_TOKEN",EXPIRED_TOKEN:"EXPIRED_TOKEN",INVALID_TOKEN:"INVALID_TOKEN",TOKEN_RENEW_FAILED:"TOKEN_RENEW_FAILED",BLOCKED_TOKEN:"BLOCKED_TOKEN",EXPIRED_SESSION:"EXPIRED_SESSION",NOT_EXIST_USER:"NOT_EXIST_USER",SKIP_TOKEN_RENEW:"SKIP_TOKEN_RENEW",USER_HAS_NO_ROLES_ERR:"USER_HAS_NO_ROLES_ERR"},l=u()(function(e){e()},3e3,{leading:!0,trailing:!1}),s=n(872),p=n(230),f=n(155),d=n.n(f),m=n(59),y=n(442),v=n(706);function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function h(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){n(e);return}u.done?t(c):Promise.resolve(c).then(r,o)}function g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){u=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var x=function(){var e,t=(0,s.dE)().t,n=g((0,y.useSearchParams)(),1)[0].get("name"),o=(0,v.p)(n);return(null==o||null==(e=o.options)?void 0:e.enableResetPassword)?d().createElement(r.SchemaComponent,{schema:{type:"object",name:"forgotPasswordForm","x-component":"FormV2",properties:{email:{type:"string","x-component":"Input",title:'{{t("Reset password")}}',required:!0,"x-validator":"{{(value) => {\n if (!value) {\n return '';\n }\n if (!/^[\\w-]+(\\.[\\w-]+)*@[\\w-]+(\\.[\\w-]+)+$/.test(value)) {\n return t(\"Please enter a valid email\");\n }\n }}}","x-decorator":"FormItem","x-component-props":{placeholder:'{{t("Please enter your email")}}',style:{}}},actions:{type:"void","x-component":"div",properties:{submit:{title:'{{t("Send reset email")}}',type:"void","x-component":"Action","x-component-props":{htmlType:"submit",block:!0,type:"primary",useAction:function(){var e=(0,p.useForm)(),t=(0,r.useAPIClient)(),n=(0,s.dE)().t,o=g(d().useState(!1),2),i=o[0],a=o[1];return{run:function(){var r;return(r=function(){return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:c(0)}),u(a,"throw",{value:c(1)}),u(a,"return",{value:c(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function c(u){return function(c){var l=[u,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(r){switch(r.label){case 0:return[4,e.submit()];case 1:r.sent(),a(!0),r.label=2;case 2:return r.trys.push([2,,4,5]),[4,t.auth.lostPassword(e.values)];case 3:return r.sent(),[3,5];case 4:return a(!1),[7];case 5:return m.message.success(n("Reset email sent successfully")),e.reset(),[2]}})},function(){var e=this,t=arguments;return new Promise(function(n,o){var i=r.apply(e,t);function a(e){h(i,n,o,a,u,"next",e)}function u(e){h(i,n,o,a,u,"throw",e)}a(void 0)})})()},loading:i}}}}}},signUp:{type:"void","x-component":"Link","x-component-props":{to:"/signin"},"x-content":'{{t("Back to login")}}'}}},scope:{t:t}}):d().createElement(y.Navigate,{to:"/not-found",replace:!0})};function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function S(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){n(e);return}u.done?t(c):Promise.resolve(c).then(r,o)}function P(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){u=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return w(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return w(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var O=function(){var e,t=(0,s.dE)().t,n=(0,r.useAPIClient)(),o=P((0,y.useSearchParams)(),1)[0],i=o.get("resetToken"),a=(0,r.useNavigateNoUpdate)(),u=P(d().useState(!1),2),c=u[0],l=u[1],b=o.get("name"),h=(0,v.p)(b);return((0,f.useEffect)(function(){n.auth.checkResetToken({resetToken:i}).then(function(){l(!1)}).catch(function(e){l(!0)})},[]),null==h||null==(e=h.options)?void 0:e.enableResetPassword)?!i||c?d().createElement(m.Result,{status:"403",title:t("Reset link has expired"),extra:d().createElement(m.Button,{type:"primary",onClick:function(){return a("/signin")}},t("Go to login"))}):d().createElement(r.SchemaComponent,{schema:{type:"object",name:"resetPasswordForm","x-component":"FormV2",properties:{password:{type:"string","x-component":"Password",title:'{{t("New password")}}',required:!0,"x-decorator":"FormItem","x-component-props":{placeholder:'{{t("Please enter new password")}}'}},confirmPassword:{type:"string","x-component":"Password",title:'{{t("Confirm password")}}',required:!0,"x-decorator":"FormItem","x-component-props":{placeholder:'{{t("Please enter the same password again")}}'},"x-validator":"{{(value, rules, {form}) => {\n if (!value) {\n return '';\n }\n if (value !== form.values.password) {\n return t(\"The passwords entered twice are inconsistent\");\n }\n }}}"},actions:{type:"void","x-component":"div",properties:{submit:{title:'{{t("Confirm")}}',type:"void","x-component":"Action","x-component-props":{htmlType:"submit",block:!0,type:"primary",useAction:function(){var e=(0,p.useForm)(),t=(0,r.useAPIClient)(),n=(0,s.dE)().t,o=new URLSearchParams(window.location.search).get("resetToken"),i=P(d().useState(!1),2),a=i[0],u=i[1];return{run:function(){var r;return(r=function(){return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:c(0)}),u(a,"throw",{value:c(1)}),u(a,"return",{value:c(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function c(u){return function(c){var l=[u,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(r){switch(r.label){case 0:return[4,e.submit()];case 1:r.sent(),u(!0),r.label=2;case 2:var i,a;return r.trys.push([2,,4,5]),[4,t.auth.resetPassword((i=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},e.values),a=a={resetToken:o},Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(a)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(a)).forEach(function(e){Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(a,e))}),i))];case 3:return r.sent(),[3,5];case 4:return u(!1),[7];case 5:return m.message.success(n("Password reset successful")),setTimeout(function(){window.location.href="/signin"},1e3),[2]}})},function(){var e=this,t=arguments;return new Promise(function(n,o){var i=r.apply(e,t);function a(e){S(i,n,o,a,u,"next",e)}function u(e){S(i,n,o,a,u,"throw",e)}a(void 0)})})()},loading:a}}}}}},signUp:{type:"void","x-component":"Link","x-component-props":{to:"/signin"},"x-content":'{{t("Go to login")}}'}}},scope:{t:t}}):d().createElement(y.Navigate,{to:"/not-found",replace:!0})};function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function j(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){n(e);return}u.done?t(c):Promise.resolve(c).then(r,o)}function T(e,t,n){return(T=C()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&k(o,n.prototype),o}).apply(null,arguments)}function A(e){return(A=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function k(e,t){return(k=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function I(e){var t="function"==typeof Map?new Map:void 0;return(I=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return T(e,arguments,A(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),k(n,e)})(e)}function C(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(C=function(){return!!e})()}var F=(0,r.lazy)(function(){return n.e("443").then(n.bind(n,862))},"AuthProvider").AuthProvider,R=(0,r.lazy)(function(){return Promise.resolve().then(n.bind(n,751))},"Options","SignInForm","SignUpForm"),_=R.Options,N=R.SignInForm,U=R.SignUpForm,$=(0,r.lazy)(function(){return Promise.resolve().then(n.bind(n,350))},"AuthLayout","SignInPage","SignUpPage"),q=$.AuthLayout,L=$.SignInPage,M=$.SignUpPage,D=(0,r.lazy)(function(){return n.e("611").then(n.bind(n,718))},"Authenticator").Authenticator,V=(0,r.lazy)(function(){return n.e("680").then(n.bind(n,971))},"TokenPolicySettings").TokenPolicySettings,B=(0,r.lazy)(function(){return Promise.resolve().then(n.bind(n,350))},"AuthenticatorsContextProvider","AuthLayout"),K=B.AuthenticatorsContextProvider,z=B.AuthLayout,H=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t,r,i,a,u;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return t=n,r=arguments,t=A(t),i=e=function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,C()?Reflect.construct(t,r||[],A(this).constructor):t.apply(this,r)),a="authTypes",u=new o.Registry,a in i?Object.defineProperty(i,a,{value:u,enumerable:!0,configurable:!0,writable:!0}):i[a]=u,e}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&k(n,e),t=[{key:"registerType",value:function(e,t){this.authTypes.register(e,t)}},{key:"load",value:function(){var e;return(e=function(){var e,t,n;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:c(0)}),u(a,"throw",{value:c(1)}),u(a,"return",{value:c(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function c(u){return function(c){var l=[u,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(r){var o,i;return this.app.pluginSettingsManager.add(s.CU,{icon:"LoginOutlined",title:'{{t("Authentication", { ns: "'.concat(s.CU,'" })}}'),aclSnippet:"pm.auth"}),this.app.pluginSettingsManager.add("auth.authenticators",{icon:"LoginOutlined",title:'{{t("Authenticators", { ns: "'.concat(s.CU,'" })}}'),Component:D,aclSnippet:"pm.auth.authenticators",sort:1}),this.router.add("auth",{Component:"AuthLayout"}),this.router.add("auth.signin",{path:"/signin",Component:"SignInPage"}),this.router.add("auth.signup",{path:"/signup",Component:"SignUpPage"}),this.router.add("auth.forgotPassword",{path:"/forgot-password",Component:"ForgotPasswordPage"}),this.router.add("auth.resetPassword",{path:"/reset-password",Component:"ResetPasswordPage"}),this.app.addComponents({AuthLayout:q,SignInPage:L,SignUpPage:M,ForgotPasswordPage:x,ResetPasswordPage:O}),this.app.providers.unshift([F,{}]),this.registerType("Email/Password",{components:{SignInForm:N,SignUpForm:U,AdminSettingsForm:_}}),this.app.pluginSettingsManager.add("security.token-policy",{title:'{{t("Token policy", { ns: "'.concat(s.CU,'" })}}'),Component:V,aclSnippet:"pm.security.token-policy",icon:"ApiOutlined",sort:0}),t=(e=function(e){if(Array.isArray(e))return e}(((o=({app:this.app}).app).apiClient.axios,i=[function(e){var t,n=null==e||null==(t=e.headers)?void 0:t["x-new-token"];return n&&o.apiClient.auth.setToken(n),e},function(e){var t,n,r,i,a,u=null==e||null==(n=e.response)||null==(t=n.headers)?void 0:t["x-new-token"],s=null==e||null==(i=e.response)||null==(r=i.data)?void 0:r.errors,p=Array.isArray(s)?s[0]:null,f=o.router.state.location,d=f.pathname,m=f.search,y=o.router.basename;if(u&&o.apiClient.auth.setToken(u),401===e.status&&(null==p?void 0:p.code)&&c[p.code]&&(o.apiClient.auth.setToken(""),d===o.getHref("signin")&&(null==p?void 0:p.code)!==c.EMPTY_TOKEN&&e.config&&(e.config.skipNotify=!1),(null==p?void 0:p.code)==="USER_HAS_NO_ROLES_ERR"&&(e.config.skipNotify=!0,o.error=p)),401===e.status&&!(null==(a=e.config)?void 0:a.skipAuth)&&(null==p?void 0:p.code)&&c[p.code]){if(!p||(null==p?void 0:p.code)===c.SKIP_TOKEN_RENEW)throw e;var v=o.router.isSkippedAuthCheckRoute(d);if(v&&(e.config.skipNotify=!0),d!==o.getHref("signin")&&!v){var b,h,g=(b=y.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),h=new RegExp("^".concat(b.replace(/\/?$/,""),"(\\/|$)")),d.replace(h,"/")||d);l(function(){o.apiClient.auth.setToken(null),o.router.navigate("/signin?redirect=".concat(g).concat(m),{replace:!0})})}}throw e}]))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(i)||function(e){if(e){if("string"==typeof e)return E(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return E(e,2)}}(i)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0],n=e[1],this.app.apiClient.axios.interceptors.response.handlers.unshift({fulfilled:t,rejected:n,synchronous:!1,runWhen:null}),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){j(i,r,o,a,u,"next",e)}function u(e){j(i,r,o,a,u,"throw",e)}a(void 0)})}).call(this)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,t),n}(I(r.Plugin)),G=H},706:function(e,t,n){"use strict";n.d(t,{m:function(){return o},p:function(){return i}});var r=n(155),o=(0,r.createContext)([]);o.displayName="AuthenticatorsContext";var i=function(e){return(0,r.useContext)(o).find(function(t){return t.name===e})}},751:function(e,t,n){"use strict";n.r(t),n.d(t,{Options:function(){return R},SignInForm:function(){return y},SignUpForm:function(){return O},useRedirect:function(){return f},useSignUp:function(){return P},useSignIn:function(){return d}});var r=n(342),o=n(155),i=n.n(o),a=n(872),u=n(350),c=n(442),l=n(230);function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function p(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){n(e);return}u.done?t(c):Promise.resolve(c).then(r,o)}function f(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/admin",n=(0,c.useNavigate)(),r=(function(e){if(Array.isArray(e))return e}(e=(0,c.useSearchParams)())||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),1!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(e)||function(e){if(e){if("string"==typeof e)return s(e,1);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return s(e,1)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0];return(0,o.useCallback)(function(){n(r.get("redirect")||t,{replace:!0})},[n,t,r])}var d=function(e){var t=(0,l.useForm)(),n=(0,r.useAPIClient)(),o=f(),i=(0,r.useCurrentUserContext)().refreshAsync;return{run:function(){var r;return(r=function(){return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:c(0)}),u(a,"throw",{value:c(1)}),u(a,"return",{value:c(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function c(u){return function(c){var l=[u,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(r){switch(r.label){case 0:return[4,t.submit()];case 1:return r.sent(),[4,n.auth.signIn(t.values,e)];case 2:return r.sent(),[4,i()];case 3:return r.sent(),o(),[2]}})},function(){var e=this,t=arguments;return new Promise(function(n,o){var i=r.apply(e,t);function a(e){p(i,n,o,a,u,"next",e)}function u(e){p(i,n,o,a,u,"throw",e)}a(void 0)})})()}}},m=function(e){var t=e.showForgotPassword;return{type:"object",name:"passwordForm","x-component":"FormV2",properties:{account:{type:"string","x-component":"Input","x-validator":'{{(value) => {\n if (!value) {\n return t("Please enter your username or email");\n }\n if (value.includes(\'@\')) {\n if (!/^[\\w-]+(\\.[\\w-]+)*@[\\w-]+(\\.[\\w-]+)+$/.test(value)) {\n return t("Please enter a valid email");\n }\n } else {\n return /^[^@<>"\'/]{1,50}$/.test(value) || t("Please enter a valid username");\n }\n }}}',"x-decorator":"FormItem","x-component-props":{placeholder:'{{t("Username/Email")}}',style:{}}},password:{type:"string","x-component":"Password",required:!0,"x-decorator":"FormItem","x-component-props":{placeholder:'{{t("Password")}}',style:{},showForgotPassword:t}},actions:{type:"void","x-component":"div",properties:{submit:{title:'{{t("Sign in")}}',type:"void","x-component":"Action","x-component-props":{htmlType:"submit",block:!0,type:"primary",useAction:"{{ useBasicSignIn }}",style:{width:"100%"}}}}},links:{type:"void","x-component":"div","x-component-props":{style:{display:"flex",justifyContent:"space-between"}},properties:{signUp:{type:"void","x-component":"Link","x-component-props":{to:"{{ signUpLink }}"},"x-content":'{{t("Create an account")}}',"x-visible":"{{ allowSignUp }}"},forgotPassword:{type:"void","x-component":"Link","x-component-props":{to:'{{"/forgot-password?name=" + authenticator.name}}'},"x-content":'{{t("Forgot password")}}',"x-visible":t}}}}}},y=function(e){var t=(0,a.dE)().t,n=e.authenticator,o=n.authType,c=n.name,l=n.options,s=!!(0,u.useSignUpForms)()[o]&&null!=l&&!!l.allowSignUp,p="/signup?name=".concat(c);return i().createElement(r.SchemaComponent,{schema:m({showForgotPassword:!!(null==l?void 0:l.enableResetPassword)}),scope:{useBasicSignIn:function(){return d(c)},allowSignUp:s,signUpLink:p,t:t,authenticator:n}})},v=n(166),b=n(59),h=n(953),g=n(706);function x(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){n(e);return}u.done?t(c):Promise.resolve(c).then(r,o)}function w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function S(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}var P=function(e){var t=(0,c.useNavigate)(),n=(0,l.useForm)(),o=(0,r.useAPIClient)(),i=(0,h.useTranslation)().t;return{run:function(){var r;return(r=function(){var r;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:c(0)}),u(a,"throw",{value:c(1)}),u(a,"return",{value:c(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function c(u){return function(c){var l=[u,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(a){switch(a.label){case 0:return[4,n.submit()];case 1:return a.sent(),[4,o.auth.signUp(n.values,null==e?void 0:e.authenticator)];case 2:return a.sent(),b.message.success((null==e||null==(r=e.message)?void 0:r.success)||i("Sign up successfully, and automatically jump to the sign in page")),setTimeout(function(){t("/signin")},2e3),[2]}})},function(){var e=this,t=arguments;return new Promise(function(n,o){var i=r.apply(e,t);function a(e){x(i,n,o,a,u,"next",e)}function u(e){x(i,n,o,a,u,"throw",e)}a(void 0)})})()}}},O=function(e){var t=e.authenticatorName,n=(0,a.dE)().t,u=(0,h.useTranslation)("lm-collections").t,s=(0,g.p)(t).options,p=s.signupForm,f=(0,o.useMemo)(function(){return p.filter(function(e){return e.show}).reduce(function(e,t){var r=S(w({},t.uiSchema),{title:t.uiSchema.title?u(l.Schema.compile(t.uiSchema.title,{t:n})):""});return e[t.field]=S(w({},r),{required:t.required,"x-decorator":"FormItem"}),e},{})},[p]);if(!(null==s?void 0:s.allowSignUp))return i().createElement(c.Navigate,{to:"/not-found",replace:!0});var d={type:"object",name:(0,v.uid)(),"x-component":"FormV2",properties:S(w({},f),{password:{type:"string",required:!0,title:'{{t("Password")}}',"x-component":"Password","x-decorator":"FormItem","x-validator":{password:!0},"x-component-props":{checkStrength:!0,style:{}},"x-reactions":[{dependencies:[".confirm_password"],fulfill:{state:{selfErrors:'{{$deps[0] && $self.value && $self.value !== $deps[0] ? t("Password mismatch") : ""}}'}}}]},confirm_password:{type:"string",required:!0,"x-component":"Password","x-decorator":"FormItem",title:'{{t("Confirm password")}}',"x-validator":{password:!0},"x-component-props":{style:{}},"x-reactions":[{dependencies:[".password"],fulfill:{state:{selfErrors:'{{$deps[0] && $self.value && $self.value !== $deps[0] ? t("Password mismatch") : ""}}'}}}]},actions:{type:"void","x-component":"div",properties:{submit:{title:'{{t("Sign up")}}',type:"void","x-component":"Action","x-component-props":{block:!0,type:"primary",htmlType:"submit",useAction:"{{ useBasicSignUp }}",style:{width:"100%"}}}}},link:{type:"void","x-component":"div",properties:{link:{type:"void","x-component":"Link","x-component-props":{to:"/signin"},"x-content":'{{t("Log in with an existing account")}}'}}}})};return i().createElement(r.SchemaComponent,{schema:d,scope:{useBasicSignUp:function(){return P({authenticator:t})},t:n}})},E=n(418);function j(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function T(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function A(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){T(e,t,n[t])})}return e}function k(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function I(e){return function(e){if(Array.isArray(e))return j(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e){if(e){if("string"==typeof e)return j(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return j(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var C=function(){var e=(0,r.useRecord)(),t=(0,r.useCollectionManager)().getCollection("users").fields.filter(function(e){var t;return!e.hidden&&!e.target&&e.interface&&!(null==(t=e.uiSchema)?void 0:t["x-read-pretty"])}),n=t.map(function(e){var t;return{value:e.name,label:null==(t=e.uiSchema)?void 0:t.title}}),u=(0,o.useMemo)(function(){var n=((null==(u=e.options)||null==(a=u.public)?void 0:a.signupForm)||[]).filter(function(e){return t.find(function(t){return t.name===e.field})}),r=!0,o=!1,i=void 0;try{for(var a,u,c,l=t[Symbol.iterator]();!(r=(c=l.next()).done);r=!0)!function(){var e=c.value;n.find(function(t){return t.field===e.name})||n.push({field:e.name,show:"username"===e.name,required:"username"===e.name})}()}catch(e){o=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n},[t,e]);return(0,o.useEffect)(function(){var t;e.options=k(A({},e.options),{public:k(A({},null==(t=e.options)?void 0:t.public),{signupForm:u})})},[e,u]),i().createElement(r.SchemaComponent,{components:{ArrayTable:E.ArrayTable},schema:{type:"void",properties:{"public.signupForm":{title:'{{t("Sign up form")}}',type:"array","x-decorator":"FormItem","x-component":"ArrayTable","x-component-props":{bordered:!1},"x-validator":"{{ (value) => {\n const check = value?.some((item) => ['username', 'email'].includes(item.field) && item.show && item.required);\n if (!check) {\n return t('At least one of the username or email fields is required');\n }\n} }}",default:u,items:{type:"object","x-decorator":"ArrayItems.Item",properties:{column0:{type:"void","x-component":"ArrayTable.Column","x-component-props":{width:20,align:"center"},properties:{sort:{type:"void","x-component":"ArrayTable.SortHandle"}}},column1:{type:"void","x-component":"ArrayTable.Column","x-component-props":{width:100,title:(0,a.vV)("Field")},properties:{field:{type:"string","x-decorator":"FormItem","x-component":"Select",enum:n,"x-read-pretty":!0}}},column2:{type:"void","x-component":"ArrayTable.Column","x-component-props":{width:80,title:(0,a.vV)("Show")},properties:{show:{type:"boolean","x-decorator":"FormItem","x-component":"Checkbox","x-reactions":{dependencies:[".required"],fulfill:{state:{value:"{{ $deps[0] || $self.value }}"}}}}}},column3:{type:"void","x-component":"ArrayTable.Column","x-component-props":{width:80,title:(0,a.vV)("Required")},properties:{required:{type:"boolean","x-decorator":"FormItem","x-component":"Checkbox","x-reactions":{dependencies:[".show"],fulfill:{state:{value:"{{ !$deps[0] ? false : $self.value }}"}}}}}}}}}}}})},F=function(){var e=(0,a.dE)().t;return[(0,r.useGlobalVariable)("$env"),(0,r.useCurrentUserVariable)({maxDepth:1}).currentUserSettings,(0,r.useSystemSettingsVariable)().systemSettings,{value:"$resetLink",label:e("Reset password link")},{value:"$resetLinkExpiration",label:e("Reset link expiration (minutes)")}].filter(Boolean)},R=function(){var e=(0,a.dE)().t,t=F(),n=i().createElement("span",null,e("No notification channels found. Please "),i().createElement(c.Link,{to:"/admin/settings/notification-manager/channels"},e("add one first")),".");return i().createElement(r.SchemaComponent,{scope:{t:e},components:{Alert:b.Alert,SignupFormSettings:C,FormTab:E.FormTab},schema:{type:"object",properties:{notice:{type:"void","x-decorator":"FormItem","x-component":"Alert","x-component-props":{showIcon:!0,message:'{{t("The authentication allows users to sign in via username or email.")}}'}},collapse:{type:"void","x-component":"FormTab",properties:{basic:{type:"void","x-component":"FormTab.TabPane","x-component-props":{tab:(0,a.vV)("Sign up settings")},properties:T({"public.allowSignUp":{"x-decorator":"FormItem",type:"boolean",title:'{{t("Allow to sign up")}}',"x-component":"Checkbox",default:!0}},(0,v.uid)(),{type:"void","x-component":"SignupFormSettings"})},forgetPassword:{type:"void","x-component":"FormTab.TabPane","x-component-props":{tab:(0,a.vV)("Forgot password")},properties:{"public.enableResetPassword":{"x-decorator":"FormItem",type:"boolean",title:'{{t("Enable forget password")}}',"x-component":"Checkbox",default:!1},divider1:{type:"void","x-component":function(){return i().createElement(b.Divider,{orientation:"left",orientationMargin:"0"},e("1. Select notification channel"))},"x-reactions":[{dependencies:[".public.enableResetPassword"],fulfill:{state:{visible:"{{$deps[0]}}"}}}]},notificationChannel:{type:"string",title:'{{t("Notification channel (Email)")}}',required:!0,"x-decorator":"FormItem","x-component":"RemoteSelect","x-component-props":{multiple:!1,manual:!1,fieldNames:{label:"title",value:"name"},service:{resource:"notificationChannels",action:"list",params:{filter:{notificationType:"email"}}},notFoundContent:n},"x-reactions":[{dependencies:[".public.enableResetPassword"],fulfill:{state:{visible:"{{$deps[0]}}"}}}],description:'{{t("The notification channel used to send the reset password email, only support email channel")}}'},divider2:{type:"void","x-component":function(){return i().createElement(b.Divider,{orientation:"left",orientationMargin:"0"},e("2. Configure reset email"))},"x-reactions":[{dependencies:[".public.enableResetPassword"],fulfill:{state:{visible:"{{$deps[0]}}"}}}]},emailSubject:{type:"string",required:!0,title:'{{t("Subject")}}',"x-decorator":"FormItem","x-component":"Variable.TextArea","x-component-props":{scope:I(t)},"x-reactions":[{dependencies:[".public.enableResetPassword"],fulfill:{state:{visible:"{{$deps[0]}}",initialValue:'{{t("defaultResetPasswordEmailSubject")}}'}}}],default:'{{t("defaultResetPasswordEmailSubject")}}'},emailContentType:{type:"string",title:'{{t("Content type")}}',required:!0,"x-decorator":"FormItem","x-component":"Radio.Group",enum:[{label:"HTML",value:"html"},{label:'{{t("Plain text")}}',value:"text"}],default:"html","x-reactions":[{dependencies:[".public.enableResetPassword"],fulfill:{state:{visible:"{{$deps[0]}}",initialValue:"html"}}}]},emailContentHTML:{type:"string",required:!0,title:'{{t("Content")}}',"x-decorator":"FormItem","x-component":"Variable.RawTextArea","x-component-props":{scope:I(t),placeholder:"Hi,",autoSize:{minRows:10}},"x-reactions":[{dependencies:[".public.enableResetPassword",".emailContentType"],fulfill:{state:{visible:'{{$deps[0] && $deps[1] === "html"}}',initialValue:'{{t("defaultResetPasswordEmailContentHTML")}}'}}}],default:'{{t("defaultResetPasswordEmailContentHTML")}}'},emailContentText:{type:"string",required:!0,title:'{{t("Content")}}',"x-decorator":"FormItem","x-component":"Variable.RawTextArea","x-component-props":{scope:I(t),autoSize:{minRows:10}},"x-reactions":[{dependencies:[".public.enableResetPassword",".emailContentType"],fulfill:{state:{visible:'{{$deps[0] && $deps[1] === "text"}}',initialValue:'{{t("defaultResetPasswordEmailContentText")}}'}}}],default:'{{t("defaultResetPasswordEmailContentText")}}'},resetTokenExpiresIn:{type:"number",title:'{{t("Reset link expiration")}}',"x-decorator":"FormItem","x-component":"InputNumber","x-component-props":{suffix:e("Minutes"),style:{width:"100%"}},default:120,required:!0,"x-reactions":[{dependencies:[".public.enableResetPassword"],fulfill:{state:{visible:"{{$deps[0]}}",initialValue:120}}}]}}}}}}}})}},872:function(e,t,n){"use strict";n.d(t,{CU:function(){return i},dE:function(){return a},vV:function(){return u}});var r=n(953),o=n(342),i="auth";function a(){return(0,r.useTranslation)([i,"client"],{nsMode:"fallback"})}function u(e){return o.i18n.t(e,{ns:[i,"client"],nsMode:"fallback"})}},350:function(e,t,n){"use strict";n.r(t),n.d(t,{AuthLayout:function(){return d},useSignInButtons:function(){return P},SignUpPage:function(){return I},useSignInForms:function(){return S},useSignUpForms:function(){return k},SignupPageContext:function(){return T},AuthenticatorsContextProvider:function(){return f},SignupPageProvider:function(){return A},SignInPage:function(){return O}});var r=n(477),o=n(342),i=n(59),a=n(155),u=n.n(a),c=n(442),l=n(953),s=n(706);function p(){var e,t,n=(e=["\n position: absolute;\n bottom: 0;\n width: 100%;\n left: 0;\n text-align: center;\n padding-bottom: 24px;\n background-color: ",";\n "],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return p=function(){return n},n}var f=function(e){var t=e.children,n=(0,o.useAPIClient)(),r=(0,o.useRequest)(function(){return n.resource("authenticators").publicList().then(function(e){var t;return(null==e||null==(t=e.data)?void 0:t.data)||[]})}),a=r.data,c=r.error;if(r.loading)return u().createElement("div",{style:{textAlign:"center",marginTop:20}},u().createElement(i.Spin,null));if(c)throw c;return u().createElement(s.m.Provider,{value:void 0===a?[]:a},t)};function d(){var e,t=((0,o.useSystemSettings)()||{}).data,n=(0,o.useToken)().token,i=(0,l.useTranslation)("lm-collections").t;return u().createElement("div",{style:{maxWidth:320,margin:"0 auto",paddingTop:"20vh",paddingBottom:"20vh"}},u().createElement("div",{style:{position:"fixed",top:"2em",right:"2em"}},u().createElement(o.SwitchLanguage,null)),u().createElement("h1",{style:{textAlign:"center"}},u().createElement(o.ReadPretty.TextArea,{value:i(null==t||null==(e=t.data)?void 0:e.title)})),u().createElement(f,null,u().createElement(c.Outlet,null)),u().createElement("div",{className:(0,r.css)(p(),n.colorBgContainer)},u().createElement(o.PoweredBy,null)))}var m=n(574),y=n(872),v=n(230);function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function h(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){u=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function x(){var e=g(["\n display: flex;\n "]);return x=function(){return e},e}function w(){var e=g(["\n display: flex;\n "]);return w=function(){return e},e}var S=function(){var e=(0,o.usePlugin)(m.default).authTypes.getEntities(),t={},n=!0,r=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(n=(a=u.next()).done);n=!0){var c,l=h(a.value,2),s=l[0],p=l[1];(null==(c=p.components)?void 0:c.SignInForm)&&(t[s]=p.components.SignInForm)}}catch(e){r=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(r)throw i}}return t},P=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=(0,o.usePlugin)(m.default).authTypes.getEntities(),n={},r=!0,i=!1,a=void 0;try{for(var c,l=t[Symbol.iterator]();!(r=(c=l.next()).done);r=!0){var s,p=h(c.value,2),f=p[0],d=p[1];(null==(s=d.components)?void 0:s.SignInButton)&&(n[f]=d.components.SignInButton)}}catch(e){i=!0,a=e}finally{try{r||null==l.return||l.return()}finally{if(i)throw a}}var y=Object.keys(n);return e.filter(function(e){return y.includes(e.authType)}).map(function(e,t){return u().createElement(n[e.authType],{key:t,authenticator:e})})},O=function(){var e=(0,y.dE)().t;(0,o.useCurrentDocumentTitle)("Signin"),(0,o.useViewport)();var t=S(),n=(0,a.useContext)(s.m),c=P(n);if(!n.length)return u().createElement("div",{style:{color:"#ccc"}},e("No authentication methods available."));var l=n.map(function(n){var r=t[n.authType];if(r){var o="".concat(e("Sign-in")," (").concat(v.Schema.compile(n.authTypeTitle||n.authType,{t:e}),")");return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({component:(0,a.createElement)(r,{authenticator:n}),tabTitle:n.title||o},n)}}).filter(function(e){return e});return u().createElement(i.Space,{direction:"vertical",className:(0,r.css)(x())},l.length>1?u().createElement(i.Tabs,{items:l.map(function(e){return{label:e.tabTitle,key:e.name,children:e.component}})}):l.length?u().createElement("div",null,l[0].component):u().createElement(u().Fragment,null),u().createElement(i.Space,{direction:"vertical",className:(0,r.css)(w())},c))};function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function j(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){u=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return E(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return E(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var T=(0,a.createContext)({});T.displayName="SignupPageContext";var A=function(e){var t=(0,a.useContext)(T);return t[e.authType]={component:e.component},u().createElement(T.Provider,{value:t},e.children)},k=function(){var e=(0,o.usePlugin)(m.default).authTypes.getEntities(),t={},n=!0,r=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(n=(a=u.next()).done);n=!0){var c,l=j(a.value,2),s=l[0],p=l[1];(null==(c=p.components)?void 0:c.SignUpForm)&&(t[s]=p.components.SignUpForm)}}catch(e){r=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(r)throw i}}return t},I=function(){(0,o.useViewport)(),(0,o.useCurrentDocumentTitle)("Signup");var e=k(),t=j((0,c.useSearchParams)(),1)[0].get("name"),n=((0,s.p)(t)||{}).authType;return e[n]?(0,a.createElement)(e[n],{authenticatorName:t}):u().createElement(c.Navigate,{to:"/not-found",replace:!0})}},375:function(e){"use strict";e.exports=i},477:function(e){"use strict";e.exports=t},418:function(e){"use strict";e.exports=r},452:function(e){"use strict";e.exports=s},230:function(e){"use strict";e.exports=o},166:function(e){"use strict";e.exports=a},342:function(e){"use strict";e.exports=l},768:function(e){"use strict";e.exports=p},59:function(e){"use strict";e.exports=c},155:function(e){"use strict";e.exports=u},953:function(t){"use strict";t.exports=e},442:function(e){"use strict";e.exports=n},754:function(e,t,n){"use strict";var r="",o="u">typeof document?document.currentScript:null;if(o&&o.src&&(r=o.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")),!r){var i=window.__webpack_public_path__||"";i&&("/"!==i.charAt(i.length-1)&&(i+="/"),r=i+"static/plugins/@nocobase/plugin-auth/dist/client/")}if(!r){if(!(r=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var a=window.location.pathname||"/",u=a.indexOf("/v2/");r=u>=0?a.slice(0,u+1):"/"}r&&(r=r.replace(/\/v2\/?$/,"/")),r||(r="/"),"/"!==r.charAt(r.length-1)&&(r+="/"),r+="static/plugins/@nocobase/plugin-auth/dist/client/"}n.p=r}},v={};function b(e){var t=v[e];if(void 0!==t)return t.exports;var n=v[e]={exports:{}};return y[e](n,n.exports,b),n.exports}b.m=y,b.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return b.d(t,{a:t}),t},b.d=function(e,t){for(var n in t)b.o(t,n)&&!b.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},b.f={},b.e=function(e){return Promise.all(Object.keys(b.f).reduce(function(t,n){return b.f[n](e,t),t},[]))},b.u=function(e){return""+e+"."+({443:"634aca1f12f4906b",611:"bf903b6a5490becc",680:"c44d0f336fd828c0"})[e]+".js"},b.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),b.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},h={},b.l=function(e,t,n,r){if(h[e])return void h[e].push(t);if(void 0!==n)for(var o,i,a=document.getElementsByTagName("script"),u=0;u<a.length;u++){var c=a[u];if(c.getAttribute("src")==e||c.getAttribute("data-rspack")=="@nocobase/plugin-auth:"+n){o=c;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,b.nc&&o.setAttribute("nonce",b.nc),o.setAttribute("data-rspack","@nocobase/plugin-auth:"+n),o.src=e),h[e]=[t];var l=function(t,n){o.onerror=o.onload=null,clearTimeout(s);var r=h[e];if(delete h[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=l.bind(null,o.onerror),o.onload=l.bind(null,o.onload),i&&document.head.appendChild(o)},b.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},b.g.importScripts&&(g=b.g.location+"");var h,g,x=b.g.document;if(!g&&x&&(x.currentScript&&"SCRIPT"===x.currentScript.tagName.toUpperCase()&&(g=x.currentScript.src),!g)){var w=x.getElementsByTagName("script");if(w.length)for(var S=w.length-1;S>-1&&(!g||!/^http(s?):/.test(g));)g=w[S--].src}if(!g)throw Error("Automatic publicPath is not supported in this browser");return b.p=g.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),f={889:0},b.f.j=function(e,t){var n=b.o(f,e)?f[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=f[e]=[t,r]});t.push(n[2]=r);var o=b.p+b.u(e),i=Error();b.l(o,function(t){if(b.o(f,e)&&(0!==(n=f[e])&&(f[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,n[1](i)}},"chunk-"+e,e)}},d=function(e,t){var n,r,o=t[0],i=t[1],a=t[2],u=0;if(o.some(function(e){return 0!==f[e]})){for(n in i)b.o(i,n)&&(b.m[n]=i[n]);a&&a(b)}for(e&&e(t);u<o.length;u++)r=o[u],b.o(f,r)&&f[r]&&f[r][0](),f[r]=0},(m=self.webpackChunk_nocobase_plugin_auth=self.webpackChunk_nocobase_plugin_auth||[]).forEach(d.bind(null,0)),m.push=d.bind(null,m.push.bind(m)),b(754),b(574)}()});
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react-i18next"),require("@emotion/css"),require("react-router-dom"),require("@formily/antd-v5"),require("@formily/react"),require("@ant-design/icons"),require("@formily/shared"),require("react"),require("antd"),require("@nocobase/client"),require("@formily/core"),require("@nocobase/utils/client")):"function"==typeof define&&define.amd?define("@nocobase/plugin-auth",["react-i18next","@emotion/css","react-router-dom","@formily/antd-v5","@formily/react","@ant-design/icons","@formily/shared","react","antd","@nocobase/client","@formily/core","@nocobase/utils/client"],t):"object"==typeof exports?exports["@nocobase/plugin-auth"]=t(require("react-i18next"),require("@emotion/css"),require("react-router-dom"),require("@formily/antd-v5"),require("@formily/react"),require("@ant-design/icons"),require("@formily/shared"),require("react"),require("antd"),require("@nocobase/client"),require("@formily/core"),require("@nocobase/utils/client")):e["@nocobase/plugin-auth"]=t(e["react-i18next"],e["@emotion/css"],e["react-router-dom"],e["@formily/antd-v5"],e["@formily/react"],e["@ant-design/icons"],e["@formily/shared"],e.react,e.antd,e["@nocobase/client"],e["@formily/core"],e["@nocobase/utils/client"])}(self,function(e,t,n,r,o,i,a,u,c,l,s,p){return function(){var f,d,m,y={432:function(e,t,n){e.exports=n(36).Symbol},77:function(e,t,n){var r=n(432),o=n(444),i=n(371),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?o(e):i(e)}},625:function(e,t,n){var r=n(531),o=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(o,""):e}},565:function(e,t,n){e.exports="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g},444:function(e,t,n){var r=n(432),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,u=r?r.toStringTag:void 0;e.exports=function(e){var t=i.call(e,u),n=e[u];try{e[u]=void 0;var r=!0}catch(e){}var o=a.call(e);return r&&(t?e[u]=n:delete e[u]),o}},371:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},36:function(e,t,n){var r=n(565),o="object"==typeof self&&self&&self.Object===Object&&self;e.exports=r||o||Function("return this")()},531:function(e){var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},738:function(e,t,n){var r=n(130),o=n(593),i=n(909),a=Math.max,u=Math.min;e.exports=function(e,t,n){var c,l,s,p,f,d,m=0,y=!1,v=!1,b=!0;if("function"!=typeof e)throw TypeError("Expected a function");function h(t){var n=c,r=l;return c=l=void 0,m=t,p=e.apply(r,n)}function g(e){var n=e-d,r=e-m;return void 0===d||n>=t||n<0||v&&r>=s}function w(){var e,n,r,i=o();if(g(i))return x(i);f=setTimeout(w,(e=i-d,n=i-m,r=t-e,v?u(r,s-n):r))}function x(e){return(f=void 0,b&&c)?h(e):(c=l=void 0,p)}function S(){var e,n=o(),r=g(n);if(c=arguments,l=this,d=n,r){if(void 0===f)return m=e=d,f=setTimeout(w,t),y?h(e):p;if(v)return clearTimeout(f),f=setTimeout(w,t),h(d)}return void 0===f&&(f=setTimeout(w,t)),p}return t=i(t)||0,r(n)&&(y=!!n.leading,s=(v="maxWait"in n)?a(i(n.maxWait)||0,t):s,b="trailing"in n?!!n.trailing:b),S.cancel=function(){void 0!==f&&clearTimeout(f),m=0,c=d=l=f=void 0},S.flush=function(){return void 0===f?p:x(o())},S}},130:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},189:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},733:function(e,t,n){var r=n(77),o=n(189);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},593:function(e,t,n){var r=n(36);e.exports=function(){return r.Date.now()}},909:function(e,t,n){var r=n(625),o=n(130),i=n(733),a=0/0,u=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,l=/^0o[0-7]+$/i,s=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(i(e))return a;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=c.test(e);return n||l.test(e)?s(e.slice(2),n?2:8):u.test(e)?a:+e}},574:function(e,t,n){"use strict";n.r(t),n.d(t,{AuthLayout:function(){return z},default:function(){return G},useRedirect:function(){return i.useRedirect},PluginAuthClient:function(){return H},AuthenticatorsContext:function(){return v.m},useAuthenticator:function(){return v.p},AuthenticatorsContextProvider:function(){return K},useSignIn:function(){return i.useSignIn}});var r=n(342),o=n(768),i=n(751),a=n(738),u=n.n(a),c={EMPTY_TOKEN:"EMPTY_TOKEN",EXPIRED_TOKEN:"EXPIRED_TOKEN",INVALID_TOKEN:"INVALID_TOKEN",TOKEN_RENEW_FAILED:"TOKEN_RENEW_FAILED",BLOCKED_TOKEN:"BLOCKED_TOKEN",EXPIRED_SESSION:"EXPIRED_SESSION",NOT_EXIST_USER:"NOT_EXIST_USER",SKIP_TOKEN_RENEW:"SKIP_TOKEN_RENEW",USER_HAS_NO_ROLES_ERR:"USER_HAS_NO_ROLES_ERR"},l=u()(function(e){e()},3e3,{leading:!0,trailing:!1}),s=n(872),p=n(230),f=n(155),d=n.n(f),m=n(59),y=n(442),v=n(706);function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function h(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){n(e);return}u.done?t(c):Promise.resolve(c).then(r,o)}function g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){u=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var w=function(){var e,t=(0,s.dE)().t,n=g((0,y.useSearchParams)(),1)[0].get("name"),o=(0,v.p)(n);return(null==o||null==(e=o.options)?void 0:e.enableResetPassword)?d().createElement(r.SchemaComponent,{schema:{type:"object",name:"forgotPasswordForm","x-component":"FormV2",properties:{email:{type:"string","x-component":"Input",title:'{{t("Reset password")}}',required:!0,"x-validator":"{{(value) => {\n if (!value) {\n return '';\n }\n if (!/^[\\w-]+(\\.[\\w-]+)*@[\\w-]+(\\.[\\w-]+)+$/.test(value)) {\n return t(\"Please enter a valid email\");\n }\n }}}","x-decorator":"FormItem","x-component-props":{placeholder:'{{t("Please enter your email")}}',style:{}}},actions:{type:"void","x-component":"div",properties:{submit:{title:'{{t("Send reset email")}}',type:"void","x-component":"Action","x-component-props":{htmlType:"submit",block:!0,type:"primary",useAction:function(){var e=(0,p.useForm)(),t=(0,r.useAPIClient)(),n=(0,s.dE)().t,o=g(d().useState(!1),2),i=o[0],a=o[1];return{run:function(){var r;return(r=function(){return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:c(0)}),u(a,"throw",{value:c(1)}),u(a,"return",{value:c(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function c(u){return function(c){var l=[u,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(r){switch(r.label){case 0:return[4,e.submit()];case 1:r.sent(),a(!0),r.label=2;case 2:return r.trys.push([2,,4,5]),[4,t.auth.lostPassword(e.values)];case 3:return r.sent(),[3,5];case 4:return a(!1),[7];case 5:return m.message.success(n("Reset email sent successfully")),e.reset(),[2]}})},function(){var e=this,t=arguments;return new Promise(function(n,o){var i=r.apply(e,t);function a(e){h(i,n,o,a,u,"next",e)}function u(e){h(i,n,o,a,u,"throw",e)}a(void 0)})})()},loading:i}}}}}},signUp:{type:"void","x-component":"Link","x-component-props":{to:"/signin"},"x-content":'{{t("Back to login")}}'}}},scope:{t:t}}):d().createElement(y.Navigate,{to:"/not-found",replace:!0})};function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function S(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){n(e);return}u.done?t(c):Promise.resolve(c).then(r,o)}function P(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){u=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return x(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return x(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var O=function(){var e,t=(0,s.dE)().t,n=(0,r.useAPIClient)(),o=P((0,y.useSearchParams)(),1)[0],i=o.get("resetToken"),a=(0,r.useNavigateNoUpdate)(),u=P(d().useState(!1),2),c=u[0],l=u[1],b=o.get("name"),h=(0,v.p)(b);return((0,f.useEffect)(function(){n.auth.checkResetToken({resetToken:i}).then(function(){l(!1)}).catch(function(e){l(!0)})},[]),null==h||null==(e=h.options)?void 0:e.enableResetPassword)?!i||c?d().createElement(m.Result,{status:"403",title:t("Reset link has expired"),extra:d().createElement(m.Button,{type:"primary",onClick:function(){return a("/signin")}},t("Go to login"))}):d().createElement(r.SchemaComponent,{schema:{type:"object",name:"resetPasswordForm","x-component":"FormV2",properties:{password:{type:"string","x-component":"Password",title:'{{t("New password")}}',required:!0,"x-decorator":"FormItem","x-component-props":{placeholder:'{{t("Please enter new password")}}'}},confirmPassword:{type:"string","x-component":"Password",title:'{{t("Confirm password")}}',required:!0,"x-decorator":"FormItem","x-component-props":{placeholder:'{{t("Please enter the same password again")}}'},"x-validator":"{{(value, rules, {form}) => {\n if (!value) {\n return '';\n }\n if (value !== form.values.password) {\n return t(\"The passwords entered twice are inconsistent\");\n }\n }}}"},actions:{type:"void","x-component":"div",properties:{submit:{title:'{{t("Confirm")}}',type:"void","x-component":"Action","x-component-props":{htmlType:"submit",block:!0,type:"primary",useAction:function(){var e=(0,p.useForm)(),t=(0,r.useAPIClient)(),n=(0,s.dE)().t,o=new URLSearchParams(window.location.search).get("resetToken"),i=P(d().useState(!1),2),a=i[0],u=i[1];return{run:function(){var r;return(r=function(){return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:c(0)}),u(a,"throw",{value:c(1)}),u(a,"return",{value:c(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function c(u){return function(c){var l=[u,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(r){switch(r.label){case 0:return[4,e.submit()];case 1:r.sent(),u(!0),r.label=2;case 2:var i,a;return r.trys.push([2,,4,5]),[4,t.auth.resetPassword((i=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},e.values),a=a={resetToken:o},Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(a)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(a)).forEach(function(e){Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(a,e))}),i))];case 3:return r.sent(),[3,5];case 4:return u(!1),[7];case 5:return m.message.success(n("Password reset successful")),setTimeout(function(){window.location.href="/signin"},1e3),[2]}})},function(){var e=this,t=arguments;return new Promise(function(n,o){var i=r.apply(e,t);function a(e){S(i,n,o,a,u,"next",e)}function u(e){S(i,n,o,a,u,"throw",e)}a(void 0)})})()},loading:a}}}}}},signUp:{type:"void","x-component":"Link","x-component-props":{to:"/signin"},"x-content":'{{t("Go to login")}}'}}},scope:{t:t}}):d().createElement(y.Navigate,{to:"/not-found",replace:!0})};function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function j(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){n(e);return}u.done?t(c):Promise.resolve(c).then(r,o)}function T(e,t,n){return(T=C()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&k(o,n.prototype),o}).apply(null,arguments)}function A(e){return(A=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function k(e,t){return(k=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function I(e){var t="function"==typeof Map?new Map:void 0;return(I=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return T(e,arguments,A(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),k(n,e)})(e)}function C(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(C=function(){return!!e})()}var F=(0,r.lazy)(function(){return n.e("443").then(n.bind(n,862))},"AuthProvider").AuthProvider,R=(0,r.lazy)(function(){return Promise.resolve().then(n.bind(n,751))},"Options","SignInForm","SignUpForm"),_=R.Options,N=R.SignInForm,U=R.SignUpForm,$=(0,r.lazy)(function(){return Promise.resolve().then(n.bind(n,350))},"AuthLayout","SignInPage","SignUpPage"),q=$.AuthLayout,L=$.SignInPage,M=$.SignUpPage,D=(0,r.lazy)(function(){return n.e("611").then(n.bind(n,718))},"Authenticator").Authenticator,V=(0,r.lazy)(function(){return n.e("680").then(n.bind(n,971))},"TokenPolicySettings").TokenPolicySettings,B=(0,r.lazy)(function(){return Promise.resolve().then(n.bind(n,350))},"AuthenticatorsContextProvider","AuthLayout"),K=B.AuthenticatorsContextProvider,z=B.AuthLayout,H=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t,r,i,a,u;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return t=n,r=arguments,t=A(t),i=e=function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,C()?Reflect.construct(t,r||[],A(this).constructor):t.apply(this,r)),a="authTypes",u=new o.Registry,a in i?Object.defineProperty(i,a,{value:u,enumerable:!0,configurable:!0,writable:!0}):i[a]=u,e}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&k(n,e),t=[{key:"registerType",value:function(e,t){this.authTypes.register(e,t)}},{key:"load",value:function(){var e;return(e=function(){var e,t,n;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:c(0)}),u(a,"throw",{value:c(1)}),u(a,"return",{value:c(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function c(u){return function(c){var l=[u,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(r){var o,i;return this.app.pluginSettingsManager.add(s.CU,{icon:"LoginOutlined",title:'{{t("Authentication", { ns: "'.concat(s.CU,'" })}}'),aclSnippet:"pm.auth"}),this.app.pluginSettingsManager.add("auth.authenticators",{icon:"LoginOutlined",title:'{{t("Authenticators", { ns: "'.concat(s.CU,'" })}}'),Component:D,aclSnippet:"pm.auth.authenticators",sort:1}),this.router.add("auth",{Component:"AuthLayout"}),this.router.add("auth.signin",{path:"/signin",Component:"SignInPage"}),this.router.add("auth.signup",{path:"/signup",Component:"SignUpPage"}),this.router.add("auth.forgotPassword",{path:"/forgot-password",Component:"ForgotPasswordPage"}),this.router.add("auth.resetPassword",{path:"/reset-password",Component:"ResetPasswordPage"}),this.app.addComponents({AuthLayout:q,SignInPage:L,SignUpPage:M,ForgotPasswordPage:w,ResetPasswordPage:O}),this.app.providers.unshift([F,{}]),this.registerType("Email/Password",{components:{SignInForm:N,SignUpForm:U,AdminSettingsForm:_}}),this.app.pluginSettingsManager.add("security.token-policy",{title:'{{t("Token policy", { ns: "'.concat(s.CU,'" })}}'),Component:V,aclSnippet:"pm.security.token-policy",icon:"ApiOutlined",sort:0}),t=(e=function(e){if(Array.isArray(e))return e}(((o=({app:this.app}).app).apiClient.axios,i=[function(e){var t,n=null==e||null==(t=e.headers)?void 0:t["x-new-token"];return n&&o.apiClient.auth.setToken(n),e},function(e){var t,n,r,i,a,u=null==e||null==(n=e.response)||null==(t=n.headers)?void 0:t["x-new-token"],s=null==e||null==(i=e.response)||null==(r=i.data)?void 0:r.errors,p=Array.isArray(s)?s[0]:null,f=o.router.state.location,d=f.pathname,m=f.search,y=o.router.basename;if(u&&o.apiClient.auth.setToken(u),401===e.status&&(null==p?void 0:p.code)&&c[p.code]&&(o.apiClient.auth.setToken(""),d===o.getHref("signin")&&(null==p?void 0:p.code)!==c.EMPTY_TOKEN&&e.config&&(e.config.skipNotify=!1),(null==p?void 0:p.code)==="USER_HAS_NO_ROLES_ERR"&&(e.config.skipNotify=!0,o.error=p)),401===e.status&&!(null==(a=e.config)?void 0:a.skipAuth)&&(null==p?void 0:p.code)&&c[p.code]){if(!p||(null==p?void 0:p.code)===c.SKIP_TOKEN_RENEW)throw e;var v=o.router.isSkippedAuthCheckRoute(d);if(v&&(e.config.skipNotify=!0),d!==o.getHref("signin")&&!v){var b,h,g=(b=y.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),h=new RegExp("^".concat(b.replace(/\/?$/,""),"(\\/|$)")),d.replace(h,"/")||d);l(function(){o.apiClient.auth.setToken(null),o.router.navigate("/signin?redirect=".concat(g).concat(m),{replace:!0})})}}throw e}]))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(i)||function(e){if(e){if("string"==typeof e)return E(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return E(e,2)}}(i)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0],n=e[1],this.app.apiClient.axios.interceptors.response.handlers.unshift({fulfilled:t,rejected:n,synchronous:!1,runWhen:null}),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){j(i,r,o,a,u,"next",e)}function u(e){j(i,r,o,a,u,"throw",e)}a(void 0)})}).call(this)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,t),n}(I(r.Plugin)),G=H},706:function(e,t,n){"use strict";n.d(t,{m:function(){return o},p:function(){return i}});var r=n(155),o=(0,r.createContext)([]);o.displayName="AuthenticatorsContext";var i=function(e){return(0,r.useContext)(o).find(function(t){return t.name===e})}},751:function(e,t,n){"use strict";n.r(t),n.d(t,{Options:function(){return R},SignInForm:function(){return y},SignUpForm:function(){return O},useRedirect:function(){return f},useSignUp:function(){return P},useSignIn:function(){return d}});var r=n(342),o=n(155),i=n.n(o),a=n(872),u=n(350),c=n(442),l=n(230);function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function p(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){n(e);return}u.done?t(c):Promise.resolve(c).then(r,o)}function f(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/admin",n=(0,c.useNavigate)(),r=(function(e){if(Array.isArray(e))return e}(e=(0,c.useSearchParams)())||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),1!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(e)||function(e){if(e){if("string"==typeof e)return s(e,1);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return s(e,1)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0];return(0,o.useCallback)(function(){var e=r.get("redirect")||t;!function(e){try{var t=new URL(e,window.location.origin);return/(?:^|\/)v2(?:\/|$)/.test(t.pathname)}catch(t){return/(?:^|\/)v2(?:\/|$)/.test(e)}}(e)?n(e,{replace:!0}):window.location.replace(e)},[n,t,r])}var d=function(e){var t=(0,l.useForm)(),n=(0,r.useAPIClient)(),o=f(),i=(0,r.useCurrentUserContext)().refreshAsync;return{run:function(){var r;return(r=function(){return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:c(0)}),u(a,"throw",{value:c(1)}),u(a,"return",{value:c(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function c(u){return function(c){var l=[u,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(r){switch(r.label){case 0:return[4,t.submit()];case 1:return r.sent(),[4,n.auth.signIn(t.values,e)];case 2:return r.sent(),[4,i()];case 3:return r.sent(),o(),[2]}})},function(){var e=this,t=arguments;return new Promise(function(n,o){var i=r.apply(e,t);function a(e){p(i,n,o,a,u,"next",e)}function u(e){p(i,n,o,a,u,"throw",e)}a(void 0)})})()}}},m=function(e){var t=e.showForgotPassword;return{type:"object",name:"passwordForm","x-component":"FormV2",properties:{account:{type:"string","x-component":"Input","x-validator":'{{(value) => {\n if (!value) {\n return t("Please enter your username or email");\n }\n if (value.includes(\'@\')) {\n if (!/^[\\w-]+(\\.[\\w-]+)*@[\\w-]+(\\.[\\w-]+)+$/.test(value)) {\n return t("Please enter a valid email");\n }\n } else {\n return /^[^@<>"\'/]{1,50}$/.test(value) || t("Please enter a valid username");\n }\n }}}',"x-decorator":"FormItem","x-component-props":{placeholder:'{{t("Username/Email")}}',style:{}}},password:{type:"string","x-component":"Password",required:!0,"x-decorator":"FormItem","x-component-props":{placeholder:'{{t("Password")}}',style:{},showForgotPassword:t}},actions:{type:"void","x-component":"div",properties:{submit:{title:'{{t("Sign in")}}',type:"void","x-component":"Action","x-component-props":{htmlType:"submit",block:!0,type:"primary",useAction:"{{ useBasicSignIn }}",style:{width:"100%"}}}}},links:{type:"void","x-component":"div","x-component-props":{style:{display:"flex",justifyContent:"space-between"}},properties:{signUp:{type:"void","x-component":"Link","x-component-props":{to:"{{ signUpLink }}"},"x-content":'{{t("Create an account")}}',"x-visible":"{{ allowSignUp }}"},forgotPassword:{type:"void","x-component":"Link","x-component-props":{to:'{{"/forgot-password?name=" + authenticator.name}}'},"x-content":'{{t("Forgot password")}}',"x-visible":t}}}}}},y=function(e){var t=(0,a.dE)().t,n=e.authenticator,o=n.authType,c=n.name,l=n.options,s=!!(0,u.useSignUpForms)()[o]&&null!=l&&!!l.allowSignUp,p="/signup?name=".concat(c);return i().createElement(r.SchemaComponent,{schema:m({showForgotPassword:!!(null==l?void 0:l.enableResetPassword)}),scope:{useBasicSignIn:function(){return d(c)},allowSignUp:s,signUpLink:p,t:t,authenticator:n}})},v=n(166),b=n(59),h=n(953),g=n(706);function w(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){n(e);return}u.done?t(c):Promise.resolve(c).then(r,o)}function x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function S(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}var P=function(e){var t=(0,c.useNavigate)(),n=(0,l.useForm)(),o=(0,r.useAPIClient)(),i=(0,h.useTranslation)().t;return{run:function(){var r;return(r=function(){var r;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:c(0)}),u(a,"throw",{value:c(1)}),u(a,"return",{value:c(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function c(u){return function(c){var l=[u,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(a){switch(a.label){case 0:return[4,n.submit()];case 1:return a.sent(),[4,o.auth.signUp(n.values,null==e?void 0:e.authenticator)];case 2:return a.sent(),b.message.success((null==e||null==(r=e.message)?void 0:r.success)||i("Sign up successfully, and automatically jump to the sign in page")),setTimeout(function(){t("/signin")},2e3),[2]}})},function(){var e=this,t=arguments;return new Promise(function(n,o){var i=r.apply(e,t);function a(e){w(i,n,o,a,u,"next",e)}function u(e){w(i,n,o,a,u,"throw",e)}a(void 0)})})()}}},O=function(e){var t=e.authenticatorName,n=(0,a.dE)().t,u=(0,h.useTranslation)("lm-collections").t,s=(0,g.p)(t).options,p=s.signupForm,f=(0,o.useMemo)(function(){return p.filter(function(e){return e.show}).reduce(function(e,t){var r=S(x({},t.uiSchema),{title:t.uiSchema.title?u(l.Schema.compile(t.uiSchema.title,{t:n})):""});return e[t.field]=S(x({},r),{required:t.required,"x-decorator":"FormItem"}),e},{})},[p]);if(!(null==s?void 0:s.allowSignUp))return i().createElement(c.Navigate,{to:"/not-found",replace:!0});var d={type:"object",name:(0,v.uid)(),"x-component":"FormV2",properties:S(x({},f),{password:{type:"string",required:!0,title:'{{t("Password")}}',"x-component":"Password","x-decorator":"FormItem","x-validator":{password:!0},"x-component-props":{checkStrength:!0,style:{}},"x-reactions":[{dependencies:[".confirm_password"],fulfill:{state:{selfErrors:'{{$deps[0] && $self.value && $self.value !== $deps[0] ? t("Password mismatch") : ""}}'}}}]},confirm_password:{type:"string",required:!0,"x-component":"Password","x-decorator":"FormItem",title:'{{t("Confirm password")}}',"x-validator":{password:!0},"x-component-props":{style:{}},"x-reactions":[{dependencies:[".password"],fulfill:{state:{selfErrors:'{{$deps[0] && $self.value && $self.value !== $deps[0] ? t("Password mismatch") : ""}}'}}}]},actions:{type:"void","x-component":"div",properties:{submit:{title:'{{t("Sign up")}}',type:"void","x-component":"Action","x-component-props":{block:!0,type:"primary",htmlType:"submit",useAction:"{{ useBasicSignUp }}",style:{width:"100%"}}}}},link:{type:"void","x-component":"div",properties:{link:{type:"void","x-component":"Link","x-component-props":{to:"/signin"},"x-content":'{{t("Log in with an existing account")}}'}}}})};return i().createElement(r.SchemaComponent,{schema:d,scope:{useBasicSignUp:function(){return P({authenticator:t})},t:n}})},E=n(418);function j(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function T(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function A(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){T(e,t,n[t])})}return e}function k(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function I(e){return function(e){if(Array.isArray(e))return j(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e){if(e){if("string"==typeof e)return j(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return j(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var C=function(){var e=(0,r.useRecord)(),t=(0,r.useCollectionManager)().getCollection("users").fields.filter(function(e){var t;return!e.hidden&&!e.target&&e.interface&&!(null==(t=e.uiSchema)?void 0:t["x-read-pretty"])}),n=t.map(function(e){var t;return{value:e.name,label:null==(t=e.uiSchema)?void 0:t.title}}),u=(0,o.useMemo)(function(){var n=((null==(u=e.options)||null==(a=u.public)?void 0:a.signupForm)||[]).filter(function(e){return t.find(function(t){return t.name===e.field})}),r=!0,o=!1,i=void 0;try{for(var a,u,c,l=t[Symbol.iterator]();!(r=(c=l.next()).done);r=!0)!function(){var e=c.value;n.find(function(t){return t.field===e.name})||n.push({field:e.name,show:"username"===e.name,required:"username"===e.name})}()}catch(e){o=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n},[t,e]);return(0,o.useEffect)(function(){var t;e.options=k(A({},e.options),{public:k(A({},null==(t=e.options)?void 0:t.public),{signupForm:u})})},[e,u]),i().createElement(r.SchemaComponent,{components:{ArrayTable:E.ArrayTable},schema:{type:"void",properties:{"public.signupForm":{title:'{{t("Sign up form")}}',type:"array","x-decorator":"FormItem","x-component":"ArrayTable","x-component-props":{bordered:!1},"x-validator":"{{ (value) => {\n const check = value?.some((item) => ['username', 'email'].includes(item.field) && item.show && item.required);\n if (!check) {\n return t('At least one of the username or email fields is required');\n }\n} }}",default:u,items:{type:"object","x-decorator":"ArrayItems.Item",properties:{column0:{type:"void","x-component":"ArrayTable.Column","x-component-props":{width:20,align:"center"},properties:{sort:{type:"void","x-component":"ArrayTable.SortHandle"}}},column1:{type:"void","x-component":"ArrayTable.Column","x-component-props":{width:100,title:(0,a.vV)("Field")},properties:{field:{type:"string","x-decorator":"FormItem","x-component":"Select",enum:n,"x-read-pretty":!0}}},column2:{type:"void","x-component":"ArrayTable.Column","x-component-props":{width:80,title:(0,a.vV)("Show")},properties:{show:{type:"boolean","x-decorator":"FormItem","x-component":"Checkbox","x-reactions":{dependencies:[".required"],fulfill:{state:{value:"{{ $deps[0] || $self.value }}"}}}}}},column3:{type:"void","x-component":"ArrayTable.Column","x-component-props":{width:80,title:(0,a.vV)("Required")},properties:{required:{type:"boolean","x-decorator":"FormItem","x-component":"Checkbox","x-reactions":{dependencies:[".show"],fulfill:{state:{value:"{{ !$deps[0] ? false : $self.value }}"}}}}}}}}}}}})},F=function(){var e=(0,a.dE)().t;return[(0,r.useGlobalVariable)("$env"),(0,r.useCurrentUserVariable)({maxDepth:1}).currentUserSettings,(0,r.useSystemSettingsVariable)().systemSettings,{value:"$resetLink",label:e("Reset password link")},{value:"$resetLinkExpiration",label:e("Reset link expiration (minutes)")}].filter(Boolean)},R=function(){var e=(0,a.dE)().t,t=F(),n=i().createElement("span",null,e("No notification channels found. Please "),i().createElement(c.Link,{to:"/admin/settings/notification-manager/channels"},e("add one first")),".");return i().createElement(r.SchemaComponent,{scope:{t:e},components:{Alert:b.Alert,SignupFormSettings:C,FormTab:E.FormTab},schema:{type:"object",properties:{notice:{type:"void","x-decorator":"FormItem","x-component":"Alert","x-component-props":{showIcon:!0,message:'{{t("The authentication allows users to sign in via username or email.")}}'}},collapse:{type:"void","x-component":"FormTab",properties:{basic:{type:"void","x-component":"FormTab.TabPane","x-component-props":{tab:(0,a.vV)("Sign up settings")},properties:T({"public.allowSignUp":{"x-decorator":"FormItem",type:"boolean",title:'{{t("Allow to sign up")}}',"x-component":"Checkbox",default:!0}},(0,v.uid)(),{type:"void","x-component":"SignupFormSettings"})},forgetPassword:{type:"void","x-component":"FormTab.TabPane","x-component-props":{tab:(0,a.vV)("Forgot password")},properties:{"public.enableResetPassword":{"x-decorator":"FormItem",type:"boolean",title:'{{t("Enable forget password")}}',"x-component":"Checkbox",default:!1},divider1:{type:"void","x-component":function(){return i().createElement(b.Divider,{orientation:"left",orientationMargin:"0"},e("1. Select notification channel"))},"x-reactions":[{dependencies:[".public.enableResetPassword"],fulfill:{state:{visible:"{{$deps[0]}}"}}}]},notificationChannel:{type:"string",title:'{{t("Notification channel (Email)")}}',required:!0,"x-decorator":"FormItem","x-component":"RemoteSelect","x-component-props":{multiple:!1,manual:!1,fieldNames:{label:"title",value:"name"},service:{resource:"notificationChannels",action:"list",params:{filter:{notificationType:"email"}}},notFoundContent:n},"x-reactions":[{dependencies:[".public.enableResetPassword"],fulfill:{state:{visible:"{{$deps[0]}}"}}}],description:'{{t("The notification channel used to send the reset password email, only support email channel")}}'},divider2:{type:"void","x-component":function(){return i().createElement(b.Divider,{orientation:"left",orientationMargin:"0"},e("2. Configure reset email"))},"x-reactions":[{dependencies:[".public.enableResetPassword"],fulfill:{state:{visible:"{{$deps[0]}}"}}}]},emailSubject:{type:"string",required:!0,title:'{{t("Subject")}}',"x-decorator":"FormItem","x-component":"Variable.TextArea","x-component-props":{scope:I(t)},"x-reactions":[{dependencies:[".public.enableResetPassword"],fulfill:{state:{visible:"{{$deps[0]}}",initialValue:'{{t("defaultResetPasswordEmailSubject")}}'}}}],default:'{{t("defaultResetPasswordEmailSubject")}}'},emailContentType:{type:"string",title:'{{t("Content type")}}',required:!0,"x-decorator":"FormItem","x-component":"Radio.Group",enum:[{label:"HTML",value:"html"},{label:'{{t("Plain text")}}',value:"text"}],default:"html","x-reactions":[{dependencies:[".public.enableResetPassword"],fulfill:{state:{visible:"{{$deps[0]}}",initialValue:"html"}}}]},emailContentHTML:{type:"string",required:!0,title:'{{t("Content")}}',"x-decorator":"FormItem","x-component":"Variable.RawTextArea","x-component-props":{scope:I(t),placeholder:"Hi,",autoSize:{minRows:10}},"x-reactions":[{dependencies:[".public.enableResetPassword",".emailContentType"],fulfill:{state:{visible:'{{$deps[0] && $deps[1] === "html"}}',initialValue:'{{t("defaultResetPasswordEmailContentHTML")}}'}}}],default:'{{t("defaultResetPasswordEmailContentHTML")}}'},emailContentText:{type:"string",required:!0,title:'{{t("Content")}}',"x-decorator":"FormItem","x-component":"Variable.RawTextArea","x-component-props":{scope:I(t),autoSize:{minRows:10}},"x-reactions":[{dependencies:[".public.enableResetPassword",".emailContentType"],fulfill:{state:{visible:'{{$deps[0] && $deps[1] === "text"}}',initialValue:'{{t("defaultResetPasswordEmailContentText")}}'}}}],default:'{{t("defaultResetPasswordEmailContentText")}}'},resetTokenExpiresIn:{type:"number",title:'{{t("Reset link expiration")}}',"x-decorator":"FormItem","x-component":"InputNumber","x-component-props":{suffix:e("Minutes"),style:{width:"100%"}},default:120,required:!0,"x-reactions":[{dependencies:[".public.enableResetPassword"],fulfill:{state:{visible:"{{$deps[0]}}",initialValue:120}}}]}}}}}}}})}},872:function(e,t,n){"use strict";n.d(t,{CU:function(){return i},dE:function(){return a},vV:function(){return u}});var r=n(953),o=n(342),i="auth";function a(){return(0,r.useTranslation)([i,"client"],{nsMode:"fallback"})}function u(e){return o.i18n.t(e,{ns:[i,"client"],nsMode:"fallback"})}},350:function(e,t,n){"use strict";n.r(t),n.d(t,{AuthLayout:function(){return d},useSignInButtons:function(){return P},SignUpPage:function(){return I},useSignInForms:function(){return S},useSignUpForms:function(){return k},SignupPageContext:function(){return T},AuthenticatorsContextProvider:function(){return f},SignupPageProvider:function(){return A},SignInPage:function(){return O}});var r=n(477),o=n(342),i=n(59),a=n(155),u=n.n(a),c=n(442),l=n(953),s=n(706);function p(){var e,t,n=(e=["\n position: absolute;\n bottom: 0;\n width: 100%;\n left: 0;\n text-align: center;\n padding-bottom: 24px;\n background-color: ",";\n "],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return p=function(){return n},n}var f=function(e){var t=e.children,n=(0,o.useAPIClient)(),r=(0,o.useRequest)(function(){return n.resource("authenticators").publicList().then(function(e){var t;return(null==e||null==(t=e.data)?void 0:t.data)||[]})}),a=r.data,c=r.error;if(r.loading)return u().createElement("div",{style:{textAlign:"center",marginTop:20}},u().createElement(i.Spin,null));if(c)throw c;return u().createElement(s.m.Provider,{value:void 0===a?[]:a},t)};function d(){var e,t=((0,o.useSystemSettings)()||{}).data,n=(0,o.useToken)().token,i=(0,l.useTranslation)("lm-collections").t;return u().createElement("div",{style:{maxWidth:320,margin:"0 auto",paddingTop:"20vh",paddingBottom:"20vh"}},u().createElement("div",{style:{position:"fixed",top:"2em",right:"2em"}},u().createElement(o.SwitchLanguage,null)),u().createElement("h1",{style:{textAlign:"center"}},u().createElement(o.ReadPretty.TextArea,{value:i(null==t||null==(e=t.data)?void 0:e.title)})),u().createElement(f,null,u().createElement(c.Outlet,null)),u().createElement("div",{className:(0,r.css)(p(),n.colorBgContainer)},u().createElement(o.PoweredBy,null)))}var m=n(574),y=n(872),v=n(230);function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function h(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){u=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function w(){var e=g(["\n display: flex;\n "]);return w=function(){return e},e}function x(){var e=g(["\n display: flex;\n "]);return x=function(){return e},e}var S=function(){var e=(0,o.usePlugin)(m.default).authTypes.getEntities(),t={},n=!0,r=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(n=(a=u.next()).done);n=!0){var c,l=h(a.value,2),s=l[0],p=l[1];(null==(c=p.components)?void 0:c.SignInForm)&&(t[s]=p.components.SignInForm)}}catch(e){r=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(r)throw i}}return t},P=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=(0,o.usePlugin)(m.default).authTypes.getEntities(),n={},r=!0,i=!1,a=void 0;try{for(var c,l=t[Symbol.iterator]();!(r=(c=l.next()).done);r=!0){var s,p=h(c.value,2),f=p[0],d=p[1];(null==(s=d.components)?void 0:s.SignInButton)&&(n[f]=d.components.SignInButton)}}catch(e){i=!0,a=e}finally{try{r||null==l.return||l.return()}finally{if(i)throw a}}var y=Object.keys(n);return e.filter(function(e){return y.includes(e.authType)}).map(function(e,t){return u().createElement(n[e.authType],{key:t,authenticator:e})})},O=function(){var e=(0,y.dE)().t;(0,o.useCurrentDocumentTitle)("Signin"),(0,o.useViewport)();var t=S(),n=(0,a.useContext)(s.m),c=P(n);if(!n.length)return u().createElement("div",{style:{color:"#ccc"}},e("No authentication methods available."));var l=n.map(function(n){var r=t[n.authType];if(r){var o="".concat(e("Sign-in")," (").concat(v.Schema.compile(n.authTypeTitle||n.authType,{t:e}),")");return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({component:(0,a.createElement)(r,{authenticator:n}),tabTitle:n.title||o},n)}}).filter(function(e){return e});return u().createElement(i.Space,{direction:"vertical",className:(0,r.css)(w())},l.length>1?u().createElement(i.Tabs,{items:l.map(function(e){return{label:e.tabTitle,key:e.name,children:e.component}})}):l.length?u().createElement("div",null,l[0].component):u().createElement(u().Fragment,null),u().createElement(i.Space,{direction:"vertical",className:(0,r.css)(x())},c))};function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function j(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){u=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return E(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return E(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var T=(0,a.createContext)({});T.displayName="SignupPageContext";var A=function(e){var t=(0,a.useContext)(T);return t[e.authType]={component:e.component},u().createElement(T.Provider,{value:t},e.children)},k=function(){var e=(0,o.usePlugin)(m.default).authTypes.getEntities(),t={},n=!0,r=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(n=(a=u.next()).done);n=!0){var c,l=j(a.value,2),s=l[0],p=l[1];(null==(c=p.components)?void 0:c.SignUpForm)&&(t[s]=p.components.SignUpForm)}}catch(e){r=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(r)throw i}}return t},I=function(){(0,o.useViewport)(),(0,o.useCurrentDocumentTitle)("Signup");var e=k(),t=j((0,c.useSearchParams)(),1)[0].get("name"),n=((0,s.p)(t)||{}).authType;return e[n]?(0,a.createElement)(e[n],{authenticatorName:t}):u().createElement(c.Navigate,{to:"/not-found",replace:!0})}},375:function(e){"use strict";e.exports=i},477:function(e){"use strict";e.exports=t},418:function(e){"use strict";e.exports=r},452:function(e){"use strict";e.exports=s},230:function(e){"use strict";e.exports=o},166:function(e){"use strict";e.exports=a},342:function(e){"use strict";e.exports=l},768:function(e){"use strict";e.exports=p},59:function(e){"use strict";e.exports=c},155:function(e){"use strict";e.exports=u},953:function(t){"use strict";t.exports=e},442:function(e){"use strict";e.exports=n},754:function(e,t,n){"use strict";var r="",o="u">typeof document?document.currentScript:null;if(o&&o.src&&(r=o.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")),!r){var i=window.__webpack_public_path__||"";i&&("/"!==i.charAt(i.length-1)&&(i+="/"),r=i+"static/plugins/@nocobase/plugin-auth/dist/client/")}if(!r){if(!(r=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var a=window.location.pathname||"/",u=a.indexOf("/v2/");r=u>=0?a.slice(0,u+1):"/"}r&&(r=r.replace(/\/v2\/?$/,"/")),r||(r="/"),"/"!==r.charAt(r.length-1)&&(r+="/"),r+="static/plugins/@nocobase/plugin-auth/dist/client/"}n.p=r}},v={};function b(e){var t=v[e];if(void 0!==t)return t.exports;var n=v[e]={exports:{}};return y[e](n,n.exports,b),n.exports}b.m=y,b.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return b.d(t,{a:t}),t},b.d=function(e,t){for(var n in t)b.o(t,n)&&!b.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},b.f={},b.e=function(e){return Promise.all(Object.keys(b.f).reduce(function(t,n){return b.f[n](e,t),t},[]))},b.u=function(e){return""+e+"."+({443:"634aca1f12f4906b",611:"bf903b6a5490becc",680:"c44d0f336fd828c0"})[e]+".js"},b.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),b.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},h={},b.l=function(e,t,n,r){if(h[e])return void h[e].push(t);if(void 0!==n)for(var o,i,a=document.getElementsByTagName("script"),u=0;u<a.length;u++){var c=a[u];if(c.getAttribute("src")==e||c.getAttribute("data-rspack")=="@nocobase/plugin-auth:"+n){o=c;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,b.nc&&o.setAttribute("nonce",b.nc),o.setAttribute("data-rspack","@nocobase/plugin-auth:"+n),o.src=e),h[e]=[t];var l=function(t,n){o.onerror=o.onload=null,clearTimeout(s);var r=h[e];if(delete h[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=l.bind(null,o.onerror),o.onload=l.bind(null,o.onload),i&&document.head.appendChild(o)},b.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},b.g.importScripts&&(g=b.g.location+"");var h,g,w=b.g.document;if(!g&&w&&(w.currentScript&&"SCRIPT"===w.currentScript.tagName.toUpperCase()&&(g=w.currentScript.src),!g)){var x=w.getElementsByTagName("script");if(x.length)for(var S=x.length-1;S>-1&&(!g||!/^http(s?):/.test(g));)g=x[S--].src}if(!g)throw Error("Automatic publicPath is not supported in this browser");return b.p=g.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),f={889:0},b.f.j=function(e,t){var n=b.o(f,e)?f[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=f[e]=[t,r]});t.push(n[2]=r);var o=b.p+b.u(e),i=Error();b.l(o,function(t){if(b.o(f,e)&&(0!==(n=f[e])&&(f[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,n[1](i)}},"chunk-"+e,e)}},d=function(e,t){var n,r,o=t[0],i=t[1],a=t[2],u=0;if(o.some(function(e){return 0!==f[e]})){for(n in i)b.o(i,n)&&(b.m[n]=i[n]);a&&a(b)}for(e&&e(t);u<o.length;u++)r=o[u],b.o(f,r)&&f[r]&&f[r][0](),f[r]=0},(m=self.webpackChunk_nocobase_plugin_auth=self.webpackChunk_nocobase_plugin_auth||[]).forEach(d.bind(null,0)),m.push=d.bind(null,m.push.bind(m)),b(754),b(574)}()});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
/// <reference types="react" />
|
|
10
|
+
export type Authenticator = {
|
|
11
|
+
name: string;
|
|
12
|
+
authType: string;
|
|
13
|
+
authTypeTitle: string;
|
|
14
|
+
title?: string;
|
|
15
|
+
options?: Record<string, any>;
|
|
16
|
+
sort?: number;
|
|
17
|
+
};
|
|
18
|
+
export declare const AuthenticatorsContext: import("react").Context<Authenticator[]>;
|
|
19
|
+
export declare const useAuthenticator: (name?: string | null) => Authenticator;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
export default function PoweredByLite(): React.JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
export default function SwitchLanguage(): React.JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { type Authenticator } from '../authenticator';
|
|
11
|
+
export declare function BasicSignInForm({ authenticator }: {
|
|
12
|
+
authenticator: Authenticator;
|
|
13
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
type SignUpFormProps = {
|
|
11
|
+
authenticatorName: string;
|
|
12
|
+
};
|
|
13
|
+
export declare function BasicSignUpForm({ authenticatorName }: SignUpFormProps): React.JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useRedirect(next?: string): () => void;
|
|
10
|
+
export declare function useDocumentTitle(title: string): void;
|
|
11
|
+
export declare function useSignIn(authenticator: string): {
|
|
12
|
+
run(values: Record<string, any>): Promise<void>;
|
|
13
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
export { default } from './plugin';
|
|
10
|
+
export * from './plugin';
|
|
11
|
+
export * from './authenticator';
|
|
12
|
+
export * from './locale';
|
|
13
|
+
export * from './hooks';
|
|
14
|
+
export { default as AuthLayout } from './pages/AuthLayout';
|
|
15
|
+
export { default as SignInPage } from './pages/SignInPage';
|
|
16
|
+
export { default as SignUpPage } from './pages/SignUpPage';
|
|
17
|
+
export { default as ForgotPasswordPage } from './pages/ForgotPasswordPage';
|
|
18
|
+
export { default as ResetPasswordPage } from './pages/ResetPasswordPage';
|
|
19
|
+
export { default as AuthProvider } from './providers/AuthProvider';
|
|
20
|
+
export { default as AuthenticatorsContextProvider } from './providers/AuthenticatorsContextProvider';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react-i18next"),require("react-router-dom"),require("@formily/react"),require("@ant-design/icons"),require("@nocobase/client-v2"),require("antd"),require("react"),require("@nocobase/utils/client")):"function"==typeof define&&define.amd?define("@nocobase/plugin-auth",["react-i18next","react-router-dom","@formily/react","@ant-design/icons","@nocobase/client-v2","antd","react","@nocobase/utils/client"],t):"object"==typeof exports?exports["@nocobase/plugin-auth"]=t(require("react-i18next"),require("react-router-dom"),require("@formily/react"),require("@ant-design/icons"),require("@nocobase/client-v2"),require("antd"),require("react"),require("@nocobase/utils/client")):e["@nocobase/plugin-auth"]=t(e["react-i18next"],e["react-router-dom"],e["@formily/react"],e["@ant-design/icons"],e["@nocobase/client-v2"],e.antd,e.react,e["@nocobase/utils/client"])}(self,function(e,t,n,r,o,i,a,l){return function(){var s={432:function(e,t,n){e.exports=n(36).Symbol},77:function(e,t,n){var r=n(432),o=n(444),i=n(371),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?o(e):i(e)}},625:function(e,t,n){var r=n(531),o=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(o,""):e}},565:function(e,t,n){e.exports="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g},444:function(e,t,n){var r=n(432),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,l=r?r.toStringTag:void 0;e.exports=function(e){var t=i.call(e,l),n=e[l];try{e[l]=void 0;var r=!0}catch(e){}var o=a.call(e);return r&&(t?e[l]=n:delete e[l]),o}},371:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},36:function(e,t,n){var r=n(565),o="object"==typeof self&&self&&self.Object===Object&&self;e.exports=r||o||Function("return this")()},531:function(e){var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},738:function(e,t,n){var r=n(130),o=n(593),i=n(909),a=Math.max,l=Math.min;e.exports=function(e,t,n){var s,u,c,f,p,d,m=0,h=!1,y=!1,g=!0;if("function"!=typeof e)throw TypeError("Expected a function");function v(t){var n=s,r=u;return s=u=void 0,m=t,f=e.apply(r,n)}function b(e){var n=e-d,r=e-m;return void 0===d||n>=t||n<0||y&&r>=c}function w(){var e,n,r,i=o();if(b(i))return S(i);p=setTimeout(w,(e=i-d,n=i-m,r=t-e,y?l(r,c-n):r))}function S(e){return(p=void 0,g&&s)?v(e):(s=u=void 0,f)}function E(){var e,n=o(),r=b(n);if(s=arguments,u=this,d=n,r){if(void 0===p)return m=e=d,p=setTimeout(w,t),h?v(e):f;if(y)return clearTimeout(p),p=setTimeout(w,t),v(d)}return void 0===p&&(p=setTimeout(w,t)),f}return t=i(t)||0,r(n)&&(h=!!n.leading,c=(y="maxWait"in n)?a(i(n.maxWait)||0,t):c,g="trailing"in n?!!n.trailing:g),E.cancel=function(){void 0!==p&&clearTimeout(p),m=0,s=d=u=p=void 0},E.flush=function(){return void 0===p?f:S(o())},E}},130:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},189:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},733:function(e,t,n){var r=n(77),o=n(189);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},593:function(e,t,n){var r=n(36);e.exports=function(){return r.Date.now()}},909:function(e,t,n){var r=n(625),o=n(130),i=n(733),a=0/0,l=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(i(e))return a;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=s.test(e);return n||u.test(e)?c(e.slice(2),n?2:8):l.test(e)?a:+e}},14:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return m}});var r=n(59),o=n(155),i=n.n(o),a=n(442),l=n(953),s=n(485),u=n(89),c=n(375),f={"en-US":"English","zh-CN":"简体中文"};function p(){var e,t=(0,s.useApp)(),n=((0,s.useSystemSettings)()||{}).data,o=(null==n||null==(e=n.data)?void 0:e.enabledLanguages)||[];return o.length<=1?null:i().createElement(r.Dropdown,{menu:{selectable:!0,defaultSelectedKeys:[t.apiClient.auth.locale],items:o.map(function(e){return{key:e,label:f[e]||e}}),onClick:function(e){var n=e.key;t.apiClient.auth.setLocale(String(n)),window.location.reload()}}},i().createElement(c.TranslationOutlined,{style:{fontSize:20,color:"inherit"}}))}function d(){var e=r.theme.useToken().token,t="zh-CN"===(0,l.useTranslation)().i18n.language?"https://www.nocobase.com/cn/":"https://www.nocobase.com";return i().createElement("div",{style:{color:e.colorTextDescription}},"Powered by"," ",i().createElement("a",{href:t,target:"_blank",rel:"noreferrer",style:{color:e.colorTextDescription}},"NocoBase"))}function m(){var e,t=r.theme.useToken().token,n=((0,s.useSystemSettings)()||{}).data,o=(0,l.useTranslation)("lm-collections").t;return i().createElement("div",{style:{maxWidth:320,margin:"0 auto",paddingTop:"20vh",paddingBottom:"20vh"}},i().createElement("div",{style:{position:"fixed",top:t.paddingLG,right:t.paddingLG,color:t.colorText}},i().createElement(p,null)),i().createElement("h1",{style:{textAlign:"center"}},o(null==n||null==(e=n.data)?void 0:e.title)),i().createElement(u.A,null,i().createElement(a.Outlet,null)),i().createElement("div",{style:{position:"absolute",bottom:0,left:0,width:"100%",paddingBottom:t.paddingLG,textAlign:"center",backgroundColor:t.colorBgContainer}},i().createElement(d,null)))}},826:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return m}});var r=n(59),o=n(155),i=n.n(o),a=n(442),l=n(485),s=n(295),u=n(816),c=n(824);function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function p(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(){var e,t=(0,l.useApp)(),n=(0,u.dE)().t,f=d((0,a.useSearchParams)(),1)[0].get("name"),m=(0,s.p)(f),h=d(r.Form.useForm(),1)[0],y=d((0,o.useState)(!1),2),g=y[0],v=y[1],b=d((0,o.useState)(""),2),w=b[0],S=b[1];return((0,c.rN)(n("Reset password")),null==m||null==(e=m.options)?void 0:e.enableResetPassword)?i().createElement(r.Form,{form:h,layout:"vertical",onFinish:function(e){var o;return(o=function(){var o,i,a,l,s;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var u=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(u){switch(u.label){case 0:S(""),v(!0),u.label=1;case 1:return u.trys.push([1,3,4,5]),[4,t.apiClient.auth.lostPassword(e)];case 2:return u.sent(),r.message.success(n("Reset email sent successfully")),h.resetFields(),[3,5];case 3:return S((null==(o=u.sent())||null==(s=o.response)||null==(l=s.data)||null==(a=l.errors)||null==(i=a[0])?void 0:i.message)||(null==o?void 0:o.message)||String(o)),[3,5];case 4:return v(!1),[7];case 5:return[2]}})},function(){var e=this,t=arguments;return new Promise(function(n,r){var i=o.apply(e,t);function a(e){p(i,n,r,a,l,"next",e)}function l(e){p(i,n,r,a,l,"throw",e)}a(void 0)})})()}},w?i().createElement(r.Alert,{style:{marginBottom:16},type:"error",showIcon:!0,message:w}):null,i().createElement(r.Form.Item,{label:n("Reset password"),name:"email",rules:[{required:!0,message:n("Please fill in your email address")},{type:"email",message:n("Please enter a valid email")}]},i().createElement(r.Input,{placeholder:n("Please enter your email")})),i().createElement(r.Form.Item,{style:{marginBottom:12}},i().createElement(r.Button,{loading:g,htmlType:"submit",type:"primary",block:!0},n("Send reset email"))),i().createElement(a.Link,{to:"/signin"},n("Back to login"))):i().createElement(a.Navigate,{to:"/signin",replace:!0})}},622:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return m}});var r=n(59),o=n(155),i=n.n(o),a=n(442),l=n(485),s=n(295),u=n(816),c=n(824);function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function p(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(){var e,t=(0,l.useApp)(),n=(0,u.dE)().t,f=(0,a.useNavigate)(),m=d((0,a.useSearchParams)(),1)[0],h=m.get("resetToken"),y=m.get("name"),g=(0,s.p)(y),v=d(r.Form.useForm(),1)[0],b=d((0,o.useState)(!1),2),w=b[0],S=b[1],E=d((0,o.useState)(!0),2),T=E[0],P=E[1],k=d((0,o.useState)(!1),2),x=k[0],A=k[1],I=d((0,o.useState)(""),2),O=I[0],j=I[1];return((0,c.rN)(n("Reset password")),(0,o.useEffect)(function(){var e=!0;if(!h){S(!0),P(!1);return}return t.apiClient.auth.checkResetToken({resetToken:h}).then(function(){e&&(S(!1),P(!1))}).catch(function(){e&&(S(!0),P(!1))}),function(){e=!1}},[t,h]),null==g||null==(e=g.options)?void 0:e.enableResetPassword)?T||h&&!w?i().createElement(r.Form,{form:v,layout:"vertical",onFinish:function(e){var o;return(o=function(){var o,i,a,l,s;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var u=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(u){switch(u.label){case 0:j(""),A(!0),u.label=1;case 1:var c,p;return u.trys.push([1,3,4,5]),[4,t.apiClient.auth.resetPassword((c=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},e),p=p={resetToken:h},Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(p)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(p)).forEach(function(e){Object.defineProperty(c,e,Object.getOwnPropertyDescriptor(p,e))}),c))];case 2:return u.sent(),r.message.success(n("Password reset successful")),window.setTimeout(function(){f("/signin",{replace:!0})},1e3),[3,5];case 3:return j((null==(o=u.sent())||null==(s=o.response)||null==(l=s.data)||null==(a=l.errors)||null==(i=a[0])?void 0:i.message)||(null==o?void 0:o.message)||String(o)),[3,5];case 4:return A(!1),[7];case 5:return[2]}})},function(){var e=this,t=arguments;return new Promise(function(n,r){var i=o.apply(e,t);function a(e){p(i,n,r,a,l,"next",e)}function l(e){p(i,n,r,a,l,"throw",e)}a(void 0)})})()}},O?i().createElement(r.Alert,{style:{marginBottom:16},type:"error",showIcon:!0,message:O}):null,i().createElement(r.Form.Item,{label:n("New password"),name:"password",rules:[{required:!0,message:n("Please enter new password")}]},i().createElement(r.Input.Password,{autoComplete:"new-password"})),i().createElement(r.Form.Item,{label:n("Confirm password"),name:"confirmPassword",dependencies:["password"],rules:[{required:!0,message:n("Please enter the same password again")},function(e){var t=e.getFieldValue;return{validator:function(e,r){return r&&t("password")!==r?Promise.reject(Error(n("The passwords entered twice are inconsistent"))):Promise.resolve()}}}]},i().createElement(r.Input.Password,{autoComplete:"new-password"})),i().createElement(r.Form.Item,{style:{marginBottom:12}},i().createElement(r.Button,{loading:x||T,htmlType:"submit",type:"primary",block:!0},n("Confirm"))),i().createElement(a.Link,{to:"/signin"},n("Go to login"))):i().createElement(r.Result,{status:"403",title:n("Reset link has expired"),extra:i().createElement(r.Button,{type:"primary",onClick:function(){return f("/signin")}},n("Go to login"))}):i().createElement(a.Navigate,{to:"/signin",replace:!0})}},818:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return h},useSignInButtons:function(){return m},useSignInForms:function(){return d}});var r=n(59),o=n(155),i=n.n(o),a=n(485),l=n(514),s=n(295),u=n(816),c=n(824);function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(){var e=(0,a.usePlugin)(l.A).authTypes.getEntities(),t={},n=!0,r=!1,o=void 0;try{for(var i,s=e[Symbol.iterator]();!(n=(i=s.next()).done);n=!0){var u,c=p(i.value,2),f=c[0],d=c[1];(null==(u=d.components)?void 0:u.SignInForm)&&(t[f]=d.components.SignInForm)}}catch(e){r=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(r)throw o}}return t}function m(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=(0,a.usePlugin)(l.A).authTypes.getEntities(),n={},r=!0,i=!1,s=void 0;try{for(var u,c=t[Symbol.iterator]();!(r=(u=c.next()).done);r=!0){var f,d=p(u.value,2),m=d[0],h=d[1];(null==(f=h.components)?void 0:f.SignInButton)&&(n[m]=h.components.SignInButton)}}catch(e){i=!0,s=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw s}}return e.filter(function(e){return n[e.authType]}).map(function(e,t){return(0,o.createElement)(n[e.authType],{key:"".concat(e.name,"-").concat(t),authenticator:e})})}function h(){var e=(0,u.dE)().t,t=d(),n=(0,o.useContext)(s.m),a=m(n);(0,c.rN)(e("Signin"));var l=(0,o.useMemo)(function(){return n.map(function(n){var r=t[n.authType];return r?{key:n.name,label:n.title||"".concat(e("Sign-in")," (").concat(n.authTypeTitle||n.authType,")"),children:(0,o.createElement)(r,{authenticator:n})}:null}).filter(Boolean)},[n,t,e]);return n.length?i().createElement(r.Space,{direction:"vertical",style:{display:"flex"}},l.length>1?i().createElement(r.Tabs,{items:l}):l.length?l[0].children:null,a.length?i().createElement(r.Space,{direction:"vertical"},a):null):i().createElement(r.Empty,{description:e("No authentication methods available.")})}},872:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return h},useSignUpForms:function(){return m}});var r=n(155),o=n.n(r),i=n(59),a=n(442),l=n(485),s=n(514),u=n(295),c=n(816),f=n(824);function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(){var e=(0,l.usePlugin)(s.A).authTypes.getEntities(),t={},n=!0,r=!1,o=void 0;try{for(var i,a=e[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var u,c=d(i.value,2),f=c[0],p=c[1];(null==(u=p.components)?void 0:u.SignUpForm)&&(t[f]=p.components.SignUpForm)}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}return t}function h(){var e=(0,c.dE)().t,t=d((0,a.useSearchParams)(),1)[0].get("name"),n=(0,u.p)(t),r=m();if((0,f.rN)(e("Signup")),!n)return o().createElement(i.Empty,{description:e("No authentication methods available.")});var l=r[n.authType];return l?o().createElement(l,{authenticatorName:n.name}):o().createElement(i.Empty,{description:e("No authentication methods available.")})}},514:function(e,t,n){"use strict";n.d(t,{A:function(){return G},T:function(){return K}});var r=n(768),o=n(485),i=n(738),a=n.n(i),l=n(258),s=n(59),u=n(155),c=n.n(u),f=n(442),p=n(816),d=n(824);function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function h(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return m(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return m(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e){var t,n,r=e.authenticator,o=(0,p.dE)().t,i=y(s.Form.useForm(),1)[0],a=y((0,u.useState)(""),2),l=a[0],m=a[1],g=y((0,u.useState)(!1),2),v=g[0],b=g[1],w=(0,d.go)(r.name),S=!!(null==r||null==(t=r.options)?void 0:t.allowSignUp),E=!!(null==r||null==(n=r.options)?void 0:n.enableResetPassword);return c().createElement(s.Form,{form:i,layout:"vertical",onFinish:function(e){var t;return(t=function(){var t,n,r,o,i;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var u=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(a){switch(a.label){case 0:m(""),b(!0),a.label=1;case 1:return a.trys.push([1,3,4,5]),[4,w.run(e)];case 2:return a.sent(),[3,5];case 3:return m((null==(t=a.sent())||null==(i=t.response)||null==(o=i.data)||null==(r=o.errors)||null==(n=r[0])?void 0:n.message)||(null==t?void 0:t.message)||String(t)),[3,5];case 4:return b(!1),[7];case 5:return[2]}})},function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(e){h(i,r,o,a,l,"next",e)}function l(e){h(i,r,o,a,l,"throw",e)}a(void 0)})})()}},l?c().createElement(s.Alert,{style:{marginBottom:16},type:"error",showIcon:!0,message:l}):null,c().createElement(s.Form.Item,{name:"account",rules:[{required:!0,message:o("Please enter your username or email")},{validator:function(e,t){return t?String(t).includes("@")?/^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/.test(String(t))?Promise.resolve():Promise.reject(Error(o("Please enter a valid email"))):/^[^@<>"'/]{1,50}$/.test(String(t))?Promise.resolve():Promise.reject(Error(o("Please enter a valid username"))):Promise.resolve()}}]},c().createElement(s.Input,{autoComplete:"username",placeholder:o("Username/Email")})),c().createElement(s.Form.Item,{name:"password",rules:[{required:!0,message:o("Please enter a password")}]},c().createElement(s.Input.Password,{autoComplete:"current-password",placeholder:o("Password")})),c().createElement(s.Form.Item,{style:{marginBottom:12}},c().createElement(s.Button,{loading:v,htmlType:"submit",type:"primary",block:!0},o("Sign in"))),c().createElement("div",{style:{display:"flex",justifyContent:"space-between",gap:12}},S?c().createElement(f.Link,{to:"/signup?name=".concat(r.name)},o("Create an account")):null,E?c().createElement(f.Link,{to:"/forgot-password?name=".concat(r.name)},o("Forgot password")):null))}var v=n(230),b=n(953),w=n(295);function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function E(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function T(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return S(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return S(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function P(e){var t,n=e.authenticatorName,r=(0,o.useApp)(),i=(0,f.useNavigate)(),a=(0,p.dE)().t,l=(0,b.useTranslation)("lm-collections").t,d=(0,w.p)(n),m=T(s.Form.useForm(),1)[0],h=T((0,u.useState)(!1),2),y=h[0],g=h[1],S=T((0,u.useState)(""),2),P=S[0],k=S[1],x=(0,u.useMemo)(function(){var e;return((null==d||null==(e=d.options)?void 0:e.signupForm)||[]).filter(function(e){return null==e?void 0:e.show})},[d]);return(null==d||null==(t=d.options)?void 0:t.allowSignUp)?c().createElement(s.Form,{form:m,layout:"vertical",onFinish:function(e){var t;return(t=function(){var t,o,l,u,c;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var u=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(f){switch(f.label){case 0:k(""),g(!0),f.label=1;case 1:return f.trys.push([1,3,4,5]),[4,r.apiClient.auth.signUp(e,n)];case 2:return f.sent(),s.message.success(a("Sign up successfully, and automatically jump to the sign in page")),window.setTimeout(function(){i("/signin",{replace:!0})},2e3),[3,5];case 3:return k((null==(t=f.sent())||null==(c=t.response)||null==(u=c.data)||null==(l=u.errors)||null==(o=l[0])?void 0:o.message)||(null==t?void 0:t.message)||String(t)),[3,5];case 4:return g(!1),[7];case 5:return[2]}})},function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(e){E(i,r,o,a,l,"next",e)}function l(e){E(i,r,o,a,l,"throw",e)}a(void 0)})})()}},P?c().createElement(s.Alert,{style:{marginBottom:16},type:"error",showIcon:!0,message:P}):null,x.map(function(e){var t,n,r,o,i,u;return r=(n=(null==e?void 0:e.uiSchema)||{})["x-component"],o=n.title?l(v.Schema.compile(n.title,{t:a})):e.field,i=[],e.required&&i.push({required:!0,message:a("Please enter ".concat(e.field))}),"email"===e.field&&i.push({type:"email",message:a("Please enter a valid email address")}),u=c().createElement(s.Input,null),(null==(t=n.enum)?void 0:t.length)?u=c().createElement(s.Select,{options:n.enum.map(function(e){return{label:e.label||e.value,value:e.value}})}):"Checkbox"===r?u=c().createElement(s.Checkbox,null):("Input.TextArea"===r||"TextArea"===r)&&(u=c().createElement(s.Input.TextArea,{rows:4})),c().createElement(s.Form.Item,{key:e.field,name:e.field,label:o,valuePropName:"Checkbox"===r?"checked":"value",rules:i},u)}),c().createElement(s.Form.Item,{label:a("Password"),name:"password",rules:[{required:!0,message:a("Please enter a password")}]},c().createElement(s.Input.Password,{autoComplete:"new-password"})),c().createElement(s.Form.Item,{label:a("Confirm password"),name:"confirm_password",dependencies:["password"],rules:[{required:!0,message:a("Please enter the same password again")},function(e){var t=e.getFieldValue;return{validator:function(e,n){return n&&t("password")!==n?Promise.reject(Error(a("The passwords entered twice are inconsistent"))):Promise.resolve()}}}]},c().createElement(s.Input.Password,{autoComplete:"new-password"})),c().createElement(s.Form.Item,{style:{marginBottom:12}},c().createElement(s.Button,{loading:y,htmlType:"submit",type:"primary",block:!0},a("Sign up"))),c().createElement(f.Link,{to:"/signin"},a("Log in with an existing account"))):c().createElement(f.Navigate,{to:"/not-found",replace:!0})}function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function x(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function A(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){x(i,r,o,a,l,"next",e)}function l(e){x(i,r,o,a,l,"throw",e)}a(void 0)})}}function I(e,t,n){return t=_(t),function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e,$()?Reflect.construct(t,n||[],_(e).constructor):t.apply(e,n))}function O(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function j(e,t,n){return(j=$()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&U(o,n.prototype),o}).apply(null,arguments)}function C(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function N(e,t,n){return t&&C(e.prototype,t),n&&C(e,n),e}function R(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _(e){return(_=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function F(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&U(e,t)}function U(e,t){return(U=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function L(e){var t="function"==typeof Map?new Map:void 0;return(L=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return j(e,arguments,_(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),U(n,e)})(e)}function $(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return($=function(){return!!e})()}function q(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var u=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}var M=function(e){function t(){var e;return O(this,t),e=I(this,t,arguments),R(e,"section","preferences"),R(e,"sort",350),R(e,"label","Language"),e}return F(t,e),N(t,[{key:"prepare",value:function(){return A(function(){var e,t,n,r,i;return q(this,function(a){switch(a.label){case 0:return[4,this.context.systemSettings.load()];case 1:return i=(null==(r=a.sent())||null==(e=r.data)?void 0:e.enabledLanguages)||[],this.options=i.map(function(e){var t;return{value:e,label:(null==(t=o.languageCodes[e])?void 0:t.label)||e}}),this.value=(null==(t=(n=this.context.app.apiClient.auth).getLocale)?void 0:t.call(n))||this.context.app.apiClient.auth.locale,this.ready=this.options.length>1,[2]}})}).call(this)}},{key:"onChange",value:function(e){return A(function(){return q(this,function(t){return this.context.app.apiClient.auth.setLocale(e),window.location.reload(),[2]})}).call(this)}}]),t}(o.UserCenterSelectItemModel);R(M,"itemId","language");var B={EMPTY_TOKEN:"EMPTY_TOKEN",EXPIRED_TOKEN:"EXPIRED_TOKEN",INVALID_TOKEN:"INVALID_TOKEN",TOKEN_RENEW_FAILED:"TOKEN_RENEW_FAILED",BLOCKED_TOKEN:"BLOCKED_TOKEN",EXPIRED_SESSION:"EXPIRED_SESSION",NOT_EXIST_USER:"NOT_EXIST_USER",SKIP_TOKEN_RENEW:"SKIP_TOKEN_RENEW",USER_HAS_NO_ROLES_ERR:"USER_HAS_NO_ROLES_ERR"},D=a()(function(e){e()},3e3,{leading:!0,trailing:!1}),K=function(e){function t(){var e;return O(this,t),e=I(this,t,arguments),R(e,"authTypes",new r.Registry),e}return F(t,e),N(t,[{key:"registerType",value:function(e,t){this.authTypes.register(e,t)}},{key:"load",value:function(){return A(function(){var e;return q(this,function(t){return e=this,Object.entries(p._1).forEach(function(t){var n=function(e){if(Array.isArray(e))return e}(t)||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(t)||function(e){if(e){if("string"==typeof e)return k(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return k(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),r=n[0],o=n[1];e.app.i18n.addResources(r,p.CU,o)}),this.app.use(l.A),this.app.flowEngine.registerModels({UserCenterLanguageItemModel:M}),this.addRoutes(),this.registerPresetAuthType(),this.installInterceptors(),[2]})}).call(this)}},{key:"addRoutes",value:function(){this.router.add("auth",{componentLoader:function(){return Promise.resolve().then(n.bind(n,14))}}),this.router.add("auth.signin",{path:"/signin",skipAuthCheck:!0,componentLoader:function(){return Promise.resolve().then(n.bind(n,818))}}),this.router.add("auth.signup",{path:"/signup",skipAuthCheck:!0,componentLoader:function(){return Promise.resolve().then(n.bind(n,872))}}),this.router.add("auth.forgotPassword",{path:"/forgot-password",skipAuthCheck:!0,componentLoader:function(){return Promise.resolve().then(n.bind(n,826))}}),this.router.add("auth.resetPassword",{path:"/reset-password",skipAuthCheck:!0,componentLoader:function(){return Promise.resolve().then(n.bind(n,622))}})}},{key:"registerPresetAuthType",value:function(){this.registerType("Email/Password",{components:{SignInForm:g,SignUpForm:P}})}},{key:"installInterceptors",value:function(){var e=this;this.app.apiClient.axios.interceptors.response.handlers.unshift({fulfilled:function(t){var n,r=null==t||null==(n=t.headers)?void 0:n["x-new-token"];return r&&e.app.apiClient.auth.setToken(r),t},rejected:function(t){var n,r,i,a,l,s,u,c,f=null==t||null==(r=t.response)||null==(n=r.headers)?void 0:n["x-new-token"],p=null==t||null==(a=t.response)||null==(i=a.data)?void 0:i.errors,d=Array.isArray(p)?p[0]:null,m=(null==(s=e.app.router.router)||null==(l=s.state)?void 0:l.location)||window.location,h=(null==m?void 0:m.pathname)||window.location.pathname,y=(null==t?void 0:t.status)||(null==t||null==(u=t.response)?void 0:u.status);if(f&&e.app.apiClient.auth.setToken(f),401===y&&(null==d?void 0:d.code)&&B[null==d?void 0:d.code]&&(e.app.apiClient.auth.setToken(""),e.app.apiClient.auth.setRole(""),e.app.apiClient.auth.setAuthenticator("")),401===y&&!(null==(c=t.config)?void 0:c.skipAuth)&&(null==d?void 0:d.code)&&B[null==d?void 0:d.code]){if((null==d?void 0:d.code)===B.SKIP_TOKEN_RENEW)throw t;var g=e.app.router.isSkippedAuthCheckRoute(h);if(g&&(t.config.skipNotify=!0),!g){var v=(0,o.getCurrentV2RedirectPath)(e.app,m);return D(function(){e.app.apiClient.auth.setToken(""),(0,o.redirectToLegacySignin)(e.app,v,{replace:!0})}),new Promise(function(){})}}throw t},synchronous:!1,runWhen:null})}}]),t}(L(o.Plugin)),G=K},258:function(e,t,n){"use strict";var r=n(485),o=n(155),i=n.n(o),a=n(442);t.A=function(e){var t=e.children,n=(0,r.useApp)(),l=(0,a.useNavigate)(),s=(0,a.useLocation)();return(0,o.useEffect)(function(){var e=new URLSearchParams(s.search),t=e.get("token"),r=e.get("authenticator");if(t){n.apiClient.auth.setToken(t),n.apiClient.auth.setAuthenticator(r),e.delete("token");var o=e.toString();l({pathname:s.pathname,search:o?"?".concat(o):""},{replace:!0})}},[n,s.pathname,s.search,l]),i().createElement(i().Fragment,null,t)}},89:function(e,t,n){"use strict";var r=n(59),o=n(155),i=n.n(o),a=n(485),l=n(295);function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}t.A=function(e){var t,n,u=e.children,c=(0,a.useApp)(),f=function(e){if(Array.isArray(e))return e}(t=(0,o.useState)({authenticators:[],error:null,loading:!0}))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(t)||function(e){if(e){if("string"==typeof e)return s(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return s(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),p=f[0],d=f[1];return((0,o.useEffect)(function(){var e=!0;return c.apiClient.resource("authenticators").publicList().then(function(t){var n;e&&d({authenticators:(null==t||null==(n=t.data)?void 0:n.data)||[],error:null,loading:!1})}).catch(function(t){e&&d({authenticators:[],error:t,loading:!1})}),function(){e=!1}},[c]),p.loading)?i().createElement("div",{style:{textAlign:"center",marginTop:20}},i().createElement(r.Spin,null)):p.error?i().createElement(r.Alert,{type:"error",showIcon:!0,message:(null==(n=p.error)?void 0:n.message)||"Failed to load authenticators"}):i().createElement(l.m.Provider,{value:p.authenticators},u)}},295:function(e,t,n){"use strict";n.d(t,{m:function(){return o},p:function(){return i}});var r=n(155),o=(0,r.createContext)([]);o.displayName="AuthenticatorsContext";var i=function(e){return(0,r.useContext)(o).find(function(t){return t.name===e})}},824:function(e,t,n){"use strict";n.d(t,{go:function(){return c},rN:function(){return u},wn:function(){return s}});var r=n(155),o=n(442),i=n(485);function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function l(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function s(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/admin",n=(0,o.useNavigate)(),i=(function(e){if(Array.isArray(e))return e}(e=(0,o.useSearchParams)())||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),1!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(e)||function(e){if(e){if("string"==typeof e)return a(e,1);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return a(e,1)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0];return(0,r.useCallback)(function(){n(i.get("redirect")||t,{replace:!0})},[n,t,i])}function u(e){(0,r.useEffect)(function(){document.title=e},[e])}function c(e){var t=(0,i.useApp)(),n=s();return{run:function(r){var o;return(o=function(){return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var u=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(o){switch(o.label){case 0:return[4,t.apiClient.auth.signIn(r,e)];case 1:return o.sent(),n(),[2]}})},function(){var e=this,t=arguments;return new Promise(function(n,r){var i=o.apply(e,t);function a(e){l(i,n,r,a,s,"next",e)}function s(e){l(i,n,r,a,s,"throw",e)}a(void 0)})})()}}}},816:function(e,t,n){"use strict";n.d(t,{CU:function(){return a},_1:function(){return l},dE:function(){return s}});var r=n(953),o=JSON.parse('{"1. Select notification channel":"1. Select notification channel","2. Configure reset email":"2. Configure reset email","Allow to sign in with":"Allow to sign in with","Allow to sign up":"Allow to sign up","At least one of the username or email fields is required":"At least one of the username or email fields is required","Auth Type":"Auth Type","Auth UID":"Auth UID","Authentication":"Authentication","Authenticators":"Authenticators","Back to login":"Back to login","Content type":"Content type","Days":"Days","Email channel not found":"Email channel not found","Enable forget password":"Enable forget password","Expired token refresh limit":"Expired token refresh limit","Forgot password":"Forgot password","Go to login":"Go to login","Hours":"Hours","In configuration mode, the entire column becomes transparent. In non-configuration mode, the entire column will be hidden. Even if the entire column is hidden, its configured default values and other settings will still take effect.":"In configuration mode, the entire column becomes transparent. In non-configuration mode, the entire column will be hidden. Even if the entire column is hidden, its configured default values and other settings will still take effect.","Minutes":"Minutes","Missing X-Authenticator in request header":"Missing X-Authenticator in request header","No authentication methods available.":"No authentication methods available.","No notification channels found. Please ":"No notification channels found. Please ","Not a valid cellphone number, please re-enter":"Not a valid cellphone number, please re-enter","Not allowed to reset password":"Not allowed to reset password","Not allowed to sign up":"Not allowed to sign up","Notification channel (Email)":"Notification channel (Email)","Notification manager plugin not found":"Notification manager plugin not found","Password":"Password","Password is not allowed to be changed":"Password is not allowed to be changed","Password reset successful":"Password reset successful","Plain text":"Plain text","Please enter a password":"Please enter a password","Please enter a valid email":"Please enter a valid email","Please enter a valid username":"Please enter a valid username","Please enter new password":"Please enter new password","Please enter the same password again":"Please enter the same password again","Please enter your email":"Please enter your email","Please enter your username or email":"Please enter your username or email","Please keep and enable at least one authenticator":"Please keep and enable at least one authenticator","Reset email sent successfully":"Reset email sent successfully","Reset link expiration (minutes)":"Reset link expiration (minutes)","Reset link has expired":"Reset link has expired","Reset password":"Reset password","Reset password email":"Reset password email","Reset password link":"Reset password link","Saved successfully!":"Saved successfully!","Seconds":"Seconds","Send reset email":"Send reset email","Session validity period":"Session validity period","Show":"Show","Sign in via email":"Sign in via email","Sign in via password":"Sign in via password","Sign up form":"Sign up form","Sign up settings":"Sign up settings","Sign-in":"Sign-in","Subject":"Subject","The authentication allows users to sign in via username or email.":"The authentication allows users to sign in via username or email.","The maximum time limit allowed for refreshing a Token after it expires. After this time limit, the token cannot be automatically renewed, and the user needs to log in again.":"The maximum time limit allowed for refreshing a Token after it expires. After this time limit, the token cannot be automatically renewed, and the user needs to log in again.","The maximum valid time for each user login. During the session validity, the Token will be automatically updated. After the timeout, the user is required to log in again.":"The maximum valid time for each user login. During the session validity, the Token will be automatically updated. After the timeout, the user is required to log in again.","The notification channel used to send the reset password email, only support email channel":"The notification channel used to send the reset password email, only support email channel","The password is inconsistent, please re-enter":"The password is inconsistent, please re-enter","The password is incorrect, please re-enter":"The password is incorrect, please re-enter","The passwords entered twice are inconsistent":"The passwords entered twice are inconsistent","The phone number has been registered, please login directly":"The phone number has been registered, please login directly","The phone number is not registered, please register first":"The phone number is not registered, please register first","The username or email is incorrect, please re-enter":"The username or email is incorrect, please re-enter","The username/email or password is incorrect, please re-enter":"The username/email or password is incorrect, please re-enter","The validity period of each issued API Token. After the Token expires, if it is within the session validity period and has not exceeded the refresh limit, the server will automatically issue a new Token to maintain the user session, otherwise the user is required to log in again. (Each Token can only be refreshed once)":"The validity period of each issued API Token. After the Token expires, if it is within the session validity period and has not exceeded the refresh limit, the server will automatically issue a new Token to maintain the user session, otherwise the user is required to log in again. (Each Token can only be refreshed once)","Token expired":"Token expired","Token policy":"Token policy","Token validity period":"Token validity period","Token validity period must be less than session validity period!":"Token validity period must be less than session validity period!","Unauthenticated. Please sign in to continue.":"Unauthenticated. Please sign in to continue.","User not found":"User not found","User not found. Please sign in again to continue.":"User not found. Please sign in again to continue.","Username/Email":"Username/Email","Your session has expired. Please sign in again.":"Your session has expired. Please sign in again.","add one first":"add one first","defaultResetPasswordEmailContentHTML":"<p>Hello {{$user.username}},</p>\\n\\n<p>We received a request to reset the password for your {{$systemSettings.title}} account.</p>\\n\\n<p>Please click the link below to set your new password:</p>\\n\\n<p>\\n <a href=\\"{{$resetLink}}\\">Reset Your Password</a>\\n</p>\\n\\n<p>\\n If you did not request a password reset, please ignore this email. Your password will remain unchanged.\\n</p>\\n\\n<p>\\n Please note: For your security, this password reset link will expire in <strong>{{$resetLinkExpiration}} minutes</strong>.\\n</p>\\n\\n<p>If you encounter any issues resetting your password, please contact our support team.</p>\\n\\n<p>\\n Thanks,<br>\\n The {{$systemSettings.title}} Team\\n</p>","defaultResetPasswordEmailContentText":"Hello {{$user.username}},\\n\\nWe received a request to reset the password for your {{$systemSettings.title}} account.\\n\\nPlease click the link below to set your new password:\\n\\n{{$resetLink}}\\n\\nIf you did not request a password reset, please ignore this email. Your password will remain unchanged.\\n\\nPlease note: For your security, this password reset link will expire in {{$resetLinkExpiration}} minutes.\\n\\nIf you encounter any issues resetting your password, please contact our support team.\\n\\nThanks, The {{$systemSettings.title}} Team","defaultResetPasswordEmailSubject":"Reset your password for {{$systemSettings.title}}"}'),i=JSON.parse('{"1. Select notification channel":"1. 选择通知渠道","2. Configure reset email":"2. 配置重置邮件","Allow to sign in with":"允许使用以下方式登录","Allow to sign up":"允许注册","At least one of the username or email fields is required":"至少需要设置用户名或邮箱中的一个字段为必填字段","Auth Type":"认证类型","Auth UID":"认证标识","Authentication":"用户认证","Authenticators":"认证器","Back to login":"返回登录","Content type":"内容类型","Days":"天","Email channel not found":"未找到邮件通道","Enable forget password":"启用忘记密码功能","Expired token refresh limit":"过期 Token 刷新时限","Forgot password":"忘记密码","Go to login":"前往登录","Hours":"小时","In configuration mode, the entire column becomes transparent. In non-configuration mode, the entire column will be hidden. Even if the entire column is hidden, its configured default values and other settings will still take effect.":"In configuration mode, the entire column becomes transparent. In non-configuration mode, the entire column will be hidden. Even if the entire column is hidden, its configured default values and other settings will still take effect.","Minutes":"分钟","Missing X-Authenticator in request header":"请求头中缺少了 X-Authenticator","No authentication methods available.":"没有可用的认证方式。","No notification channels found. Please ":"未找到通知渠道,请","Not a valid cellphone number, please re-enter":"不是有效的手机号,请重新输入","Not allowed to reset password":"不允许重置密码","Not allowed to sign up":"禁止注册","Notification channel (Email)":"通知渠道(电子邮件)","Notification manager plugin not found":"未找到通知管理插件","Password":"密码","Password is not allowed to be changed":"密码不允许修改","Password reset successful":"密码重置成功","Plain text":"普通文本","Please enter a password":"请输入密码","Please enter a valid email":"请输入有效的邮箱","Please enter a valid username":"请输入有效的用户名","Please enter new password":"请输入新密码","Please enter the same password again":"请再次输入相同的密码","Please enter your email":"请输入您的邮箱","Please enter your username or email":"请输入用户名或邮箱","Please keep and enable at least one authenticator":"请至少保留并启用一个认证器","Reset email sent successfully":"重置邮件发送成功","Reset link expiration (minutes)":"重置链接有效期(分钟)","Reset link has expired":"重置链接已过期","Reset password":"重置密码","Reset password email":"重置密码邮件","Reset password link":"重置密码链接","Saved successfully!":"保存成功!","Seconds":"秒","Send reset email":"发送重置邮件","Session validity period":"会话有效期","Show":"显示","Sign in via email":"邮箱登录","Sign in via password":"密码登录","Sign up form":"注册表单","Sign up settings":"注册设置","Sign-in":"登录","Subject":"主题","The authentication allows users to sign in via username or email.":"该认证方式支持用户通过用户名或邮箱登录。","The maximum time limit allowed for refreshing a Token after it expires. After this time limit, the token cannot be automatically renewed, and the user needs to log in again.":"Token 过期后允许刷新的最大时限,超过此时限后,Token 无法自动更新,用户需重新登录。","The maximum valid time for each user login. During the session validity, the Token will be automatically updated. After the timeout, the user is required to log in again.":"用户每次登录的最长有效时间,在会话有效期内,Token 会自动更新,超时后要求用户重新登录。","The notification channel used to send the reset password email, only support email channel":"发送重置密码邮件所使用的通知渠道,仅支持电子邮件通道","The password is inconsistent, please re-enter":"密码不一致,请重新输入","The password is incorrect, please re-enter":"密码有误,请重新输入","The passwords entered twice are inconsistent":"两次输入的密码不一致","The phone number has been registered, please login directly":"手机号已注册,请直接登录","The phone number is not registered, please register first":"手机号未注册,请先注册","The username or email is incorrect, please re-enter":"用户名或邮箱有误,请重新输入","The username/email or password is incorrect, please re-enter":"用户名/邮箱或密码有误,请重新输入","The validity period of each issued API Token. After the Token expires, if it is within the session validity period and has not exceeded the refresh limit, the server will automatically issue a new Token to maintain the user session, otherwise the user is required to log in again. (Each Token can only be refreshed once)":"每次签发的 API Token 的有效期。Token 过期后,如果处于会话有效期内,并且没有超过刷新时限,服务端将自动签发新 Token 以保持用户会话,否则要求用户重新登录。(每个 Token 只能被刷新一次)","Token expired":"令牌已过期","Token policy":"Token 策略","Token validity period":"Token 有效期","Token validity period must be less than session validity period!":"Token 有效期必须小于会话有效期!","Unauthenticated. Please sign in to continue.":"未认证。请登录以继续。","User not found":"未找到用户","User not found. Please sign in again to continue.":"用户不存在。请重新登录以继续。","Username/Email":"用户名/邮箱","Your session has expired. Please sign in again.":"您的会话已过期,请重新登录。","add one first":"先添加一个","defaultResetPasswordEmailContentHTML":"<p>您好 {{$user.username}},</p>\\n\\n<p>我们收到了重置您 {{$systemSettings.title}} 账户密码的请求。</p>\\n\\n<p>请点击下面的链接设置您的新密码:</p>\\n\\n<p>\\n <a href=\\"{{$resetLink}}\\">重置您的密码</a>\\n</p>\\n\\n<p>\\n 如果您没有请求重置密码,请忽略此邮件。您的密码将保持不变。\\n</p>\\n\\n<p>\\n 请注意:为了您的安全,此密码重置链接将在 <strong>{{$resetLinkExpiration}} 分钟</strong>后过期。\\n</p>\\n\\n<p>如果您在重置密码时遇到任何问题,请联系我们的支持团队。</p>\\n\\n<p>\\n 谢谢,<br>\\n {{$systemSettings.title}} 团队\\n</p>","defaultResetPasswordEmailContentText":"您好 {{$user.username}},\\n\\n我们收到了重置您 {{$systemSettings.title}} 账户密码的请求。\\n\\n请点击下面的链接设置您的新密码:\\n\\n{{$resetLink}}\\n\\n如果您没有请求重置密码,请忽略此邮件。您的密码将保持不变。\\n\\n请注意:为了您的安全,此密码重置链接将在 {{$resetLinkExpiration}} 分钟后过期。\\n\\n如果您在重置密码时遇到任何问题,请联系我们的支持团队。\\n\\n谢谢,{{$systemSettings.title}} 团队","defaultResetPasswordEmailSubject":"重置您的 {{$systemSettings.title}} 密码"}'),a="auth",l={"en-US":o,"zh-CN":i};function s(){return(0,r.useTranslation)([a,"client"],{nsMode:"fallback"})}},375:function(e){"use strict";e.exports=r},230:function(e){"use strict";e.exports=n},485:function(e){"use strict";e.exports=o},768:function(e){"use strict";e.exports=l},59:function(e){"use strict";e.exports=i},155:function(e){"use strict";e.exports=a},953:function(t){"use strict";t.exports=e},442:function(e){"use strict";e.exports=t}},u={};function c(e){var t=u[e];if(void 0!==t)return t.exports;var n=u[e]={exports:{}};return s[e](n,n.exports,c),n.exports}c.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(t,{a:t}),t},c.d=function(e,t){for(var n in t)c.o(t,n)&&!c.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},c.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},c.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.g.importScripts&&(f=c.g.location+"");var f,p=c.g.document;if(!f&&p&&(p.currentScript&&"SCRIPT"===p.currentScript.tagName.toUpperCase()&&(f=p.currentScript.src),!f)){var d=p.getElementsByTagName("script");if(d.length)for(var m=d.length-1;m>-1&&(!f||!/^http(s?):/.test(f));)f=d[m--].src}if(!f)throw Error("Automatic publicPath is not supported in this browser");c.p=f.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/");var h={};return!function(){"use strict";var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src&&(e=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")),!e){var n=window.__webpack_public_path__||"";n&&("/"!==n.charAt(n.length-1)&&(n+="/"),e=n+"static/plugins/@nocobase/plugin-auth/dist/client-v2/")}if(!e){if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var r=window.location.pathname||"/",o=r.indexOf("/v2/");e=o>=0?r.slice(0,o+1):"/"}e&&(e=e.replace(/\/v2\/?$/,"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-auth/dist/client-v2/"}c.p=e}(),!function(){"use strict";c.r(h),c.d(h,{AuthLayout:function(){return o.default},AuthProvider:function(){return u.A},AuthenticatorsContext:function(){return t.m},AuthenticatorsContextProvider:function(){return f.A},ForgotPasswordPage:function(){return l.default},NAMESPACE:function(){return n.CU},PluginAuthClientV2:function(){return e.T},ResetPasswordPage:function(){return s.default},SignInPage:function(){return i.default},SignUpPage:function(){return a.default},authLocaleResources:function(){return n._1},default:function(){return e.A},useAuthTranslation:function(){return n.dE},useAuthenticator:function(){return t.p},useDocumentTitle:function(){return r.rN},useRedirect:function(){return r.wn},useSignIn:function(){return r.go}});var e=c(514),t=c(295),n=c(816),r=c(824),o=c(14),i=c(818),a=c(872),l=c(826),s=c(622),u=c(258),f=c(89)}(),h}()});
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
export declare const NAMESPACE = "auth";
|
|
10
|
+
export declare const authLocaleResources: {
|
|
11
|
+
'en-US': {
|
|
12
|
+
"1. Select notification channel": string;
|
|
13
|
+
"2. Configure reset email": string;
|
|
14
|
+
"Allow to sign in with": string;
|
|
15
|
+
"Allow to sign up": string;
|
|
16
|
+
"At least one of the username or email fields is required": string;
|
|
17
|
+
"Auth Type": string;
|
|
18
|
+
"Auth UID": string;
|
|
19
|
+
Authentication: string;
|
|
20
|
+
Authenticators: string;
|
|
21
|
+
"Back to login": string;
|
|
22
|
+
"Content type": string;
|
|
23
|
+
Days: string;
|
|
24
|
+
"Email channel not found": string;
|
|
25
|
+
"Enable forget password": string;
|
|
26
|
+
"Expired token refresh limit": string;
|
|
27
|
+
"Forgot password": string;
|
|
28
|
+
"Go to login": string;
|
|
29
|
+
Hours: string;
|
|
30
|
+
"In configuration mode, the entire column becomes transparent. In non-configuration mode, the entire column will be hidden. Even if the entire column is hidden, its configured default values and other settings will still take effect.": string;
|
|
31
|
+
Minutes: string;
|
|
32
|
+
"Missing X-Authenticator in request header": string;
|
|
33
|
+
"No authentication methods available.": string;
|
|
34
|
+
"No notification channels found. Please ": string;
|
|
35
|
+
"Not a valid cellphone number, please re-enter": string;
|
|
36
|
+
"Not allowed to reset password": string;
|
|
37
|
+
"Not allowed to sign up": string;
|
|
38
|
+
"Notification channel (Email)": string;
|
|
39
|
+
"Notification manager plugin not found": string;
|
|
40
|
+
Password: string;
|
|
41
|
+
"Password is not allowed to be changed": string;
|
|
42
|
+
"Password reset successful": string;
|
|
43
|
+
"Plain text": string;
|
|
44
|
+
"Please enter a password": string;
|
|
45
|
+
"Please enter a valid email": string;
|
|
46
|
+
"Please enter a valid username": string;
|
|
47
|
+
"Please enter new password": string;
|
|
48
|
+
"Please enter the same password again": string;
|
|
49
|
+
"Please enter your email": string;
|
|
50
|
+
"Please enter your username or email": string;
|
|
51
|
+
"Please keep and enable at least one authenticator": string;
|
|
52
|
+
"Reset email sent successfully": string;
|
|
53
|
+
"Reset link expiration (minutes)": string;
|
|
54
|
+
"Reset link has expired": string;
|
|
55
|
+
"Reset password": string;
|
|
56
|
+
"Reset password email": string;
|
|
57
|
+
"Reset password link": string;
|
|
58
|
+
"Saved successfully!": string;
|
|
59
|
+
Seconds: string;
|
|
60
|
+
"Send reset email": string;
|
|
61
|
+
"Session validity period": string;
|
|
62
|
+
Show: string;
|
|
63
|
+
"Sign in via email": string;
|
|
64
|
+
"Sign in via password": string;
|
|
65
|
+
"Sign up form": string;
|
|
66
|
+
"Sign up settings": string;
|
|
67
|
+
"Sign-in": string;
|
|
68
|
+
Subject: string;
|
|
69
|
+
"The authentication allows users to sign in via username or email.": string;
|
|
70
|
+
"The maximum time limit allowed for refreshing a Token after it expires. After this time limit, the token cannot be automatically renewed, and the user needs to log in again.": string;
|
|
71
|
+
"The maximum valid time for each user login. During the session validity, the Token will be automatically updated. After the timeout, the user is required to log in again.": string;
|
|
72
|
+
"The notification channel used to send the reset password email, only support email channel": string;
|
|
73
|
+
"The password is inconsistent, please re-enter": string;
|
|
74
|
+
"The password is incorrect, please re-enter": string;
|
|
75
|
+
"The passwords entered twice are inconsistent": string;
|
|
76
|
+
"The phone number has been registered, please login directly": string;
|
|
77
|
+
"The phone number is not registered, please register first": string;
|
|
78
|
+
"The username or email is incorrect, please re-enter": string;
|
|
79
|
+
"The username/email or password is incorrect, please re-enter": string;
|
|
80
|
+
"The validity period of each issued API Token. After the Token expires, if it is within the session validity period and has not exceeded the refresh limit, the server will automatically issue a new Token to maintain the user session, otherwise the user is required to log in again. (Each Token can only be refreshed once)": string;
|
|
81
|
+
"Token expired": string;
|
|
82
|
+
"Token policy": string;
|
|
83
|
+
"Token validity period": string;
|
|
84
|
+
"Token validity period must be less than session validity period!": string;
|
|
85
|
+
"Unauthenticated. Please sign in to continue.": string;
|
|
86
|
+
"User not found": string;
|
|
87
|
+
"User not found. Please sign in again to continue.": string;
|
|
88
|
+
"Username/Email": string;
|
|
89
|
+
"Your session has expired. Please sign in again.": string;
|
|
90
|
+
"add one first": string;
|
|
91
|
+
defaultResetPasswordEmailContentHTML: string;
|
|
92
|
+
defaultResetPasswordEmailContentText: string;
|
|
93
|
+
defaultResetPasswordEmailSubject: string;
|
|
94
|
+
};
|
|
95
|
+
'zh-CN': {
|
|
96
|
+
"1. Select notification channel": string;
|
|
97
|
+
"2. Configure reset email": string;
|
|
98
|
+
"Allow to sign in with": string;
|
|
99
|
+
"Allow to sign up": string;
|
|
100
|
+
"At least one of the username or email fields is required": string;
|
|
101
|
+
"Auth Type": string;
|
|
102
|
+
"Auth UID": string;
|
|
103
|
+
Authentication: string;
|
|
104
|
+
Authenticators: string;
|
|
105
|
+
"Back to login": string;
|
|
106
|
+
"Content type": string;
|
|
107
|
+
Days: string;
|
|
108
|
+
"Email channel not found": string;
|
|
109
|
+
"Enable forget password": string;
|
|
110
|
+
"Expired token refresh limit": string;
|
|
111
|
+
"Forgot password": string;
|
|
112
|
+
"Go to login": string;
|
|
113
|
+
Hours: string;
|
|
114
|
+
"In configuration mode, the entire column becomes transparent. In non-configuration mode, the entire column will be hidden. Even if the entire column is hidden, its configured default values and other settings will still take effect.": string;
|
|
115
|
+
Minutes: string;
|
|
116
|
+
"Missing X-Authenticator in request header": string;
|
|
117
|
+
"No authentication methods available.": string;
|
|
118
|
+
"No notification channels found. Please ": string;
|
|
119
|
+
"Not a valid cellphone number, please re-enter": string;
|
|
120
|
+
"Not allowed to reset password": string;
|
|
121
|
+
"Not allowed to sign up": string;
|
|
122
|
+
"Notification channel (Email)": string;
|
|
123
|
+
"Notification manager plugin not found": string;
|
|
124
|
+
Password: string;
|
|
125
|
+
"Password is not allowed to be changed": string;
|
|
126
|
+
"Password reset successful": string;
|
|
127
|
+
"Plain text": string;
|
|
128
|
+
"Please enter a password": string;
|
|
129
|
+
"Please enter a valid email": string;
|
|
130
|
+
"Please enter a valid username": string;
|
|
131
|
+
"Please enter new password": string;
|
|
132
|
+
"Please enter the same password again": string;
|
|
133
|
+
"Please enter your email": string;
|
|
134
|
+
"Please enter your username or email": string;
|
|
135
|
+
"Please keep and enable at least one authenticator": string;
|
|
136
|
+
"Reset email sent successfully": string;
|
|
137
|
+
"Reset link expiration (minutes)": string;
|
|
138
|
+
"Reset link has expired": string;
|
|
139
|
+
"Reset password": string;
|
|
140
|
+
"Reset password email": string;
|
|
141
|
+
"Reset password link": string;
|
|
142
|
+
"Saved successfully!": string;
|
|
143
|
+
Seconds: string;
|
|
144
|
+
"Send reset email": string;
|
|
145
|
+
"Session validity period": string;
|
|
146
|
+
Show: string;
|
|
147
|
+
"Sign in via email": string;
|
|
148
|
+
"Sign in via password": string;
|
|
149
|
+
"Sign up form": string;
|
|
150
|
+
"Sign up settings": string;
|
|
151
|
+
"Sign-in": string;
|
|
152
|
+
Subject: string;
|
|
153
|
+
"The authentication allows users to sign in via username or email.": string;
|
|
154
|
+
"The maximum time limit allowed for refreshing a Token after it expires. After this time limit, the token cannot be automatically renewed, and the user needs to log in again.": string;
|
|
155
|
+
"The maximum valid time for each user login. During the session validity, the Token will be automatically updated. After the timeout, the user is required to log in again.": string;
|
|
156
|
+
"The notification channel used to send the reset password email, only support email channel": string;
|
|
157
|
+
"The password is inconsistent, please re-enter": string;
|
|
158
|
+
"The password is incorrect, please re-enter": string;
|
|
159
|
+
"The passwords entered twice are inconsistent": string;
|
|
160
|
+
"The phone number has been registered, please login directly": string;
|
|
161
|
+
"The phone number is not registered, please register first": string;
|
|
162
|
+
"The username or email is incorrect, please re-enter": string;
|
|
163
|
+
"The username/email or password is incorrect, please re-enter": string;
|
|
164
|
+
"The validity period of each issued API Token. After the Token expires, if it is within the session validity period and has not exceeded the refresh limit, the server will automatically issue a new Token to maintain the user session, otherwise the user is required to log in again. (Each Token can only be refreshed once)": string;
|
|
165
|
+
"Token expired": string;
|
|
166
|
+
"Token policy": string;
|
|
167
|
+
"Token validity period": string;
|
|
168
|
+
"Token validity period must be less than session validity period!": string;
|
|
169
|
+
"Unauthenticated. Please sign in to continue.": string;
|
|
170
|
+
"User not found": string;
|
|
171
|
+
"User not found. Please sign in again to continue.": string;
|
|
172
|
+
"Username/Email": string;
|
|
173
|
+
"Your session has expired. Please sign in again.": string;
|
|
174
|
+
"add one first": string;
|
|
175
|
+
defaultResetPasswordEmailContentHTML: string;
|
|
176
|
+
defaultResetPasswordEmailContentText: string;
|
|
177
|
+
defaultResetPasswordEmailSubject: string;
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
export declare function useAuthTranslation(): import("react-i18next").UseTranslationResponse<("auth" | "client")[], undefined>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
export default function AuthLayout(): React.JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
export default function ForgotPasswordPage(): React.JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
export default function ResetPasswordPage(): React.JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { type AuthOptions } from '../plugin';
|
|
11
|
+
export declare function useSignInForms(): Record<string, AuthOptions['components']['SignInForm']>;
|
|
12
|
+
export declare function useSignInButtons(authenticators?: any[]): React.CElement<{
|
|
13
|
+
key: string;
|
|
14
|
+
authenticator: any;
|
|
15
|
+
}, React.Component<{
|
|
16
|
+
key: string;
|
|
17
|
+
authenticator: any;
|
|
18
|
+
}, any, any>>[];
|
|
19
|
+
export default function SignInPage(): React.JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { type AuthOptions } from '../plugin';
|
|
11
|
+
export declare function useSignUpForms(): Record<string, AuthOptions['components']['SignUpForm']>;
|
|
12
|
+
export default function SignUpPage(): React.JSX.Element;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import type { ComponentType } from 'react';
|
|
10
|
+
import { Plugin } from '@nocobase/client-v2';
|
|
11
|
+
import type { Authenticator as AuthenticatorType } from './authenticator';
|
|
12
|
+
export type AuthOptions = {
|
|
13
|
+
components: Partial<{
|
|
14
|
+
SignInForm: ComponentType<{
|
|
15
|
+
authenticator: AuthenticatorType;
|
|
16
|
+
}>;
|
|
17
|
+
SignInButton: ComponentType<{
|
|
18
|
+
authenticator: AuthenticatorType;
|
|
19
|
+
}>;
|
|
20
|
+
SignUpForm: ComponentType<{
|
|
21
|
+
authenticatorName: string;
|
|
22
|
+
}>;
|
|
23
|
+
AdminSettingsForm: ComponentType;
|
|
24
|
+
}>;
|
|
25
|
+
};
|
|
26
|
+
export declare class PluginAuthClientV2 extends Plugin {
|
|
27
|
+
authTypes: any;
|
|
28
|
+
registerType(authType: string, options: AuthOptions): void;
|
|
29
|
+
load(): Promise<void>;
|
|
30
|
+
private addRoutes;
|
|
31
|
+
private registerPresetAuthType;
|
|
32
|
+
private installInterceptors;
|
|
33
|
+
}
|
|
34
|
+
export default PluginAuthClientV2;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
declare const AuthProvider: React.FC<React.PropsWithChildren>;
|
|
11
|
+
export default AuthProvider;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import React, { FC } from 'react';
|
|
10
|
+
declare const AuthenticatorsContextProvider: FC<React.PropsWithChildren>;
|
|
11
|
+
export default AuthenticatorsContextProvider;
|
package/dist/externalVersion.js
CHANGED
|
@@ -8,25 +8,26 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "2.1.0-beta.
|
|
11
|
+
"@nocobase/client": "2.1.0-beta.24",
|
|
12
12
|
"react": "18.2.0",
|
|
13
13
|
"react-router-dom": "6.30.1",
|
|
14
|
-
"@nocobase/utils": "2.1.0-beta.
|
|
14
|
+
"@nocobase/utils": "2.1.0-beta.24",
|
|
15
15
|
"axios": "1.7.7",
|
|
16
16
|
"lodash": "4.18.1",
|
|
17
|
-
"@nocobase/
|
|
18
|
-
"
|
|
19
|
-
"@nocobase/
|
|
20
|
-
"@nocobase/
|
|
21
|
-
"@nocobase/
|
|
22
|
-
"@nocobase/
|
|
17
|
+
"@nocobase/client-v2": "2.1.0-beta.24",
|
|
18
|
+
"react-i18next": "11.18.6",
|
|
19
|
+
"@nocobase/auth": "2.1.0-beta.24",
|
|
20
|
+
"@nocobase/database": "2.1.0-beta.24",
|
|
21
|
+
"@nocobase/cache": "2.1.0-beta.24",
|
|
22
|
+
"@nocobase/server": "2.1.0-beta.24",
|
|
23
|
+
"@nocobase/logger": "2.1.0-beta.24",
|
|
24
|
+
"@nocobase/test": "2.1.0-beta.24",
|
|
23
25
|
"@formily/antd-v5": "1.2.3",
|
|
24
26
|
"antd": "5.24.2",
|
|
25
27
|
"@formily/shared": "2.3.7",
|
|
26
28
|
"@formily/react": "2.3.7",
|
|
27
|
-
"react-i18next": "11.18.6",
|
|
28
29
|
"@emotion/css": "11.13.0",
|
|
29
30
|
"@ant-design/icons": "5.6.1",
|
|
30
|
-
"@nocobase/actions": "2.1.0-beta.
|
|
31
|
+
"@nocobase/actions": "2.1.0-beta.24",
|
|
31
32
|
"@formily/core": "2.3.7"
|
|
32
33
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"cron","description":"Cron jobs for your node","version":"2.4.4","author":"Nick Campbell <nicholas.j.campbell@gmail.com> (https://github.com/ncb000gt)","bugs":{"url":"https://github.com/kelektiv/node-cron/issues"},"repository":{"type":"git","url":"https://github.com/kelektiv/node-cron.git"},"main":"lib/cron","scripts":{"lint":"eslint {lib,tests}/*.js","test":"jest --coverage","test:watch":"jest --watch --coverage","test:types":"tsd","prepare":"husky install","release":"semantic-release"},"types":"types/index.d.ts","dependencies":{"@types/luxon":"~3.3.0","luxon":"~3.3.0"},"devDependencies":{"@commitlint/cli":"~17.6.6","@insurgentlab/commitlint-config":"^18.1.0","@insurgentlab/conventional-changelog-preset":"~6.0.3","@semantic-release/changelog":"~6.0.x","@semantic-release/commit-analyzer":"~9.0.x","@semantic-release/git":"~10.0.x","@semantic-release/github":"~8.1.x","@semantic-release/npm":"~10.0.x","@semantic-release/release-notes-generator":"~11.0.x","chai":"~4.2.x","eslint":"~8.36.x","eslint-config-prettier":"^8.7.x","eslint-config-standard":"~17.0.x","eslint-plugin-import":"~2.27.x","eslint-plugin-jest":"~27.2.x","eslint-plugin-n":"~15.6.x","eslint-plugin-prettier":"~4.2.x","eslint-plugin-promise":"~6.1.x","husky":"^8.0.3","jest":"~29.5.x","prettier":"~2.8.x","semantic-release":"~21.0.x","sinon":"^15.0.x","tsd":"^0.28.1"},"keywords":["cron","node cron","node-cron","schedule","scheduler","cronjob","cron job"],"license":"MIT","contributors":["Brandon der Blätter <https://interlucid.com/contact/> (https://github.com/intcreator)","Romain Beauxis <toots@rastageeks.org> (https://github.com/toots)","James Padolsey <> (https://github.com/jamespadolsey)","Finn Herpich <fh@three-heads.de> (https://github.com/ErrorProne)","Clifton Cunningham <clifton.cunningham@gmail.com> (https://github.com/cliftonc)","Eric Abouaf <eric.abouaf@gmail.com> (https://github.com/neyric)","humanchimp <morphcham@gmail.com> (https://github.com/humanchimp)","Craig Condon <craig@spiceapps.com> (https://github.com/spiceapps)","Dan Bear <daniel@hulu.com> (https://github.com/danhbear)","Vadim Baryshev <vadimbaryshev@gmail.com> (https://github.com/baryshev)","Leandro Ferrari <lfthomaz@gmail.com> (https://github.com/lfthomaz)","Gregg Zigler <greggzigler@gmail.com> (https://github.com/greggzigler)","Jordan Abderrachid <jabderrachid@gmail.com> (https://github.com/jordanabderrachid)","Masakazu Matsushita <matsukaz@gmail.com> (matsukaz)","Christopher Lunt <me@kirisu.co.uk> (https://github.com/kirisu)"],"jest":{"collectCoverage":true,"collectCoverageFrom":["lib/*.js"],"coverageThreshold":{"global":{"statements":80,"branches":80,"functions":70,"lines":80}}},"files":["lib","types","CHANGELOG.md","LICENSE","README.md"],"_lastModified":"2026-04-
|
|
1
|
+
{"name":"cron","description":"Cron jobs for your node","version":"2.4.4","author":"Nick Campbell <nicholas.j.campbell@gmail.com> (https://github.com/ncb000gt)","bugs":{"url":"https://github.com/kelektiv/node-cron/issues"},"repository":{"type":"git","url":"https://github.com/kelektiv/node-cron.git"},"main":"lib/cron","scripts":{"lint":"eslint {lib,tests}/*.js","test":"jest --coverage","test:watch":"jest --watch --coverage","test:types":"tsd","prepare":"husky install","release":"semantic-release"},"types":"types/index.d.ts","dependencies":{"@types/luxon":"~3.3.0","luxon":"~3.3.0"},"devDependencies":{"@commitlint/cli":"~17.6.6","@insurgentlab/commitlint-config":"^18.1.0","@insurgentlab/conventional-changelog-preset":"~6.0.3","@semantic-release/changelog":"~6.0.x","@semantic-release/commit-analyzer":"~9.0.x","@semantic-release/git":"~10.0.x","@semantic-release/github":"~8.1.x","@semantic-release/npm":"~10.0.x","@semantic-release/release-notes-generator":"~11.0.x","chai":"~4.2.x","eslint":"~8.36.x","eslint-config-prettier":"^8.7.x","eslint-config-standard":"~17.0.x","eslint-plugin-import":"~2.27.x","eslint-plugin-jest":"~27.2.x","eslint-plugin-n":"~15.6.x","eslint-plugin-prettier":"~4.2.x","eslint-plugin-promise":"~6.1.x","husky":"^8.0.3","jest":"~29.5.x","prettier":"~2.8.x","semantic-release":"~21.0.x","sinon":"^15.0.x","tsd":"^0.28.1"},"keywords":["cron","node cron","node-cron","schedule","scheduler","cronjob","cron job"],"license":"MIT","contributors":["Brandon der Blätter <https://interlucid.com/contact/> (https://github.com/intcreator)","Romain Beauxis <toots@rastageeks.org> (https://github.com/toots)","James Padolsey <> (https://github.com/jamespadolsey)","Finn Herpich <fh@three-heads.de> (https://github.com/ErrorProne)","Clifton Cunningham <clifton.cunningham@gmail.com> (https://github.com/cliftonc)","Eric Abouaf <eric.abouaf@gmail.com> (https://github.com/neyric)","humanchimp <morphcham@gmail.com> (https://github.com/humanchimp)","Craig Condon <craig@spiceapps.com> (https://github.com/spiceapps)","Dan Bear <daniel@hulu.com> (https://github.com/danhbear)","Vadim Baryshev <vadimbaryshev@gmail.com> (https://github.com/baryshev)","Leandro Ferrari <lfthomaz@gmail.com> (https://github.com/lfthomaz)","Gregg Zigler <greggzigler@gmail.com> (https://github.com/greggzigler)","Jordan Abderrachid <jabderrachid@gmail.com> (https://github.com/jordanabderrachid)","Masakazu Matsushita <matsukaz@gmail.com> (matsukaz)","Christopher Lunt <me@kirisu.co.uk> (https://github.com/kirisu)"],"jest":{"collectCoverage":true,"collectCoverageFrom":["lib/*.js"],"coverageThreshold":{"global":{"statements":80,"branches":80,"functions":70,"lines":80}}},"files":["lib","types","CHANGELOG.md","LICENSE","README.md"],"_lastModified":"2026-04-29T08:15:49.658Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"ms","version":"2.1.3","description":"Tiny millisecond conversion utility","repository":"vercel/ms","main":"./index","files":["index.js"],"scripts":{"precommit":"lint-staged","lint":"eslint lib/* bin/*","test":"mocha tests.js"},"eslintConfig":{"extends":"eslint:recommended","env":{"node":true,"es6":true}},"lint-staged":{"*.js":["npm run lint","prettier --single-quote --write","git add"]},"license":"MIT","devDependencies":{"eslint":"4.18.2","expect.js":"0.3.1","husky":"0.14.3","lint-staged":"5.0.0","mocha":"4.0.1","prettier":"2.0.5"},"_lastModified":"2026-04-
|
|
1
|
+
{"name":"ms","version":"2.1.3","description":"Tiny millisecond conversion utility","repository":"vercel/ms","main":"./index","files":["index.js"],"scripts":{"precommit":"lint-staged","lint":"eslint lib/* bin/*","test":"mocha tests.js"},"eslintConfig":{"extends":"eslint:recommended","env":{"node":true,"es6":true}},"lint-staged":{"*.js":["npm run lint","prettier --single-quote --write","git add"]},"license":"MIT","devDependencies":{"eslint":"4.18.2","expect.js":"0.3.1","husky":"0.14.3","lint-staged":"5.0.0","mocha":"4.0.1","prettier":"2.0.5"},"_lastModified":"2026-04-29T08:15:49.748Z"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-auth",
|
|
3
|
-
"version": "2.1.0-beta.
|
|
3
|
+
"version": "2.1.0-beta.24",
|
|
4
4
|
"main": "./dist/server/index.js",
|
|
5
5
|
"homepage": "https://docs.nocobase.com/handbook/auth",
|
|
6
6
|
"homepage.ru-RU": "https://docs-ru.nocobase.com/handbook/auth",
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"@nocobase/actions": "2.x",
|
|
21
21
|
"@nocobase/auth": "2.x",
|
|
22
22
|
"@nocobase/client": "2.x",
|
|
23
|
+
"@nocobase/client-v2": "2.x",
|
|
23
24
|
"@nocobase/database": "2.x",
|
|
24
25
|
"@nocobase/server": "2.x",
|
|
25
26
|
"@nocobase/test": "2.x"
|
|
@@ -30,7 +31,7 @@
|
|
|
30
31
|
"description": "User authentication management, including password, SMS, and support for Single Sign-On (SSO) protocols, with extensibility.",
|
|
31
32
|
"description.ru-RU": "Управление аутентификацией пользователей: пароли, SMS, поддержка протоколов единого входа (SSO) и возможность расширения.",
|
|
32
33
|
"description.zh-CN": "用户认证管理,包括基础的密码认证、短信认证、SSO 协议的认证等,可扩展。",
|
|
33
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "f77b85530a2d127d9bfe4dca3a26fbb02c1139ba",
|
|
34
35
|
"keywords": [
|
|
35
36
|
"Authentication",
|
|
36
37
|
"Security"
|