@nocobase/plugin-auth 2.2.0-beta.5 → 2.2.0-beta.6
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/dist/client/{680.c44d0f336fd828c0.js → 680.8758971b4dd75b23.js} +1 -1
- package/dist/client/index.js +1 -1
- package/dist/client-v2/index.js +1 -1
- package/dist/externalVersion.js +11 -11
- package/dist/node_modules/cron/package.json +1 -1
- package/dist/node_modules/ms/package.json +1 -1
- package/package.json +2 -2
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
(self.webpackChunk_nocobase_plugin_auth=self.webpackChunk_nocobase_plugin_auth||[]).push([["680"],{688:function(e){function t(e,t,r,n){return Math.round(e/r)+" "+n+(t>=1.5*r?"s":"")}e.exports=function(e,r){r=r||{};var n,o,i,a,s=typeof e;if("string"===s&&e.length>0){var c=e;if(!((c=String(c)).length>100)){var u=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(c);if(u){var l=parseFloat(u[1]);switch((u[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*l;case"weeks":case"week":case"w":return 6048e5*l;case"days":case"day":case"d":return 864e5*l;case"hours":case"hour":case"hrs":case"hr":case"h":return 36e5*l;case"minutes":case"minute":case"mins":case"min":case"m":return 6e4*l;case"seconds":case"second":case"secs":case"sec":case"s":return 1e3*l;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return l;default:break}}}return}if("number"===s&&isFinite(e)){return r.long?(o=Math.abs(n=e))>=864e5?t(n,o,864e5,"day"):o>=36e5?t(n,o,36e5,"hour"):o>=6e4?t(n,o,6e4,"minute"):o>=1e3?t(n,o,1e3,"second"):n+" ms":(a=Math.abs(i=e))>=864e5?Math.round(i/864e5)+"d":a>=36e5?Math.round(i/36e5)+"h":a>=6e4?Math.round(i/6e4)+"m":a>=1e3?Math.round(i/1e3)+"s":i+"ms"}throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},
|
|
10
|
+
(self.webpackChunk_nocobase_plugin_auth=self.webpackChunk_nocobase_plugin_auth||[]).push([["680"],{688:function(e){function t(e,t,r,n){return Math.round(e/r)+" "+n+(t>=1.5*r?"s":"")}e.exports=function(e,r){r=r||{};var n,o,i,a,s=typeof e;if("string"===s&&e.length>0){var c=e;if(!((c=String(c)).length>100)){var u=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(c);if(u){var l=parseFloat(u[1]);switch((u[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*l;case"weeks":case"week":case"w":return 6048e5*l;case"days":case"day":case"d":return 864e5*l;case"hours":case"hour":case"hrs":case"hr":case"h":return 36e5*l;case"minutes":case"minute":case"mins":case"min":case"m":return 6e4*l;case"seconds":case"second":case"secs":case"sec":case"s":return 1e3*l;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return l;default:break}}}return}if("number"===s&&isFinite(e)){return r.long?(o=Math.abs(n=e))>=864e5?t(n,o,864e5,"day"):o>=36e5?t(n,o,36e5,"hour"):o>=6e4?t(n,o,6e4,"minute"):o>=1e3?t(n,o,1e3,"second"):n+" ms":(a=Math.abs(i=e))>=864e5?Math.round(i/864e5)+"d":a>=36e5?Math.round(i/36e5)+"h":a>=6e4?Math.round(i/6e4)+"m":a>=1e3?Math.round(i/1e3)+"s":i+"ms"}throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},352:function(e,t,r){"use strict";r.r(t),r.d(t,{TokenPolicySettings:function(){return C}});var n,o=r(155),i=r.n(o),a=r(342),s=r(59),c=r(166),u=r(768),l=r(872),f=r(230),p=r(452),m=r(688),d=r.n(m),y="token-policy-config",h="tokenControlConfig";function b(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){r(e);return}s.done?t(c):Promise.resolve(c).then(n,o)}function v(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){b(i,n,o,a,s,"next",e)}function s(e){b(i,n,o,a,s,"throw",e)}a(void 0)})}}function g(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function w(e,t){var r,n,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),s=Object.defineProperty;return s(a,"next",{value:c(0)}),s(a,"throw",{value:c(1)}),s(a,"return",{value:c(2)}),"function"==typeof Symbol&&s(a,Symbol.iterator,{value:function(){return this}}),a;function c(s){return function(c){var u=[s,c];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&u[0]?n.return:u[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;switch(n=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++,n=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],n=0}finally{r=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}var O="useSubmitActionProps",k="useEditForm",x=(g(n={},k,function(){var e=(0,a.useAPIClient)(),t=(0,o.useMemo)(function(){return(0,p.createForm)()},[]);return(0,o.useEffect)(function(){v(function(){var r,n;return w(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,e.resource(h).get({filterByTk:y})];case 1:return(null==(n=o.sent().data)||null==(r=n.data)?void 0:r.config)&&t.setValues(n.data.config),[3,3];case 2:return console.error(o.sent()),[3,3];case 3:return[2]}})})()},[t,e]),{form:t}}),g(n,O,function(){var e=s.App.useApp().message,t=(0,a.useAPIClient)(),r=(0,f.useForm)(),n=(0,l.dE)().t;return{type:"primary",onClick:function(){return v(function(){var o,i,a,s;return w(this,function(c){switch(c.label){case 0:if(r.clearErrors("*"),i=(o=r.values).tokenExpirationTime,a=o.sessionExpirationTime,o.expiredTokenRenewLimit,d()(i)>=d()(a))return r.setFieldState("tokenExpirationTime",function(e){e.feedbacks=[{type:"error",code:"ValidateError",messages:[n("Token validity period must be less than session validity period!")]}]}),[2];return[4,r.submit()];case 1:return c.sent(),[4,t.resource(h).update({values:{config:r.values},filterByTk:y})];case 2:return(s=c.sent())&&200===s.status&&e.success(n("Saved successfully!")),[2]}})})()}}}),n);function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function j(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var S=s.Select.Option,T=(0,f.connect)(function(e){var t,r=(0,l.dE)().t,n=e.value,a=e.onChange,c=e.minNum,u=function(e,t){if(null==e)return{};var r,n,o,i={};if("u">typeof Reflect&&Reflect.ownKeys){for(o=0,r=Reflect.ownKeys(Object(e));o<r.length;o++)n=r[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n]);return i}if(i=function(e,t){if(null==e)return{};var r,n,o={},i=Object.getOwnPropertyNames(e);for(n=0;n<i.length;n++)r=i[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}(e,t),Object.getOwnPropertySymbols)for(o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)n=r[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n]);return i}(e,["value","onChange","minNum"]),f=n?n.match(/^(\d*)([a-zA-Z]*)$/):null;(0,o.useEffect)(function(){f||a("10m")},[f,a]);var p=function(e){if(Array.isArray(e))return e}(t=f?[parseInt(f[1]),f[2]]:[10,"m"])||function(e){var t,r,n=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o=[],i=!0,a=!1;try{for(n=n.call(e);!(i=(t=n.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,r=e}finally{try{i||null==n.return||n.return()}finally{if(a)throw r}}return o}}(t)||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)}}(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.")}(),m=p[0],d=p[1],y=i().createElement(s.Select,{value:d,onChange:function(e){return a("".concat(m).concat(e))},style:{width:120}},i().createElement(S,{value:"m"},r("Minutes")),i().createElement(S,{value:"h"},r("Hours")),i().createElement(S,{value:"d"},r("Days")));return i().createElement(s.InputNumber,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){j(e,t,r[t])})}return e}({value:m,addonAfter:y,min:void 0===c?1:c,onChange:function(e){return a("".concat(null!=e?e:1).concat(d))}},u))},(0,f.mapProps)({onInput:"onChange"})),P="InputTime",A=j({},P,T),I={name:(0,c.uid)(),"x-component":"FormV2","x-use-component-props":k,type:"object",properties:{sessionExpirationTime:{type:"string",title:"{{t('Session validity period')}}","x-decorator":"FormItem","x-component":P,required:!0,description:(0,u.tval)("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.")},tokenExpirationTime:{type:"string",title:"{{t('Token validity period')}}","x-decorator":"FormItem","x-component":P,required:!0,description:(0,u.tval)("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)")},expiredTokenRenewLimit:{type:"string",title:"{{t('Expired token refresh limit')}}","x-decorator":"FormItem","x-component":P,"x-component-props":{minNum:0},required:!0,description:(0,u.tval)("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.")},footer:{type:"void","x-component":"ActionBar","x-component-props":{layout:"one-column"},properties:{submit:{title:'{{t("Submit")}}',"x-component":"Action","x-use-component-props":O}}}}},C=function(){var e=(0,l.dE)().t;return i().createElement(s.Card,{bordered:!1},i().createElement(a.SchemaComponent,{schema:I,scope:function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({t:e},x),components:A}))}}}]);
|
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(912),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")()},912: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 _=(0,r.lazy)(function(){return n.e("443").then(n.bind(n,862))},"AuthProvider").AuthProvider,F=(0,r.lazy)(function(){return Promise.resolve().then(n.bind(n,751))},"Options","SignInForm","SignUpForm"),R=F.Options,N=F.SignInForm,U=F.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([_,{}]),this.registerType("Email/Password",{components:{SignInForm:N,SignUpForm:U,AdminSettingsForm:R}}),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 F},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 }}"}}}}}}}}}}}})},_=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)},F=function(){var e=(0,a.dE)().t,t=_(),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},531: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){var a=window.__nocobase_modern_client_prefix__||"v",u="/"+(a=String(a).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(r=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var c=window.location.pathname||"/",l=c.indexOf(u);r=l>=0?c.slice(0,l+1):"/"}r&&(r=r.replace(RegExp("/"+a+"/?$"),"/")),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:"aa711879b4855b88",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(531),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 _=(0,r.lazy)(function(){return n.e("443").then(n.bind(n,862))},"AuthProvider").AuthProvider,F=(0,r.lazy)(function(){return Promise.resolve().then(n.bind(n,751))},"Options","SignInForm","SignUpForm"),R=F.Options,N=F.SignInForm,U=F.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,352))},"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([_,{}]),this.registerType("Email/Password",{components:{SignInForm:N,SignUpForm:U,AdminSettingsForm:R}}),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 F},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 }}"}}}}}}}}}}}})},_=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)},F=function(){var e=(0,a.dE)().t,t=_(),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},971:function(e,t,n){"use strict";var r="",o="u">typeof document?document.currentScript:null;if(o&&o.src){var i=o.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"");i.indexOf("/static/plugins/@nocobase/plugin-auth/dist/client/")>=0&&(r=i.replace(/\/[^\/]+$/,"/"))}if(!r){var a=window.__webpack_public_path__||"";a&&("/"!==a.charAt(a.length-1)&&(a+="/"),r=a+"static/plugins/@nocobase/plugin-auth/dist/client/")}if(!r){var u=window.__nocobase_modern_client_prefix__||"v",c="/"+(u=String(u).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(r=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var l=window.location.pathname||"/",s=l.indexOf(c);r=s>=0?l.slice(0,s+1):"/"}r&&(r=r.replace(RegExp("/"+u+"/?$"),"/")),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:"aa711879b4855b88",611:"bf903b6a5490becc",680:"8758971b4dd75b23"})[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(971),b(574)}()});
|
package/dist/client-v2/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("react-router-dom"),require("@formily/react"),require("@ant-design/icons"),require("@nocobase/flow-engine"),require("ahooks"),require("@nocobase/client-v2"),require("react"),require("antd"),require("@nocobase/utils/client"),require("lodash")):"function"==typeof define&&define.amd?define("@nocobase/plugin-auth/client-v2",["react-i18next","react-router-dom","@formily/react","@ant-design/icons","@nocobase/flow-engine","ahooks","@nocobase/client-v2","react","antd","@nocobase/utils/client","lodash"],t):"object"==typeof exports?exports["@nocobase/plugin-auth/client-v2"]=t(require("react-i18next"),require("react-router-dom"),require("@formily/react"),require("@ant-design/icons"),require("@nocobase/flow-engine"),require("ahooks"),require("@nocobase/client-v2"),require("react"),require("antd"),require("@nocobase/utils/client"),require("lodash")):e["@nocobase/plugin-auth/client-v2"]=t(e["react-i18next"],e["react-router-dom"],e["@formily/react"],e["@ant-design/icons"],e["@nocobase/flow-engine"],e.ahooks,e["@nocobase/client-v2"],e.react,e.antd,e["@nocobase/utils/client"],e.lodash)}(self,function(e,t,n,r,o,i,a,u,l,c,s){return function(){var f,p,d,h={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 l,c,s,f,p,d,h=0,m=!1,y=!1,v=!0;if("function"!=typeof e)throw TypeError("Expected a function");function b(t){var n=l,r=c;return l=c=void 0,h=t,f=e.apply(r,n)}function g(e){var n=e-d,r=e-h;return void 0===d||n>=t||n<0||y&&r>=s}function w(){var e,n,r,i=o();if(g(i))return E(i);p=setTimeout(w,(e=i-d,n=i-h,r=t-e,y?u(r,s-n):r))}function E(e){return(p=void 0,v&&l)?b(e):(l=c=void 0,f)}function S(){var e,n=o(),r=g(n);if(l=arguments,c=this,d=n,r){if(void 0===p)return h=e=d,p=setTimeout(w,t),m?b(e):f;if(y)return clearTimeout(p),p=setTimeout(w,t),b(d)}return void 0===p&&(p=setTimeout(w,t)),f}return t=i(t)||0,r(n)&&(m=!!n.leading,s=(y="maxWait"in n)?a(i(n.maxWait)||0,t):s,v="trailing"in n?!!n.trailing:v),S.cancel=function(){void 0!==p&&clearTimeout(p),h=0,l=d=c=p=void 0},S.flush=function(){return void 0===p?f:E(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,l=/^0b[01]+$/i,c=/^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=l.test(e);return n||c.test(e)?s(e.slice(2),n?2:8):u.test(e)?a:+e}},829:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return s}});var r=n(59),o=n(155),i=n.n(o),a=n(442),u=n(953),l=n(485),c=n(89);function s(){var e,t=r.theme.useToken().token,n=((0,l.useSystemSettings)()||{}).data,o=(0,u.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(l.SwitchLanguage,null)),i().createElement("h1",{style:{textAlign:"center"}},o(null==n||null==(e=n.data)?void 0:e.title)),i().createElement(c.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(l.PoweredBy,null)))}},826:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return h}});var r=n(59),o=n(155),i=n.n(o),a=n(442),u=n(485),l=n(295),c=n(488),s=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 u=e[i](a),l=u.value}catch(e){n(e);return}u.done?t(l):Promise.resolve(l).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,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 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 h(){var e,t=(0,u.useApp)(),n=(0,c.dE)().t,f=d((0,a.useSearchParams)(),1)[0].get("name"),h=(0,l.p)(f),m=d(r.Form.useForm(),1)[0],y=d((0,o.useState)(!1),2),v=y[0],b=y[1],g=d((0,o.useState)(""),2),w=g[0],E=g[1];return((0,s.rN)(n("Reset password")),null==h||null==(e=h.options)?void 0:e.enableResetPassword)?i().createElement(r.Form,{form:m,layout:"vertical",onFinish:function(e){var o;return(o=function(){var o,i,a,u,l;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:l(0)}),u(a,"throw",{value:l(1)}),u(a,"return",{value:l(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function l(u){return function(l){var c=[u,l];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(c){switch(c.label){case 0:E(""),b(!0),c.label=1;case 1:return c.trys.push([1,3,4,5]),[4,t.apiClient.auth.lostPassword(e)];case 2:return c.sent(),r.message.success(n("Reset email sent successfully")),m.resetFields(),[3,5];case 3:return E((null==(o=c.sent())||null==(l=o.response)||null==(u=l.data)||null==(a=u.errors)||null==(i=a[0])?void 0:i.message)||(null==o?void 0:o.message)||String(o)),[3,5];case 4:return b(!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,u,"next",e)}function u(e){p(i,n,r,a,u,"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:v,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 h}});var r=n(59),o=n(155),i=n.n(o),a=n(442),u=n(485),l=n(295),c=n(488),s=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 u=e[i](a),l=u.value}catch(e){n(e);return}u.done?t(l):Promise.resolve(l).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,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 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 h(){var e,t=(0,u.useApp)(),n=(0,c.dE)().t,f=(0,a.useNavigate)(),h=d((0,a.useSearchParams)(),1)[0],m=h.get("resetToken"),y=h.get("name"),v=(0,l.p)(y),b=d(r.Form.useForm(),1)[0],g=d((0,o.useState)(!1),2),w=g[0],E=g[1],S=d((0,o.useState)(!0),2),O=S[0],k=S[1],A=d((0,o.useState)(!1),2),P=A[0],x=A[1],T=d((0,o.useState)(""),2),j=T[0],_=T[1];return((0,s.rN)(n("Reset password")),(0,o.useEffect)(function(){var e=!0;if(!m){E(!0),k(!1);return}return t.apiClient.auth.checkResetToken({resetToken:m}).then(function(){e&&(E(!1),k(!1))}).catch(function(){e&&(E(!0),k(!1))}),function(){e=!1}},[t,m]),null==v||null==(e=v.options)?void 0:e.enableResetPassword)?O||m&&!w?i().createElement(r.Form,{form:b,layout:"vertical",onFinish:function(e){var o;return(o=function(){var o,i,a,u,l;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:l(0)}),u(a,"throw",{value:l(1)}),u(a,"return",{value:l(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function l(u){return function(l){var c=[u,l];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(c){switch(c.label){case 0:_(""),x(!0),c.label=1;case 1:var s,p;return c.trys.push([1,3,4,5]),[4,t.apiClient.auth.resetPassword((s=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:m},Object.getOwnPropertyDescriptors?Object.defineProperties(s,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(s,e,Object.getOwnPropertyDescriptor(p,e))}),s))];case 2:return c.sent(),r.message.success(n("Password reset successful")),window.setTimeout(function(){f("/signin",{replace:!0})},1e3),[3,5];case 3:return _((null==(o=c.sent())||null==(l=o.response)||null==(u=l.data)||null==(a=u.errors)||null==(i=a[0])?void 0:i.message)||(null==o?void 0:o.message)||String(o)),[3,5];case 4:return x(!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,u,"next",e)}function u(e){p(i,n,r,a,u,"throw",e)}a(void 0)})})()}},j?i().createElement(r.Alert,{style:{marginBottom:16},type:"error",showIcon:!0,message:j}):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:P||O,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}});var r=n(485),o=n(59),i=n(155),a=n.n(i),u=n(295),l=n(824),c=n(488),s=n(434);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){var t=(0,r.usePlugin)(s.A);return(0,i.useMemo)(function(){var n={},r=!0,o=!1,i=void 0;try{for(var a,u=t.authTypes.getEntities()[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var l,c=(l=a.value,function(e){if(Array.isArray(e))return e}(l)||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}}(l)||function(e){if(e){if("string"==typeof e)return f(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 f(e,2)}}(l)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),s=c[0],p=c[1][e];p&&(n[s]=p)}}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n},[t,e])}function d(e){var t=new Map;return function(n){if(e[n])return t.has(n)||t.set(n,(0,i.lazy)(e[n])),t.get(n)}}function h(){var e=(0,c.dE)().t,t=(0,c.kj)(),n=(0,i.useContext)(u.m),r=p("signInFormLoader"),s=p("signInButtonLoader"),f=(0,i.useMemo)(function(){return d(r)},[r]),h=(0,i.useMemo)(function(){return d(s)},[s]);(0,l.rN)(e("Signin"));var m=(0,i.useMemo)(function(){return n.map(function(n){var r=f(n.authType);if(!r)return null;var u=t(n.authTypeTitle||n.authType);return{key:n.name,label:n.title||"".concat(e("Sign-in")," (").concat(u,")"),children:a().createElement(i.Suspense,{fallback:a().createElement(o.Spin,null)},a().createElement(r,{authenticator:n}))}}).filter(Boolean)},[n,f,e,t]),y=(0,i.useMemo)(function(){return n.map(function(e,t){var n=h(e.authType);return n?a().createElement(i.Suspense,{key:"".concat(e.name,"-").concat(t),fallback:a().createElement(o.Spin,null)},a().createElement(n,{authenticator:e})):null}).filter(Boolean)},[n,h]);return n.length?a().createElement(o.Space,{direction:"vertical",style:{display:"flex"}},m.length>1?a().createElement(o.Tabs,{items:m}):m.length?m[0].children:null,y.length?a().createElement(o.Space,{direction:"vertical",style:{display:"flex"}},y):null):a().createElement(o.Empty,{description:e("No authentication methods available.")})}},872:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return d}});var r=n(485),o=n(59),i=n(155),a=n.n(i),u=n(442),l=n(295),c=n(824),s=n(488),f=n(434);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(){var e,t=(0,s.dE)().t,n=((function(e){if(Array.isArray(e))return e})(e=(0,u.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 p(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 p(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].get("name"),d=(0,l.p)(n),h=(0,r.usePlugin)(f.A),m=(0,i.useMemo)(function(){if(!d)return null;var e,t=null==(e=h.authTypes.get(d.authType))?void 0:e.signUpFormLoader;return t?(0,i.lazy)(t):null},[d,h]);return((0,c.rN)(t("Signup")),d&&m)?a().createElement(i.Suspense,{fallback:a().createElement(o.Spin,null)},a().createElement(m,{authenticatorName:d.name})):a().createElement(o.Empty,{description:t("No authentication methods available.")})}},434:function(e,t,n){"use strict";n.d(t,{A:function(){return x},T:function(){return P}});var r=n(768),o=n(485),i=n(738),a=n.n(i),u=n(258),l=n(488);function c(e,t,n,r,o,i,a){try{var u=e[i](a),l=u.value}catch(e){n(e);return}u.done?t(l):Promise.resolve(l).then(r,o)}function s(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){c(i,r,o,a,u,"next",e)}function u(e){c(i,r,o,a,u,"throw",e)}a(void 0)})}}function f(e,t,n){return t=v(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,E()?Reflect.construct(t,n||[],v(e).constructor):t.apply(e,n))}function p(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function d(e,t,n){return(d=E()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&g(o,n.prototype),o}).apply(null,arguments)}function h(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 m(e,t,n){return t&&h(e.prototype,t),n&&h(e,n),e}function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v(e){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function b(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&&g(e,t)}function g(e,t){return(g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function w(e){var t="function"==typeof Map?new Map:void 0;return(w=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 d(e,arguments,v(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),g(n,e)})(e)}function E(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(E=function(){return!!e})()}function S(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:l(0)}),u(a,"throw",{value:l(1)}),u(a,"return",{value:l(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function l(u){return function(l){var c=[u,l];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var O=function(e){function t(){var e;return p(this,t),e=f(this,t,arguments),y(e,"section","preferences"),y(e,"sort",350),y(e,"label","Language"),e}return b(t,e),m(t,[{key:"prepare",value:function(){return s(function(){var e,t,n,r,i;return S(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 s(function(){return S(this,function(t){return this.context.app.apiClient.auth.setLocale(e),window.location.reload(),[2]})}).call(this)}}]),t}(o.UserCenterSelectItemModel);y(O,"itemId","language");var k={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"},A=a()(function(e){e()},3e3,{leading:!0,trailing:!1}),P=function(e){function t(){var e;return p(this,t),e=f(this,t,arguments),y(e,"authTypes",new r.Registry),e}return b(t,e),m(t,[{key:"registerType",value:function(e,t){this.authTypes.register(e,t)}},{key:"load",value:function(){return s(function(){return S(this,function(e){return this.app.providers.unshift([u.A,{}]),this.app.flowEngine.registerModels({UserCenterLanguageItemModel:O}),this.addRoutes(),this.registerPresetAuthType(),this.registerSettingsPages(),this.installInterceptors(),[2]})}).call(this)}},{key:"registerSettingsPages",value:function(){var e=this,t=function(t){return e.app.i18n.t(t,{ns:l.CU})};this.pluginSettingsManager.addMenuItem({key:l.CU,title:t("Authentication"),icon:"LoginOutlined",aclSnippet:"pm.auth"}),this.pluginSettingsManager.addPageTabItem({menuKey:l.CU,key:"authenticators",title:t("Authenticators"),icon:"LoginOutlined",aclSnippet:"pm.auth.authenticators",sort:1,componentLoader:function(){return n.e("9").then(n.bind(n,648))}}),this.pluginSettingsManager.addPageTabItem({menuKey:"security",key:"token-policy",title:t("Token policy"),icon:"ApiOutlined",aclSnippet:"pm.security.token-policy",sort:0,componentLoader:function(){return n.e("657").then(n.bind(n,632))}})}},{key:"addRoutes",value:function(){this.router.add("auth",{componentLoader:function(){return Promise.resolve().then(n.bind(n,829))}}),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",{signInFormLoader:function(){return n.e("795").then(n.bind(n,918))},signUpFormLoader:function(){return n.e("841").then(n.bind(n,720))},adminSettingsFormLoader:function(){return n.e("217").then(n.bind(n,264))}})}},{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,u,l,c,s,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,h=(null==(l=e.app.router.router)||null==(u=l.state)?void 0:u.location)||window.location,m=(null==h?void 0:h.pathname)||window.location.pathname,y=(null==t?void 0:t.status)||(null==t||null==(c=t.response)?void 0:c.status);if(f&&e.app.apiClient.auth.setToken(f),401===y&&(null==d?void 0:d.code)&&k[null==d?void 0:d.code]&&(e.app.apiClient.auth.setToken(""),e.app.apiClient.auth.setRole(""),e.app.apiClient.auth.setAuthenticator("")),401===y&&!(null==(s=t.config)?void 0:s.skipAuth)&&(null==d?void 0:d.code)&&k[null==d?void 0:d.code]){if((null==d?void 0:d.code)===k.SKIP_TOKEN_RENEW)throw t;var v=e.app.router.isSkippedAuthCheckRoute(m);if(v&&(t.config.skipNotify=!0),!v){var b=(0,o.getCurrentV2RedirectPath)(e.app,h);return A(function(){e.app.apiClient.auth.setToken(""),e.app.router.navigate("/signin?redirect=".concat(encodeURIComponent(b)),{replace:!0})}),new Promise(function(){})}}throw t},synchronous:!1,runWhen:null})}}]),t}(w(o.Plugin)),x=P},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)(),u=(0,a.useNavigate)(),l=(0,a.useLocation)();return(0,o.useEffect)(function(){var e=new URLSearchParams(l.search),t=e.get("token"),r=e.get("authenticator");if(t){n.apiClient.auth.setToken(t),n.apiClient.auth.setAuthenticator(r),e.delete("token"),e.delete("authenticator");var o=e.toString();u({pathname:l.pathname,search:o?"?".concat(o):""},{replace:!0})}},[n,l.pathname,l.search,u]),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),u=n(295);function l(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,c=e.children,s=(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 l(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 l(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 s.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}},[s]),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(u.m.Provider,{value:p.authenticators},c)}},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 s},rN:function(){return c},wn:function(){return l}});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 u(e,t,n,r,o,i,a){try{var u=e[i](a),l=u.value}catch(e){n(e);return}u.done?t(l):Promise.resolve(l).then(r,o)}function l(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/admin",n=(0,i.useApp)(),u=(0,o.useNavigate)(),l=(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(){var e,r;u(function(e,t){if(!t||"/"===t)return e.startsWith("/")?e:"/".concat(e);var n=t.endsWith("/")?t.slice(0,-1):t;return e===n?"/":e.startsWith("".concat(n,"/"))?e.slice(n.length)||"/":e}(l.get("redirect")||t,null==(e=(r=n.router).getBasename)?void 0:e.call(r)),{replace:!0})},[n.router,u,t,l])}function c(e){(0,r.useEffect)(function(){document.title=e},[e])}function s(e){var t=(0,i.useApp)(),n=l();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),u=Object.defineProperty;return u(a,"next",{value:l(0)}),u(a,"throw",{value:l(1)}),u(a,"return",{value:l(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function l(u){return function(l){var c=[u,l];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[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(),[4,t.apiClient.request({url:"/auth:check",skipAuth:!0,skipNotify:!0}).catch(function(){})];case 2: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){u(i,n,r,a,l,"next",e)}function l(e){u(i,n,r,a,l,"throw",e)}a(void 0)})})()}}}},488:function(e,t,n){"use strict";n.d(t,{CU:function(){return i},dE:function(){return a},kj:function(){return u}});var r=n(694),o=n(953),i="auth";function a(){return(0,o.useTranslation)([i,"client"],{nsMode:"fallback"})}function u(){var e=(0,r.useFlowEngine)();return function(t){return e.context.t(t,{ns:[i,"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=a},694:function(e){"use strict";e.exports=o},768:function(e){"use strict";e.exports=c},6:function(e){"use strict";e.exports=i},59:function(e){"use strict";e.exports=l},773:function(e){"use strict";e.exports=s},155:function(e){"use strict";e.exports=u},953:function(t){"use strict";t.exports=e},442:function(e){"use strict";e.exports=t}},m={};function y(e){var t=m[e];if(void 0!==t)return t.exports;var n=m[e]={exports:{}};return h[e](n,n.exports,y),n.exports}y.m=h,y.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return y.d(t,{a:t}),t},y.d=function(e,t){for(var n in t)y.o(t,n)&&!y.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},y.f={},y.e=function(e){return Promise.all(Object.keys(y.f).reduce(function(t,n){return y.f[n](e,t),t},[]))},y.u=function(e){return""+e+"."+({217:"09744ff679406aff",657:"2a9dcca9ddc31ec0",795:"b26178560fd03daa",841:"ac9bfbb0615510e5",9:"5301763a7da120fa"})[e]+".js"},y.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),y.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},v={},y.l=function(e,t,n,r){if(v[e])return void v[e].push(t);if(void 0!==n)for(var o,i,a=document.getElementsByTagName("script"),u=0;u<a.length;u++){var l=a[u];if(l.getAttribute("src")==e||l.getAttribute("data-rspack")=="@nocobase/plugin-auth/client-v2:"+n){o=l;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,y.nc&&o.setAttribute("nonce",y.nc),o.setAttribute("data-rspack","@nocobase/plugin-auth/client-v2:"+n),o.src=e),v[e]=[t];var c=function(t,n){o.onerror=o.onload=null,clearTimeout(s);var r=v[e];if(delete v[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},s=setTimeout(c.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=c.bind(null,o.onerror),o.onload=c.bind(null,o.onload),i&&document.head.appendChild(o)},y.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},y.g.importScripts&&(b=y.g.location+"");var v,b,g=y.g.document;if(!b&&g&&(g.currentScript&&"SCRIPT"===g.currentScript.tagName.toUpperCase()&&(b=g.currentScript.src),!b)){var w=g.getElementsByTagName("script");if(w.length)for(var E=w.length-1;E>-1&&(!b||!/^http(s?):/.test(b));)b=w[E--].src}if(!b)throw Error("Automatic publicPath is not supported in this browser");y.p=b.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),f={889:0},y.f.j=function(e,t){var n=y.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=y.p+y.u(e),i=Error();y.l(o,function(t){if(y.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)}},p=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)y.o(i,n)&&(y.m[n]=i[n]);a&&a(y)}for(e&&e(t);u<o.length;u++)r=o[u],y.o(f,r)&&f[r]&&f[r][0](),f[r]=0},(d=self.webpackChunk_nocobase_plugin_auth_client_v2=self.webpackChunk_nocobase_plugin_auth_client_v2||[]).forEach(p.bind(null,0)),d.push=p.bind(null,d.push.bind(d));var S={};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){var r=window.__nocobase_modern_client_prefix__||"v",o="/"+(r=String(r).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var i=window.location.pathname||"/",a=i.indexOf(o);e=a>=0?i.slice(0,a+1):"/"}e&&(e=e.replace(RegExp("/"+r+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-auth/dist/client-v2/"}y.p=e}(),!function(){"use strict";y.r(S),y.d(S,{AuthLayout:function(){return o.default},AuthProvider:function(){return c.A},AuthenticatorsContext:function(){return t.m},AuthenticatorsContextProvider:function(){return s.A},ForgotPasswordPage:function(){return u.default},NAMESPACE:function(){return n.CU},PluginAuthClientV2:function(){return e.T},ResetPasswordPage:function(){return l.default},SignInPage:function(){return i.default},SignUpPage:function(){return a.default},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},useT:function(){return n.kj}});var e=y(434),t=y(295),n=y(488),r=y(824),o=y(829),i=y(818),a=y(872),u=y(826),l=y(622),c=y(258),s=y(89)}(),S}()});
|
|
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/flow-engine"),require("ahooks"),require("@nocobase/client-v2"),require("react"),require("antd"),require("@nocobase/utils/client"),require("lodash")):"function"==typeof define&&define.amd?define("@nocobase/plugin-auth/client-v2",["react-i18next","react-router-dom","@formily/react","@ant-design/icons","@nocobase/flow-engine","ahooks","@nocobase/client-v2","react","antd","@nocobase/utils/client","lodash"],t):"object"==typeof exports?exports["@nocobase/plugin-auth/client-v2"]=t(require("react-i18next"),require("react-router-dom"),require("@formily/react"),require("@ant-design/icons"),require("@nocobase/flow-engine"),require("ahooks"),require("@nocobase/client-v2"),require("react"),require("antd"),require("@nocobase/utils/client"),require("lodash")):e["@nocobase/plugin-auth/client-v2"]=t(e["react-i18next"],e["react-router-dom"],e["@formily/react"],e["@ant-design/icons"],e["@nocobase/flow-engine"],e.ahooks,e["@nocobase/client-v2"],e.react,e.antd,e["@nocobase/utils/client"],e.lodash)}(self,function(e,t,n,r,o,i,a,u,l,c,s){return function(){var f,p,d,h={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 l,c,s,f,p,d,h=0,m=!1,y=!1,v=!0;if("function"!=typeof e)throw TypeError("Expected a function");function b(t){var n=l,r=c;return l=c=void 0,h=t,f=e.apply(r,n)}function g(e){var n=e-d,r=e-h;return void 0===d||n>=t||n<0||y&&r>=s}function w(){var e,n,r,i=o();if(g(i))return E(i);p=setTimeout(w,(e=i-d,n=i-h,r=t-e,y?u(r,s-n):r))}function E(e){return(p=void 0,v&&l)?b(e):(l=c=void 0,f)}function S(){var e,n=o(),r=g(n);if(l=arguments,c=this,d=n,r){if(void 0===p)return h=e=d,p=setTimeout(w,t),m?b(e):f;if(y)return clearTimeout(p),p=setTimeout(w,t),b(d)}return void 0===p&&(p=setTimeout(w,t)),f}return t=i(t)||0,r(n)&&(m=!!n.leading,s=(y="maxWait"in n)?a(i(n.maxWait)||0,t):s,v="trailing"in n?!!n.trailing:v),S.cancel=function(){void 0!==p&&clearTimeout(p),h=0,l=d=c=p=void 0},S.flush=function(){return void 0===p?f:E(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,l=/^0b[01]+$/i,c=/^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=l.test(e);return n||c.test(e)?s(e.slice(2),n?2:8):u.test(e)?a:+e}},829:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return s}});var r=n(59),o=n(155),i=n.n(o),a=n(442),u=n(953),l=n(485),c=n(89);function s(){var e,t=r.theme.useToken().token,n=((0,l.useSystemSettings)()||{}).data,o=(0,u.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(l.SwitchLanguage,null)),i().createElement("h1",{style:{textAlign:"center"}},o(null==n||null==(e=n.data)?void 0:e.title)),i().createElement(c.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(l.PoweredBy,null)))}},826:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return h}});var r=n(59),o=n(155),i=n.n(o),a=n(442),u=n(485),l=n(295),c=n(488),s=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 u=e[i](a),l=u.value}catch(e){n(e);return}u.done?t(l):Promise.resolve(l).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,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 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 h(){var e,t=(0,u.useApp)(),n=(0,c.dE)().t,f=d((0,a.useSearchParams)(),1)[0].get("name"),h=(0,l.p)(f),m=d(r.Form.useForm(),1)[0],y=d((0,o.useState)(!1),2),v=y[0],b=y[1],g=d((0,o.useState)(""),2),w=g[0],E=g[1];return((0,s.rN)(n("Reset password")),null==h||null==(e=h.options)?void 0:e.enableResetPassword)?i().createElement(r.Form,{form:m,layout:"vertical",onFinish:function(e){var o;return(o=function(){var o,i,a,u,l;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:l(0)}),u(a,"throw",{value:l(1)}),u(a,"return",{value:l(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function l(u){return function(l){var c=[u,l];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(c){switch(c.label){case 0:E(""),b(!0),c.label=1;case 1:return c.trys.push([1,3,4,5]),[4,t.apiClient.auth.lostPassword(e)];case 2:return c.sent(),r.message.success(n("Reset email sent successfully")),m.resetFields(),[3,5];case 3:return E((null==(o=c.sent())||null==(l=o.response)||null==(u=l.data)||null==(a=u.errors)||null==(i=a[0])?void 0:i.message)||(null==o?void 0:o.message)||String(o)),[3,5];case 4:return b(!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,u,"next",e)}function u(e){p(i,n,r,a,u,"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:v,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 h}});var r=n(59),o=n(155),i=n.n(o),a=n(442),u=n(485),l=n(295),c=n(488),s=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 u=e[i](a),l=u.value}catch(e){n(e);return}u.done?t(l):Promise.resolve(l).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,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 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 h(){var e,t=(0,u.useApp)(),n=(0,c.dE)().t,f=(0,a.useNavigate)(),h=d((0,a.useSearchParams)(),1)[0],m=h.get("resetToken"),y=h.get("name"),v=(0,l.p)(y),b=d(r.Form.useForm(),1)[0],g=d((0,o.useState)(!1),2),w=g[0],E=g[1],S=d((0,o.useState)(!0),2),O=S[0],k=S[1],A=d((0,o.useState)(!1),2),P=A[0],x=A[1],T=d((0,o.useState)(""),2),j=T[0],_=T[1];return((0,s.rN)(n("Reset password")),(0,o.useEffect)(function(){var e=!0;if(!m){E(!0),k(!1);return}return t.apiClient.auth.checkResetToken({resetToken:m}).then(function(){e&&(E(!1),k(!1))}).catch(function(){e&&(E(!0),k(!1))}),function(){e=!1}},[t,m]),null==v||null==(e=v.options)?void 0:e.enableResetPassword)?O||m&&!w?i().createElement(r.Form,{form:b,layout:"vertical",onFinish:function(e){var o;return(o=function(){var o,i,a,u,l;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:l(0)}),u(a,"throw",{value:l(1)}),u(a,"return",{value:l(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function l(u){return function(l){var c=[u,l];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(c){switch(c.label){case 0:_(""),x(!0),c.label=1;case 1:var s,p;return c.trys.push([1,3,4,5]),[4,t.apiClient.auth.resetPassword((s=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:m},Object.getOwnPropertyDescriptors?Object.defineProperties(s,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(s,e,Object.getOwnPropertyDescriptor(p,e))}),s))];case 2:return c.sent(),r.message.success(n("Password reset successful")),window.setTimeout(function(){f("/signin",{replace:!0})},1e3),[3,5];case 3:return _((null==(o=c.sent())||null==(l=o.response)||null==(u=l.data)||null==(a=u.errors)||null==(i=a[0])?void 0:i.message)||(null==o?void 0:o.message)||String(o)),[3,5];case 4:return x(!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,u,"next",e)}function u(e){p(i,n,r,a,u,"throw",e)}a(void 0)})})()}},j?i().createElement(r.Alert,{style:{marginBottom:16},type:"error",showIcon:!0,message:j}):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:P||O,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}});var r=n(485),o=n(59),i=n(155),a=n.n(i),u=n(295),l=n(824),c=n(488),s=n(434);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){var t=(0,r.usePlugin)(s.A);return(0,i.useMemo)(function(){var n={},r=!0,o=!1,i=void 0;try{for(var a,u=t.authTypes.getEntities()[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var l,c=(l=a.value,function(e){if(Array.isArray(e))return e}(l)||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}}(l)||function(e){if(e){if("string"==typeof e)return f(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 f(e,2)}}(l)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),s=c[0],p=c[1][e];p&&(n[s]=p)}}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n},[t,e])}function d(e){var t=new Map;return function(n){if(e[n])return t.has(n)||t.set(n,(0,i.lazy)(e[n])),t.get(n)}}function h(){var e=(0,c.dE)().t,t=(0,c.kj)(),n=(0,i.useContext)(u.m),r=p("signInFormLoader"),s=p("signInButtonLoader"),f=(0,i.useMemo)(function(){return d(r)},[r]),h=(0,i.useMemo)(function(){return d(s)},[s]);(0,l.rN)(e("Signin"));var m=(0,i.useMemo)(function(){return n.map(function(n){var r=f(n.authType);if(!r)return null;var u=t(n.authTypeTitle||n.authType);return{key:n.name,label:n.title||"".concat(e("Sign-in")," (").concat(u,")"),children:a().createElement(i.Suspense,{fallback:a().createElement(o.Spin,null)},a().createElement(r,{authenticator:n}))}}).filter(Boolean)},[n,f,e,t]),y=(0,i.useMemo)(function(){return n.map(function(e,t){var n=h(e.authType);return n?a().createElement(i.Suspense,{key:"".concat(e.name,"-").concat(t),fallback:a().createElement(o.Spin,null)},a().createElement(n,{authenticator:e})):null}).filter(Boolean)},[n,h]);return n.length?a().createElement(o.Space,{direction:"vertical",style:{display:"flex"}},m.length>1?a().createElement(o.Tabs,{items:m}):m.length?m[0].children:null,y.length?a().createElement(o.Space,{direction:"vertical",style:{display:"flex"}},y):null):a().createElement(o.Empty,{description:e("No authentication methods available.")})}},872:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return d}});var r=n(485),o=n(59),i=n(155),a=n.n(i),u=n(442),l=n(295),c=n(824),s=n(488),f=n(434);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(){var e,t=(0,s.dE)().t,n=((function(e){if(Array.isArray(e))return e})(e=(0,u.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 p(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 p(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].get("name"),d=(0,l.p)(n),h=(0,r.usePlugin)(f.A),m=(0,i.useMemo)(function(){if(!d)return null;var e,t=null==(e=h.authTypes.get(d.authType))?void 0:e.signUpFormLoader;return t?(0,i.lazy)(t):null},[d,h]);return((0,c.rN)(t("Signup")),d&&m)?a().createElement(i.Suspense,{fallback:a().createElement(o.Spin,null)},a().createElement(m,{authenticatorName:d.name})):a().createElement(o.Empty,{description:t("No authentication methods available.")})}},434:function(e,t,n){"use strict";n.d(t,{A:function(){return x},T:function(){return P}});var r=n(768),o=n(485),i=n(738),a=n.n(i),u=n(258),l=n(488);function c(e,t,n,r,o,i,a){try{var u=e[i](a),l=u.value}catch(e){n(e);return}u.done?t(l):Promise.resolve(l).then(r,o)}function s(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){c(i,r,o,a,u,"next",e)}function u(e){c(i,r,o,a,u,"throw",e)}a(void 0)})}}function f(e,t,n){return t=v(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,E()?Reflect.construct(t,n||[],v(e).constructor):t.apply(e,n))}function p(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function d(e,t,n){return(d=E()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&g(o,n.prototype),o}).apply(null,arguments)}function h(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 m(e,t,n){return t&&h(e.prototype,t),n&&h(e,n),e}function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v(e){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function b(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&&g(e,t)}function g(e,t){return(g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function w(e){var t="function"==typeof Map?new Map:void 0;return(w=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 d(e,arguments,v(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),g(n,e)})(e)}function E(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(E=function(){return!!e})()}function S(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:l(0)}),u(a,"throw",{value:l(1)}),u(a,"return",{value:l(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function l(u){return function(l){var c=[u,l];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var O=function(e){function t(){var e;return p(this,t),e=f(this,t,arguments),y(e,"section","preferences"),y(e,"sort",350),y(e,"label","Language"),e}return b(t,e),m(t,[{key:"prepare",value:function(){return s(function(){var e,t,n,r,i;return S(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 s(function(){return S(this,function(t){return this.context.app.apiClient.auth.setLocale(e),window.location.reload(),[2]})}).call(this)}}]),t}(o.UserCenterSelectItemModel);y(O,"itemId","language");var k={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"},A=a()(function(e){e()},3e3,{leading:!0,trailing:!1}),P=function(e){function t(){var e;return p(this,t),e=f(this,t,arguments),y(e,"authTypes",new r.Registry),e}return b(t,e),m(t,[{key:"registerType",value:function(e,t){this.authTypes.register(e,t)}},{key:"load",value:function(){return s(function(){return S(this,function(e){return this.app.providers.unshift([u.A,{}]),this.app.flowEngine.registerModels({UserCenterLanguageItemModel:O}),this.addRoutes(),this.registerPresetAuthType(),this.registerSettingsPages(),this.installInterceptors(),[2]})}).call(this)}},{key:"registerSettingsPages",value:function(){var e=this,t=function(t){return e.app.i18n.t(t,{ns:l.CU})};this.pluginSettingsManager.addMenuItem({key:l.CU,title:t("Authentication"),icon:"LoginOutlined",aclSnippet:"pm.auth"}),this.pluginSettingsManager.addPageTabItem({menuKey:l.CU,key:"authenticators",title:t("Authenticators"),icon:"LoginOutlined",aclSnippet:"pm.auth.authenticators",sort:1,componentLoader:function(){return n.e("9").then(n.bind(n,648))}}),this.pluginSettingsManager.addPageTabItem({menuKey:"security",key:"token-policy",title:t("Token policy"),icon:"ApiOutlined",aclSnippet:"pm.security.token-policy",sort:0,componentLoader:function(){return n.e("657").then(n.bind(n,632))}})}},{key:"addRoutes",value:function(){this.router.add("auth",{componentLoader:function(){return Promise.resolve().then(n.bind(n,829))}}),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",{signInFormLoader:function(){return n.e("795").then(n.bind(n,918))},signUpFormLoader:function(){return n.e("841").then(n.bind(n,720))},adminSettingsFormLoader:function(){return n.e("217").then(n.bind(n,264))}})}},{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,u,l,c,s,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,h=(null==(l=e.app.router.router)||null==(u=l.state)?void 0:u.location)||window.location,m=(null==h?void 0:h.pathname)||window.location.pathname,y=(null==t?void 0:t.status)||(null==t||null==(c=t.response)?void 0:c.status);if(f&&e.app.apiClient.auth.setToken(f),401===y&&(null==d?void 0:d.code)&&k[null==d?void 0:d.code]&&(e.app.apiClient.auth.setToken(""),e.app.apiClient.auth.setRole(""),e.app.apiClient.auth.setAuthenticator("")),401===y&&!(null==(s=t.config)?void 0:s.skipAuth)&&(null==d?void 0:d.code)&&k[null==d?void 0:d.code]){if((null==d?void 0:d.code)===k.SKIP_TOKEN_RENEW)throw t;var v=e.app.router.isSkippedAuthCheckRoute(m);if(v&&(t.config.skipNotify=!0),!v){var b=(0,o.getCurrentV2RedirectPath)(e.app,h);return A(function(){e.app.apiClient.auth.setToken(""),e.app.router.navigate("/signin?redirect=".concat(encodeURIComponent(b)),{replace:!0})}),new Promise(function(){})}}throw t},synchronous:!1,runWhen:null})}}]),t}(w(o.Plugin)),x=P},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)(),u=(0,a.useNavigate)(),l=(0,a.useLocation)();return(0,o.useEffect)(function(){var e=new URLSearchParams(l.search),t=e.get("token"),r=e.get("authenticator");if(t){n.apiClient.auth.setToken(t),n.apiClient.auth.setAuthenticator(r),e.delete("token"),e.delete("authenticator");var o=e.toString();u({pathname:l.pathname,search:o?"?".concat(o):""},{replace:!0})}},[n,l.pathname,l.search,u]),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),u=n(295);function l(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,c=e.children,s=(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 l(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 l(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 s.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}},[s]),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(u.m.Provider,{value:p.authenticators},c)}},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 s},rN:function(){return c},wn:function(){return l}});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 u(e,t,n,r,o,i,a){try{var u=e[i](a),l=u.value}catch(e){n(e);return}u.done?t(l):Promise.resolve(l).then(r,o)}function l(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/admin",n=(0,i.useApp)(),u=(0,o.useNavigate)(),l=(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(){var e,r;u(function(e,t){if(!t||"/"===t)return e.startsWith("/")?e:"/".concat(e);var n=t.endsWith("/")?t.slice(0,-1):t;return e===n?"/":e.startsWith("".concat(n,"/"))?e.slice(n.length)||"/":e}(l.get("redirect")||t,null==(e=(r=n.router).getBasename)?void 0:e.call(r)),{replace:!0})},[n.router,u,t,l])}function c(e){(0,r.useEffect)(function(){document.title=e},[e])}function s(e){var t=(0,i.useApp)(),n=l();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),u=Object.defineProperty;return u(a,"next",{value:l(0)}),u(a,"throw",{value:l(1)}),u(a,"return",{value:l(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function l(u){return function(l){var c=[u,l];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[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(),[4,t.apiClient.request({url:"/auth:check",skipAuth:!0,skipNotify:!0}).catch(function(){})];case 2: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){u(i,n,r,a,l,"next",e)}function l(e){u(i,n,r,a,l,"throw",e)}a(void 0)})})()}}}},488:function(e,t,n){"use strict";n.d(t,{CU:function(){return i},dE:function(){return a},kj:function(){return u}});var r=n(694),o=n(953),i="auth";function a(){return(0,o.useTranslation)([i,"client"],{nsMode:"fallback"})}function u(){var e=(0,r.useFlowEngine)();return function(t){return e.context.t(t,{ns:[i,"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=a},694:function(e){"use strict";e.exports=o},768:function(e){"use strict";e.exports=c},6:function(e){"use strict";e.exports=i},59:function(e){"use strict";e.exports=l},773:function(e){"use strict";e.exports=s},155:function(e){"use strict";e.exports=u},953:function(t){"use strict";t.exports=e},442:function(e){"use strict";e.exports=t}},m={};function y(e){var t=m[e];if(void 0!==t)return t.exports;var n=m[e]={exports:{}};return h[e](n,n.exports,y),n.exports}y.m=h,y.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return y.d(t,{a:t}),t},y.d=function(e,t){for(var n in t)y.o(t,n)&&!y.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},y.f={},y.e=function(e){return Promise.all(Object.keys(y.f).reduce(function(t,n){return y.f[n](e,t),t},[]))},y.u=function(e){return""+e+"."+({217:"09744ff679406aff",657:"2a9dcca9ddc31ec0",795:"b26178560fd03daa",841:"ac9bfbb0615510e5",9:"5301763a7da120fa"})[e]+".js"},y.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),y.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},v={},y.l=function(e,t,n,r){if(v[e])return void v[e].push(t);if(void 0!==n)for(var o,i,a=document.getElementsByTagName("script"),u=0;u<a.length;u++){var l=a[u];if(l.getAttribute("src")==e||l.getAttribute("data-rspack")=="@nocobase/plugin-auth/client-v2:"+n){o=l;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,y.nc&&o.setAttribute("nonce",y.nc),o.setAttribute("data-rspack","@nocobase/plugin-auth/client-v2:"+n),o.src=e),v[e]=[t];var c=function(t,n){o.onerror=o.onload=null,clearTimeout(s);var r=v[e];if(delete v[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},s=setTimeout(c.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=c.bind(null,o.onerror),o.onload=c.bind(null,o.onload),i&&document.head.appendChild(o)},y.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},y.g.importScripts&&(b=y.g.location+"");var v,b,g=y.g.document;if(!b&&g&&(g.currentScript&&"SCRIPT"===g.currentScript.tagName.toUpperCase()&&(b=g.currentScript.src),!b)){var w=g.getElementsByTagName("script");if(w.length)for(var E=w.length-1;E>-1&&(!b||!/^http(s?):/.test(b));)b=w[E--].src}if(!b)throw Error("Automatic publicPath is not supported in this browser");y.p=b.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),f={889:0},y.f.j=function(e,t){var n=y.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=y.p+y.u(e),i=Error();y.l(o,function(t){if(y.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)}},p=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)y.o(i,n)&&(y.m[n]=i[n]);a&&a(y)}for(e&&e(t);u<o.length;u++)r=o[u],y.o(f,r)&&f[r]&&f[r][0](),f[r]=0},(d=self.webpackChunk_nocobase_plugin_auth_client_v2=self.webpackChunk_nocobase_plugin_auth_client_v2||[]).forEach(p.bind(null,0)),d.push=p.bind(null,d.push.bind(d));var S={};return!function(){"use strict";var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src){var n=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"");n.indexOf("/static/plugins/@nocobase/plugin-auth/dist/client-v2/")>=0&&(e=n.replace(/\/[^\/]+$/,"/"))}if(!e){var r=window.__webpack_public_path__||"";r&&("/"!==r.charAt(r.length-1)&&(r+="/"),e=r+"static/plugins/@nocobase/plugin-auth/dist/client-v2/")}if(!e){var o=window.__nocobase_modern_client_prefix__||"v",i="/"+(o=String(o).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var a=window.location.pathname||"/",u=a.indexOf(i);e=u>=0?a.slice(0,u+1):"/"}e&&(e=e.replace(RegExp("/"+o+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-auth/dist/client-v2/"}y.p=e}(),!function(){"use strict";y.r(S),y.d(S,{AuthLayout:function(){return o.default},AuthProvider:function(){return c.A},AuthenticatorsContext:function(){return t.m},AuthenticatorsContextProvider:function(){return s.A},ForgotPasswordPage:function(){return u.default},NAMESPACE:function(){return n.CU},PluginAuthClientV2:function(){return e.T},ResetPasswordPage:function(){return l.default},SignInPage:function(){return i.default},SignUpPage:function(){return a.default},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},useT:function(){return n.kj}});var e=y(434),t=y(295),n=y(488),r=y(824),o=y(829),i=y(818),a=y(872),u=y(826),l=y(622),c=y(258),s=y(89)}(),S}()});
|
package/dist/externalVersion.js
CHANGED
|
@@ -8,21 +8,21 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "2.2.0-beta.
|
|
11
|
+
"@nocobase/client": "2.2.0-beta.6",
|
|
12
12
|
"react": "18.2.0",
|
|
13
13
|
"react-router-dom": "6.30.1",
|
|
14
|
-
"@nocobase/utils": "2.2.0-beta.
|
|
14
|
+
"@nocobase/utils": "2.2.0-beta.6",
|
|
15
15
|
"axios": "1.7.7",
|
|
16
16
|
"lodash": "4.18.1",
|
|
17
|
-
"@nocobase/client-v2": "2.2.0-beta.
|
|
18
|
-
"@nocobase/flow-engine": "2.2.0-beta.
|
|
17
|
+
"@nocobase/client-v2": "2.2.0-beta.6",
|
|
18
|
+
"@nocobase/flow-engine": "2.2.0-beta.6",
|
|
19
19
|
"react-i18next": "11.18.6",
|
|
20
|
-
"@nocobase/auth": "2.2.0-beta.
|
|
21
|
-
"@nocobase/database": "2.2.0-beta.
|
|
22
|
-
"@nocobase/cache": "2.2.0-beta.
|
|
23
|
-
"@nocobase/server": "2.2.0-beta.
|
|
24
|
-
"@nocobase/logger": "2.2.0-beta.
|
|
25
|
-
"@nocobase/test": "2.2.0-beta.
|
|
20
|
+
"@nocobase/auth": "2.2.0-beta.6",
|
|
21
|
+
"@nocobase/database": "2.2.0-beta.6",
|
|
22
|
+
"@nocobase/cache": "2.2.0-beta.6",
|
|
23
|
+
"@nocobase/server": "2.2.0-beta.6",
|
|
24
|
+
"@nocobase/logger": "2.2.0-beta.6",
|
|
25
|
+
"@nocobase/test": "2.2.0-beta.6",
|
|
26
26
|
"@formily/antd-v5": "1.2.3",
|
|
27
27
|
"antd": "5.24.2",
|
|
28
28
|
"@formily/shared": "2.3.7",
|
|
@@ -30,6 +30,6 @@ module.exports = {
|
|
|
30
30
|
"@emotion/css": "11.13.0",
|
|
31
31
|
"@ant-design/icons": "5.6.1",
|
|
32
32
|
"ahooks": "3.7.8",
|
|
33
|
-
"@nocobase/actions": "2.2.0-beta.
|
|
33
|
+
"@nocobase/actions": "2.2.0-beta.6",
|
|
34
34
|
"@formily/core": "2.3.7"
|
|
35
35
|
};
|
|
@@ -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-06-
|
|
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-06-22T05:34:10.904Z"}
|
|
@@ -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-06-
|
|
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-06-22T05:34:10.996Z"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-auth",
|
|
3
|
-
"version": "2.2.0-beta.
|
|
3
|
+
"version": "2.2.0-beta.6",
|
|
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",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"description": "User authentication management, including password, SMS, and support for Single Sign-On (SSO) protocols, with extensibility.",
|
|
32
32
|
"description.ru-RU": "Управление аутентификацией пользователей: пароли, SMS, поддержка протоколов единого входа (SSO) и возможность расширения.",
|
|
33
33
|
"description.zh-CN": "用户认证管理,包括基础的密码认证、短信认证、SSO 协议的认证等,可扩展。",
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "dc9246516f8a3efd6056f22fe7b3bc947bd4575b",
|
|
35
35
|
"keywords": [
|
|
36
36
|
"Authentication",
|
|
37
37
|
"Security"
|