openstack-uicore-foundation 2.1.29 → 2.1.33
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/lib/actions.js +1 -1
- package/lib/components.js +1 -1
- package/lib/css/components.css +0 -0
- package/lib/methods.js +1 -1
- package/lib/reducers.js +1 -1
- package/package.json +1 -1
package/lib/css/components.css
CHANGED
|
File without changes
|
package/lib/methods.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],t):"object"==typeof exports?exports["openstack-uicore-foundation"]=t():e["openstack-uicore-foundation"]=t()}(this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=57)}([function(e,t){e.exports=require("react")},function(e,t,n){"use strict";n.d(t,"f",(function(){return c})),n.d(t,"d",(function(){return a})),n.d(t,"e",(function(){return s})),n.d(t,"g",(function(){return d})),n.d(t,"y",(function(){return l})),n.d(t,"k",(function(){return f})),n.d(t,"h",(function(){return p})),n.d(t,"q",(function(){return h})),n.d(t,"r",(function(){return m})),n.d(t,"s",(function(){return b})),n.d(t,"t",(function(){return g})),n.d(t,"j",(function(){return w})),n.d(t,"m",(function(){return y})),n.d(t,"u",(function(){return O})),n.d(t,"n",(function(){return _})),n.d(t,"l",(function(){return j})),n.d(t,"i",(function(){return v})),n.d(t,"b",(function(){return k})),n.d(t,"D",(function(){return S})),n.d(t,"c",(function(){return R})),n.d(t,"z",(function(){return E})),n.d(t,"p",(function(){return U})),n.d(t,"w",(function(){return T})),n.d(t,"B",(function(){return x})),n.d(t,"o",(function(){return $})),n.d(t,"A",(function(){return I})),n.d(t,"v",(function(){return q})),n.d(t,"C",(function(){return C})),n.d(t,"a",(function(){return A})),n.d(t,"x",(function(){return P}));var r=n(10),o=n.n(r),u=n(5),i=n.n(u);const c=e=>{var t=-70;if(e.offsetParent){do{t+=e.offsetTop}while(e=e.offsetParent);return[t]}},a=e=>e?(e*=1e3,o()(e)):e,s=(e,t)=>e?(e*=1e3,o()(e).tz(t)):e,d=(e,t="M/D/YYYY h:mm a")=>e?a(e).format(t):e,l=e=>{var t="";for(var n in e)""!=t&&(t+="&"),t+=n+"="+encodeURIComponent(e[n]);return t},f=()=>{let e=i()(window.location.href),t=e.search(!0),n=e.fragment(),r=t.hasOwnProperty("BackUrl")?t.BackUrl:null;return null!=n&&""!=n&&(r+="#"+n),r},p=()=>"undefined"!=typeof window?window.accessToken:null,h=()=>"undefined"!=typeof window?window.idToken:null,m=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,b=()=>"undefined"!=typeof window?window.IDP_BASE_URL:null,g=()=>"undefined"!=typeof window?window.SCOPES:null,w=()=>"undefined"!=typeof window?window.location.origin+"/auth/callback":null,y=()=>{let e="";return"undefined"!=typeof window&&(e=window.location,window.top&&(e=window.top.location)),e},O=()=>"undefined"!=typeof window?window.location.origin:null,_=()=>"undefined"!=typeof window?window.location.pathname:null,j=()=>"undefined"!=typeof window?window.location.href:null,v=()=>"undefined"!=typeof window?window.ALLOWED_USER_GROUPS||"":null,k=e=>"undefined"!=typeof window?`${window.API_BASE_URL}${e}`:null``,S=(e,t,n)=>{if("undefined"!=typeof window)return window.accessToken=e,window.idToken=t,void(window.sessionState=n)},R=()=>{if("undefined"!=typeof window)return window.accessToken=null,window.idToken=null,void(window.sessionState=null)},E=(e,t)=>{"undefined"!=typeof window&&window.localStorage.setItem(e,t)},U=(e,t)=>{if("undefined"!=typeof window){let n=window.localStorage.getItem(e);return t&&window.localStorage.removeItem(e),n}return null},T=()=>"undefined"!=typeof window&&window.clearing_session_state,x=e=>{"undefined"!=typeof window&&(window.clearing_session_state=e)},$=()=>{let e="en";return"undefined"!=typeof navigator&&(e=navigator.languages&&navigator.languages[0]||navigator.language||navigator.userLanguage),e},I=e=>{if(Object.keys(e).length>0){const t=Object.keys(e)[0],n=document.getElementById(t);n&&window.scrollTo(0,c(n))}},q=(e,t)=>e in t?t[e]:"",C=(e,t)=>{const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(e[r]!==t[r])return!1;return!0},A=(e,t)=>e.length===t.length&&e.every((e,n)=>C(e,t[n])),P=e=>0===Object.keys(e).length},function(e,t,n){"use strict";n.d(t,"b",(function(){return h})),n.d(t,"d",(function(){return m})),n.d(t,"e",(function(){return b})),n.d(t,"f",(function(){return g})),n.d(t,"a",(function(){return w})),n.d(t,"c",(function(){return y})),n.d(t,"h",(function(){return O})),n.d(t,"v",(function(){return _})),n.d(t,"z",(function(){return j})),n.d(t,"A",(function(){return v})),n.d(t,"g",(function(){return R})),n.d(t,"q",(function(){return E})),n.d(t,"u",(function(){return U})),n.d(t,"j",(function(){return T})),n.d(t,"s",(function(){return x})),n.d(t,"r",(function(){return $})),n.d(t,"t",(function(){return I})),n.d(t,"i",(function(){return q})),n.d(t,"w",(function(){return C})),n.d(t,"m",(function(){return A})),n.d(t,"n",(function(){return P})),n.d(t,"x",(function(){return L})),n.d(t,"y",(function(){return D})),n.d(t,"k",(function(){return z})),n.d(t,"o",(function(){return M})),n.d(t,"p",(function(){return N})),n.d(t,"l",(function(){return G}));var r=n(13),o=n.n(r),u=n(5),i=n.n(u),c=n(7),a=n.n(c),s=n(4),d=n.n(s),l=n(1),f=n(6);let p=o.a;const h="RESET_LOADING",m="START_LOADING",b="STOP_LOADING",g="VALIDATE",w="CLEAR_MESSAGE",y="SHOW_MESSAGE",O=e=>t=>({type:e,payload:t}),_=O(h),j=O(m),v=O(b),k={},S=e=>0===Object.keys(e).length&&e.constructor===Object,R=(e,t)=>(t,n)=>{let r=e.status,o="";switch(t(v()),r){case 403:let n={title:"ERROR",html:d.a.translate("errors.user_not_authz"),type:"error"};t(L(n,f.p));break;case 401:let r=Object(l.n)(),c=Object(l.w)();t({type:f.a,payload:{}}),c||(Object(l.B)(!0),console.log("authErrorHandler 401 - re login"),Object(f.j)(r));break;case 404:o="",o=e.response.body&&e.response.body.message?e.response.body.message:e.response.error&&e.response.error.message?e.response.error.message:e.message,a.a.fire("Not Found",o,"warning");break;case 412:for(var[u,i]of Object.entries(e.response.body.errors))isNaN(u)&&(o+=u+": "),o+=i+"<br>";a.a.fire("Validation error",o,"warning"),t({type:g,payload:{errors:e.response.body.errors}});break;default:a.a.fire("ERROR",d.a.translate("errors.server_error"),"error")}},E=(e,t,n,r=q,o={},u=60,c=60,a=!1)=>(s={})=>(d,l)=>{let f=i()(n);S(s)||(f=f.query(s));let h=f.toString();return e&&"function"==typeof e&&d(e(o)),(e=>{k[e]&&(k[e].abort(),console.log("aborted request "+e),delete k[e])})(h),new Promise((e,n)=>{let o=p.get(f.toString());a&&(o=o.withCredentials()),o.timeout({response:1e3*u,deadline:1e3*c}).end(C(d,l,t,r,e,n)),((e,t)=>{k[e]=t})(h,o)})},U=(e,t,n,r,o=q,u={},c=!1)=>(a={})=>(s,d)=>{let l=i()(n);return S(a)||(l=l.query(a)),e&&"function"==typeof e&&s(e(u)),new Promise((e,n)=>{null==r&&(r={});let u=p.put(l.toString());c&&(u=u.withCredentials()),u.send(r).end(C(s,d,t,o,e,n))})},T=(e,t,n,r,o=q,u={},c=!1)=>a=>(s,d)=>{let l=i()(n);return S(a)||(l=l.query(a)),e&&"function"==typeof e&&s(e(u)),new Promise((e,n)=>{null==r&&(r={});let u=p.delete(l);c&&(u=u.withCredentials()),u.send(r).end(C(s,d,t,o,e,n))})},x=(e,t,n,r,o=q,u={},c=!1)=>(a={})=>(s,d)=>{let l=i()(n);return S(a)||(l=l.query(a)),e&&"function"==typeof e&&s(e(u)),new Promise((e,n)=>{let u=p.post(l);c&&(u=u.withCredentials()),null!=r?u.send(r):u.set("Content-Type","text/plain"),u.end(C(s,d,t,o,e,n))})},$=(e,t,n,r,o={},u=q,c={})=>(a={})=>(s,d)=>{let l=i()(n);return S(a)||(l=l.query(a)),e&&"function"==typeof e&&s(e(c)),new Promise((e,n)=>{const i=p.post(l).attach("file",r);S(o)||Object.keys(o).forEach((function(e){let t=o[e];i.field(e,t)})),i.end(C(s,d,t,u,e,n))})},I=(e,t,n,r=null,o={},u=q,c={})=>(a={})=>(s,d)=>{let l=i()(n);return S(a)||(l=l.query(a)),e&&"function"==typeof e&&s(e(c)),new Promise((e,n)=>{const i=p.put(l);null!=r&&i.attach("file",r),S(o)||Object.keys(o).forEach((function(e){let t=o[e];i.field(e,t)})),i.end(C(s,d,t,u,e,n))})},q=(e,t)=>e=>{let n=t.body,r="";n instanceof Object&&n.hasOwnProperty("message")&&(r=n.message),a.a.fire(t.statusText,r,"error")},C=(e,t,n,r,o,u)=>(i,c)=>{if(i||!c.ok)return r&&r(i,c)(e,t),u({err:i,res:c,dispatch:e,state:t});let a=c.body;return"function"==typeof n?(e(n({response:a})),o({response:a})):(e(n),o({response:a}))},A=e=>{let t=e.status,n=e.statusText;switch(t){case 403:a.a.fire("ERROR",d.a.translate("errors.user_not_authz"),"warning");break;case 401:a.a.fire("ERROR",d.a.translate("errors.session_expired"),"error");break;case 412:a.a.fire("ERROR",n,"warning");case 500:a.a.fire("ERROR",d.a.translate("errors.server_error"),"error")}},P=e=>{if(e.ok)return e.json();throw e},L=(e,t={})=>n=>{n(v()),a.a.fire(e).then(e=>{e.value&&"function"==typeof t&&t()})},D=e=>t=>{t(v()),a.a.fire({title:d.a.translate("general.done"),html:e,type:"success"})},z=(e,t,n)=>{let r=document.createElement("a");r.textContent="download",r.download=e,r.href=`data:${n},${encodeURIComponent(t)}`,document.body.appendChild(r),r.click(),document.body.removeChild(r)},M=(e,t,n,r=null)=>o=>{let u=i()(e);return S(t)||(u=u.query(t)),o(j()),fetch(u.toString()).then(e=>{if(e.ok)return e.text();throw e}).then(e=>{o(v()),r&&(e=r+"\r\r"+e),z(n,e,"text/csv;charset=utf-8")}).catch(A)},N=(e,t,n=null)=>{let r=i()(e);return S(t)||(r=r.query(t)),fetch(r.toString()).then(e=>{if(e.ok)return e.text();throw e}).then(e=>(n&&(e=n+"\r\r"+e),e)).catch(A)},G=e=>e=(e=e.replace(/,/g,"\\,")).replace(/;/g,"\\;")},,function(e,t){e.exports=require("i18n-react/dist/i18n-react")},function(e,t){e.exports=require("urijs")},function(e,t,n){"use strict";n.d(t,"g",(function(){return h})),n.d(t,"b",(function(){return m})),n.d(t,"d",(function(){return b})),n.d(t,"c",(function(){return g})),n.d(t,"a",(function(){return w})),n.d(t,"h",(function(){return y})),n.d(t,"f",(function(){return O})),n.d(t,"e",(function(){return _})),n.d(t,"i",(function(){return j})),n.d(t,"m",(function(){return v})),n.d(t,"n",(function(){return k})),n.d(t,"j",(function(){return R})),n.d(t,"k",(function(){return E})),n.d(t,"r",(function(){return U})),n.d(t,"p",(function(){return T})),n.d(t,"l",(function(){return x})),n.d(t,"o",(function(){return $})),n.d(t,"t",(function(){return I})),n.d(t,"s",(function(){return q})),n.d(t,"q",(function(){return C}));var r=n(4),o=n.n(r),u=n(2),i=n(1),c=n(5),a=n.n(c),s=n(12),d=n.n(s);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){p(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const h="SET_LOGGED_USER",m="LOGOUT_USER",b="REQUEST_USER_INFO",g="RECEIVE_USER_INFO",w="CLEAR_SESSION_STATE",y="UPDATE_SESSION_STATE_STATUS",O="unchanged",_="changed",j="UPDATE_USER_INFO",v=(e=null,t=null,n=null,r=null)=>{let o=Object(i.r)(),u=Object(i.s)(),c=Object(i.t)(),s=Object(i.j)();null!=e&&(s+="?BackUrl="+encodeURI(e));let d=S(16);console.log("created nonce "+d),Object(i.z)("nonce",d);let l=a()(u+"/oauth2/auth"),f={response_type:encodeURI("token id_token"),scope:encodeURI(c),nonce:d,client_id:encodeURI(o),redirect_uri:encodeURI(s)};return t&&(f.prompt=t),r&&(f.provider=r),n&&(f.id_token_hint=n),l=l.query(f),console.log("getAuthUrl "+l.toString()),l},k=e=>{let t=Object(i.s)(),n=Object(i.r)(),r=a()(t+"/oauth2/end-session"),o=S(16),u=Object(i.u)()+"/auth/logout";return Object(i.z)("post_logout_state",o),r.query({id_token_hint:e,post_logout_redirect_uri:encodeURI(u),client_id:encodeURI(n),state:o})},S=e=>{let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n="";for(let r=0;r<e;r++)n+=t.charAt(Math.floor(Math.random()*t.length));return n},R=(e=null,t=null,n="consent")=>{let r=v(e,n,null,t);Object(i.m)().replace(r.toString())},E=(e=null)=>{R(e,null,null)},U=(e,t,n)=>r=>{r({type:h,payload:{accessToken:e,idToken:t,sessionState:n}})},T=()=>{Object(i.m)().replace(k(Object(i.q)()).toString())},x=e=>(t,n)=>{t({type:m,payload:{backUrl:e}})},$=(e="groups",t="",n=null,r=null,c=null)=>(a,s)=>{let d=Object(i.i)();d=""!==d?d.split(" "):[];let{loggedUserState:l}=s(),{accessToken:f,member:p}=l;if(null!=p)return null!=r&&null!=n&&r.push(n),Promise.resolve();null==c&&(c=u.g),a(Object(u.z)());let h={access_token:f,expand:e};return t&&(h.fields=t),Object(u.q)(Object(u.h)(b),Object(u.h)(g),Object(i.b)("/api/v1/members/me"),c)(h)(a,s).then(()=>{a(Object(u.A)());let{member:e}=s().loggedUserState;if(null==e){let e={title:"ERROR",html:o.a.translate("errors.user_not_set"),type:"error"};a(Object(u.x)(e,T))}if(d.length>0){if(0===e.groups.filter((e,t)=>d.includes(e.code)).length){let e={title:"ERROR",html:o.a.translate("errors.user_not_authz"),type:"error"};return void a(Object(u.x)(e,T))}}null!=r&&null!=n&&r.push(n)})},I=e=>(t,n)=>{let{loggedUserState:r}=n(),{member:o}=r;if(null==o)throw Error("Member is not set.");if(e.id!=o.id)throw Error("Member is not the same.");t({type:j,payload:f({},e)})},q=e=>(t,n)=>{t({type:y,payload:{sessionStateStatus:e}})},C=()=>(e,t)=>{let{loggedUserState:n}=t(),{accessToken:r,idToken:o,isLoggedUser:u}=n;if(!r)throw Error("Access Token not set.");if(!o)throw Error("Id Token not set.");if(!u)throw Error("User is not logged.");let c=Object(i.s)(),a=Object(i.r)();return new d.a({issuer:c,audience:a}).decode(o).payload.exp-(Math.floor(Date.now()/1e3)+500)>0}},function(e,t){e.exports=require("sweetalert2")},function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"j",(function(){return a})),n.d(t,"n",(function(){return s})),n.d(t,"l",(function(){return d})),n.d(t,"o",(function(){return l})),n.d(t,"r",(function(){return f})),n.d(t,"q",(function(){return p})),n.d(t,"h",(function(){return h})),n.d(t,"i",(function(){return m})),n.d(t,"g",(function(){return b})),n.d(t,"m",(function(){return g})),n.d(t,"f",(function(){return w})),n.d(t,"k",(function(){return y})),n.d(t,"e",(function(){return O})),n.d(t,"d",(function(){return _})),n.d(t,"b",(function(){return v})),n.d(t,"c",(function(){return k})),n.d(t,"p",(function(){return S}));var r=n(2),o=n(1),u=n(9),i=n.n(u);const c="RECEIVE_COUNTRIES",a=i.a.debounce((e,t)=>{let n=Object(o.h)();e=Object(r.l)(e);let u=encodeURIComponent(`full_name=@${e},first_name=@${e},last_name=@${e},email=@${e}`);fetch(Object(o.b)(`/api/v1/members?filter=${u}&expand=tickets,rsvp,schedule_summit_events,all_affiliations&access_token=${n}`)).then(r.n).then(e=>{let n=[...e.data];t(n)}).catch(r.m)},500),s=i.a.debounce((e,t)=>{let n=Object(o.h)();e=Object(r.l)(e);let u=encodeURIComponent("name=@"+e);fetch(Object(o.b)(`/api/v1/summits/all?filter=${u}&access_token=${n}`)).then(r.n).then(e=>{let n=[...e.data];t(n)}).catch(r.m)},500),d=i.a.debounce((e,t,n)=>{let u=Object(o.h)();t=Object(r.l)(t);let i="/api/v1";e&&(i+="/summits/"+e),i+=`/speakers?filter=${encodeURIComponent(`full_name=@${t},first_name=@${t},last_name=@${t},email=@${t}`)}&access_token=${u}&expand=member,registration_request`,fetch(Object(o.b)(i)).then(r.n).then(e=>{let t=[...e.data];n(t)}).catch(r.m)},500),l=i.a.debounce((e,t,n)=>{let u=Object(o.h)();t=Object(r.l)(t);let i="/api/v1",c=encodeURIComponent("tag=@"+t);i+=e?`/summits/${e}/track-tag-groups/all/allowed-tags?filter=${c}&expand=tag,track_tag_group`:"/tags?filter="+c,i+="&order=tag&page=1&per_page=50&access_token="+u,fetch(Object(o.b)(i)).then(r.n).then(t=>{let r=[...t.data];e&&(r=r.map(e=>e.tag)),n(r)}).catch(r.m)},500),f=i.a.debounce((e,t,n)=>{let u=Object(o.h)();t=Object(r.l)(t);let i=encodeURIComponent("name=@"+t);fetch(Object(o.b)(`/api/v1/summits/${e}/tracks?filter=${i}&order=name&access_token=${u}`)).then(r.n).then(e=>{let t=[...e.data];n(t)}).catch(r.m)},500),p=i.a.debounce((e,t,n)=>{let u=Object(o.h)(),i=(t=Object(r.l)(t))?encodeURIComponent("filter=name=@"+t):"";fetch(Object(o.b)(`/api/v1/summits/${e}/track-groups?order=name&access_token=${u}&${i}`)).then(r.n).then(e=>{let t=[...e.data];n(t)}).catch(r.m)},500),h=i.a.debounce((e,t,n=!1,u)=>{let i=Object(o.h)();t=Object(r.l)(t);let c=`/api/v1/summits/${e}/events`+(n?"/published":""),a=encodeURIComponent("title=@"+t);fetch(Object(o.b)(`${c}?filter=${a}&order=title&access_token=${i}`)).then(r.n).then(e=>{let t=[...e.data];u(t)}).catch(r.m)},500),m=i.a.debounce((e,t)=>{let n=Object(o.h)(),u=encodeURIComponent(`title=@${e},code=@${e}`);fetch(Object(o.b)(`/api/v1/groups?filter=${u}&access_token=${n}`)).then(r.n).then(e=>{let n=[...e.data];t(n)}).catch(r.m)},500),b=i.a.debounce((e,t)=>{let n=Object(o.h)();e=Object(r.l)(e);let u=encodeURIComponent("name=@"+e);fetch(Object(o.b)(`/api/v1/companies?filter=${u}&access_token=${n}`)).then(r.n).then(e=>{let n=[...e.data];t(n)}).catch(r.m)},500),g=i.a.debounce((e,t,n)=>{let u=Object(o.h)();t=Object(r.l)(t);let i=encodeURIComponent("company_name=@"+t);fetch(Object(o.b)(`/api/v1/summits/${e}/sponsors?filter=${i}&expand=company,sponsorship&access_token=${u}`)).then(r.n).then(e=>{let t=[...e.data];n(t)}).catch(r.m)},500),w=i.a.debounce((e,t,n)=>{let u=Object(o.h)();t=Object(r.l)(t);let i=encodeURIComponent("name=@"+t);fetch(Object(o.b)(`/api/v1/summits/${e}/access-level-types?filter=${i}&&access_token=${u}`)).then(r.n).then(e=>{let t=[...e.data];n(t)}).catch(r.m)},500),y=i.a.debounce((e,t)=>{let n=Object(o.h)();e=Object(r.l)(e);let u=encodeURIComponent("name=@"+e);fetch(Object(o.b)(`/api/v1/organizations?filter=${u}&access_token=${n}`)).then(r.n).then(e=>{let n=[...e.data];t(n)}).catch(r.m)},500),O=(e,t)=>{let n=Object(o.h)();return fetch(Object(o.b)("/api/public/v1/languages?access_token="+n),{signal:t}).then(r.n).then(t=>{e(t.data)}).catch(r.m)},_=(e,t)=>{let n=Object(o.h)();return fetch(Object(o.b)("/api/public/v1/countries?access_token="+n),{signal:t}).then(r.n).then(t=>{e(t.data)}).catch(r.m)};var j;const v=e=>(j||(j=new google.maps.Geocoder),new Promise((function(t,n){j.geocode({address:e},(function(e,r){r==google.maps.GeocoderStatus.OK?t(e):n(r)}))}))),k=(e,t)=>{j||(j=new google.maps.Geocoder);var n={lat:parseFloat(e),lng:parseFloat(t)};return new Promise((function(e,t){j.geocode({location:n},(function(n,r){r==google.maps.GeocoderStatus.OK?e(n):t(r)}))}))},S=i.a.debounce((e,t,n)=>{let u=Object(o.h)();t=Object(r.l)(t);let i=encodeURIComponent("name=@"+t);fetch(Object(o.b)(`/api/v1/summits/${e}/ticket-types?filter=${i}&&access_token=${u}`)).then(r.n).then(e=>{let t=[...e.data];n(t)}).catch(r.m)},500)},function(e,t){e.exports=require("lodash")},function(e,t){e.exports=require("moment-timezone")},,function(e,t){e.exports=require("idtoken-verifier")},function(e,t){e.exports=require("superagent")},,,,function(e){e.exports=JSON.parse('{"errors":{"user_not_authz":"Hold on. Your user is not authorized!.","session_expired":"Hold on. Your session expired!.","server_error":"There was a problem with our server, please contact admin."},"general":{"select_summit":"Select a Summit...","add":"Add","clear":"Clear","remove":"Remove","drop_files":"Drop images or click to select files to upload.","search":"Search","save":"Save","done":"Done!","drag_and_drop":"Drag and Drop to sort items.","other":"Other","type_something":"Type something and press tab or enter.","are_you_sure":"Are you sure?","yes_delete":"Yes, delete.","remove_warning":"Are you sure you want to delete this?"}}')},,,,,function(e,t,n){var r={"./en.json":17,"./es.json":23,"./zh.json":24};function o(e){var t=u(e);return n(t)}function u(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}o.keys=function(){return Object.keys(r)},o.resolve=u,e.exports=o,o.id=22},function(e){e.exports=JSON.parse('{"errors":{"user_not_authz":"Hold on. Your user is not authorized!.","session_expired":"Hold on. Your session expired!.","server_error":"There was a problem with our server, please contact admin."},"general":{"select_summit":"Select a Summit...","add":"Add","clear":"Clear","remove":"Remove","drop_files":"Drop images or click to select files to upload.","search":"Search","save":"Save","done":"Done!","drag_and_drop":"Drag and Drop to sort items.","other":"Other","type_something":"Type something and press tab or enter.","are_you_sure":"Are you sure?","yes_delete":"Yes, delete.","remove_warning":"Are you sure you want to delete this?"}}')},function(e){e.exports=JSON.parse('{"errors":{"user_not_authz":"坚持,稍等。您的用户未经授权!","session_expired":"坚持,稍等。你的会话已经过期了!","server_error":"我们的服务器出现问题,请联系管理员。"},"general":{"select_summit":"选择峰会...","add":"加","clear":"明确","remove":"去掉","drop_files":"删除图像或单击以选择要上载的文件。","search":"搜索","save":"保存","done":"完成!","drag_and_drop":"拖放以对项目进行排序。","other":"其他","type_something":"输入内容并按Tab键或输入。","are_you_sure":"你确定吗?","yes_delete":"是的,删除。","remove_warning":"你确定要删除这个吗?"}}')},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.r(t);n(0);var r=n(4),o=n.n(r),u=n(2);n.d(t,"resetLoading",(function(){return u.v})),n.d(t,"startLoading",(function(){return u.z})),n.d(t,"stopLoading",(function(){return u.A})),n.d(t,"responseHandler",(function(){return u.w})),n.d(t,"fetchErrorHandler",(function(){return u.m})),n.d(t,"fetchResponseHandler",(function(){return u.n})),n.d(t,"showMessage",(function(){return u.x})),n.d(t,"showSuccessMessage",(function(){return u.y})),n.d(t,"getCSV",(function(){return u.o})),n.d(t,"getRawCSV",(function(){return u.p})),n.d(t,"downloadFileByContent",(function(){return u.k})),n.d(t,"getRequest",(function(){return u.q})),n.d(t,"putRequest",(function(){return u.u})),n.d(t,"deleteRequest",(function(){return u.j})),n.d(t,"postRequest",(function(){return u.s})),n.d(t,"postFile",(function(){return u.r})),n.d(t,"putFile",(function(){return u.t})),n.d(t,"defaultErrorHandler",(function(){return u.i})),n.d(t,"createAction",(function(){return u.h})),n.d(t,"authErrorHandler",(function(){return u.g})),n.d(t,"escapeFilterValue",(function(){return u.l}));var i=n(8);n.d(t,"queryMembers",(function(){return i.j})),n.d(t,"querySpeakers",(function(){return i.l})),n.d(t,"queryTags",(function(){return i.o})),n.d(t,"queryTracks",(function(){return i.r})),n.d(t,"queryTrackGroups",(function(){return i.q})),n.d(t,"queryEvents",(function(){return i.h})),n.d(t,"queryGroups",(function(){return i.i})),n.d(t,"queryCompanies",(function(){return i.g})),n.d(t,"querySponsors",(function(){return i.m})),n.d(t,"getLanguageList",(function(){return i.e})),n.d(t,"queryOrganizations",(function(){return i.k})),n.d(t,"getCountryList",(function(){return i.d})),n.d(t,"geoCodeAddress",(function(){return i.b})),n.d(t,"geoCodeLatLng",(function(){return i.c}));var c=n(1);n.d(t,"findElementPos",(function(){return c.f})),n.d(t,"epochToMoment",(function(){return c.d})),n.d(t,"epochToMomentTimeZone",(function(){return c.e})),n.d(t,"formatEpoch",(function(){return c.g})),n.d(t,"objectToQueryString",(function(){return c.y})),n.d(t,"getBackURL",(function(){return c.k}));var a=n(6);n.d(t,"getAuthUrl",(function(){return a.m})),n.d(t,"getLogoutUrl",(function(){return a.n})),n.d(t,"doLogin",(function(){return a.j})),n.d(t,"doLoginBasicLogin",(function(){return a.k})),n.d(t,"onUserAuth",(function(){return a.r})),n.d(t,"initLogOut",(function(){return a.p})),n.d(t,"doLogout",(function(){return a.l})),n.d(t,"getUserInfo",(function(){return a.o})),n.d(t,"updateUserInfo",(function(){return a.t})),n.d(t,"isIdTokenAlive",(function(){return a.q}));let s=Object(c.o)();s.length>2&&(s=s.split("-")[0],s=s.split("_")[0]);try{o.a.setTexts(n(22)(`./${s}.json`))}catch(e){o.a.setTexts(n(17))}}])}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],t):"object"==typeof exports?exports["openstack-uicore-foundation"]=t():e["openstack-uicore-foundation"]=t()}(this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=57)}([function(e,t){e.exports=require("react")},function(e,t,n){"use strict";n.d(t,"f",(function(){return c})),n.d(t,"d",(function(){return a})),n.d(t,"e",(function(){return s})),n.d(t,"g",(function(){return d})),n.d(t,"y",(function(){return l})),n.d(t,"k",(function(){return f})),n.d(t,"h",(function(){return p})),n.d(t,"q",(function(){return h})),n.d(t,"r",(function(){return m})),n.d(t,"s",(function(){return b})),n.d(t,"t",(function(){return g})),n.d(t,"j",(function(){return w})),n.d(t,"m",(function(){return y})),n.d(t,"u",(function(){return O})),n.d(t,"n",(function(){return _})),n.d(t,"l",(function(){return j})),n.d(t,"i",(function(){return v})),n.d(t,"b",(function(){return k})),n.d(t,"D",(function(){return S})),n.d(t,"c",(function(){return R})),n.d(t,"z",(function(){return E})),n.d(t,"p",(function(){return U})),n.d(t,"w",(function(){return T})),n.d(t,"B",(function(){return x})),n.d(t,"o",(function(){return $})),n.d(t,"A",(function(){return I})),n.d(t,"v",(function(){return q})),n.d(t,"C",(function(){return C})),n.d(t,"a",(function(){return A})),n.d(t,"x",(function(){return P}));var r=n(10),o=n.n(r),u=n(5),i=n.n(u);const c=e=>{var t=-70;if(e.offsetParent){do{t+=e.offsetTop}while(e=e.offsetParent);return[t]}},a=e=>e?(e*=1e3,o()(e)):e,s=(e,t)=>e?(e*=1e3,o()(e).tz(t)):e,d=(e,t="M/D/YYYY h:mm a")=>e?a(e).format(t):e,l=e=>{var t="";for(var n in e)""!=t&&(t+="&"),t+=n+"="+encodeURIComponent(e[n]);return t},f=()=>{let e=i()(window.location.href),t=e.search(!0),n=e.fragment(),r=t.hasOwnProperty("BackUrl")?t.BackUrl:null;return null!=n&&""!=n&&(r+="#"+n),r},p=()=>"undefined"!=typeof window?window.accessToken:null,h=()=>"undefined"!=typeof window?window.idToken:null,m=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,b=()=>"undefined"!=typeof window?window.IDP_BASE_URL:null,g=()=>"undefined"!=typeof window?window.SCOPES:null,w=()=>"undefined"!=typeof window?window.location.origin+"/auth/callback":null,y=()=>{let e="";return"undefined"!=typeof window&&(e=window.location,window.top&&(e=window.top.location)),e},O=()=>"undefined"!=typeof window?window.location.origin:null,_=()=>"undefined"!=typeof window?window.location.pathname:null,j=()=>"undefined"!=typeof window?window.location.href:null,v=()=>"undefined"!=typeof window?window.ALLOWED_USER_GROUPS||"":null,k=e=>"undefined"!=typeof window?`${window.API_BASE_URL}${e}`:null``,S=(e,t,n)=>{if("undefined"!=typeof window)return window.accessToken=e,window.idToken=t,void(window.sessionState=n)},R=()=>{if("undefined"!=typeof window)return window.accessToken=null,window.idToken=null,void(window.sessionState=null)},E=(e,t)=>{"undefined"!=typeof window&&window.localStorage.setItem(e,t)},U=(e,t)=>{if("undefined"!=typeof window){let n=window.localStorage.getItem(e);return t&&window.localStorage.removeItem(e),n}return null},T=()=>"undefined"!=typeof window&&window.clearing_session_state,x=e=>{"undefined"!=typeof window&&(window.clearing_session_state=e)},$=()=>{let e="en";return"undefined"!=typeof navigator&&(e=navigator.languages&&navigator.languages[0]||navigator.language||navigator.userLanguage),e},I=e=>{if(Object.keys(e).length>0){const t=Object.keys(e)[0],n=document.getElementById(t);n&&window.scrollTo(0,c(n))}},q=(e,t)=>e in t?t[e]:"",C=(e,t)=>{const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(e[r]!==t[r])return!1;return!0},A=(e,t)=>e.length===t.length&&e.every((e,n)=>C(e,t[n])),P=e=>0===Object.keys(e).length},function(e,t,n){"use strict";n.d(t,"b",(function(){return h})),n.d(t,"d",(function(){return m})),n.d(t,"e",(function(){return b})),n.d(t,"f",(function(){return g})),n.d(t,"a",(function(){return w})),n.d(t,"c",(function(){return y})),n.d(t,"h",(function(){return O})),n.d(t,"v",(function(){return _})),n.d(t,"z",(function(){return j})),n.d(t,"A",(function(){return v})),n.d(t,"g",(function(){return R})),n.d(t,"q",(function(){return E})),n.d(t,"u",(function(){return U})),n.d(t,"j",(function(){return T})),n.d(t,"s",(function(){return x})),n.d(t,"r",(function(){return $})),n.d(t,"t",(function(){return I})),n.d(t,"i",(function(){return q})),n.d(t,"w",(function(){return C})),n.d(t,"m",(function(){return A})),n.d(t,"n",(function(){return P})),n.d(t,"x",(function(){return L})),n.d(t,"y",(function(){return D})),n.d(t,"k",(function(){return z})),n.d(t,"o",(function(){return M})),n.d(t,"p",(function(){return N})),n.d(t,"l",(function(){return G}));var r=n(13),o=n.n(r),u=n(5),i=n.n(u),c=n(7),a=n.n(c),s=n(4),d=n.n(s),l=n(1),f=n(6);let p=o.a;const h="RESET_LOADING",m="START_LOADING",b="STOP_LOADING",g="VALIDATE",w="CLEAR_MESSAGE",y="SHOW_MESSAGE",O=e=>t=>({type:e,payload:t}),_=O(h),j=O(m),v=O(b),k={},S=e=>0===Object.keys(e).length&&e.constructor===Object,R=(e,t)=>(t,n)=>{let r=e.status,o="";switch(t(v()),r){case 403:let n={title:"ERROR",html:d.a.translate("errors.user_not_authz"),type:"error"};t(L(n,f.p));break;case 401:let r=Object(l.n)(),c=Object(l.w)();t({type:f.a,payload:{}}),c||(Object(l.B)(!0),console.log("authErrorHandler 401 - re login"),Object(f.j)(r));break;case 404:o="",o=e.response.body&&e.response.body.message?e.response.body.message:e.response.error&&e.response.error.message?e.response.error.message:e.message,a.a.fire("Not Found",o,"warning");break;case 412:for(var[u,i]of Object.entries(e.response.body.errors))isNaN(u)&&(o+=u+": "),o+=i+"<br>";a.a.fire("Validation error",o,"warning"),t({type:g,payload:{errors:e.response.body.errors}});break;default:a.a.fire("ERROR",d.a.translate("errors.server_error"),"error")}},E=(e,t,n,r=q,o={},u=60,c=60,a=!1)=>(s={})=>(d,l)=>{let f=i()(n);S(s)||(f=f.query(s));let h=f.toString();return e&&"function"==typeof e&&d(e(o)),(e=>{k[e]&&(k[e].abort(),console.log("aborted request "+e),delete k[e])})(h),new Promise((e,n)=>{let o=p.get(f.toString());a&&(o=o.withCredentials()),o.timeout({response:1e3*u,deadline:1e3*c}).end(C(d,l,t,r,e,n)),((e,t)=>{k[e]=t})(h,o)})},U=(e,t,n,r,o=q,u={},c=!1)=>(a={})=>(s,d)=>{let l=i()(n);return S(a)||(l=l.query(a)),e&&"function"==typeof e&&s(e(u)),new Promise((e,n)=>{null==r&&(r={});let u=p.put(l.toString());c&&(u=u.withCredentials()),u.send(r).end(C(s,d,t,o,e,n))})},T=(e,t,n,r,o=q,u={},c=!1)=>a=>(s,d)=>{let l=i()(n);return S(a)||(l=l.query(a)),e&&"function"==typeof e&&s(e(u)),new Promise((e,n)=>{null==r&&(r={});let u=p.delete(l);c&&(u=u.withCredentials()),u.send(r).end(C(s,d,t,o,e,n))})},x=(e,t,n,r,o=q,u={},c=!1)=>(a={})=>(s,d)=>{let l=i()(n);return S(a)||(l=l.query(a)),e&&"function"==typeof e&&s(e(u)),new Promise((e,n)=>{let u=p.post(l);c&&(u=u.withCredentials()),null!=r?u.send(r):u.set("Content-Type","text/plain"),u.end(C(s,d,t,o,e,n))})},$=(e,t,n,r,o={},u=q,c={})=>(a={})=>(s,d)=>{let l=i()(n);return S(a)||(l=l.query(a)),e&&"function"==typeof e&&s(e(c)),new Promise((e,n)=>{const i=p.post(l).attach("file",r);S(o)||Object.keys(o).forEach((function(e){let t=o[e];i.field(e,t)})),i.end(C(s,d,t,u,e,n))})},I=(e,t,n,r=null,o={},u=q,c={})=>(a={})=>(s,d)=>{let l=i()(n);return S(a)||(l=l.query(a)),e&&"function"==typeof e&&s(e(c)),new Promise((e,n)=>{const i=p.put(l);null!=r&&i.attach("file",r),S(o)||Object.keys(o).forEach((function(e){let t=o[e];i.field(e,t)})),i.end(C(s,d,t,u,e,n))})},q=(e,t)=>e=>{let n=t.body,r="";n instanceof Object&&n.hasOwnProperty("message")&&(r=n.message),a.a.fire(t.statusText,r,"error")},C=(e,t,n,r,o,u)=>(i,c)=>{if(i||!c.ok)return r&&r(i,c)(e,t),u({err:i,res:c,dispatch:e,state:t});let a=c.body;return"function"==typeof n?(e(n({response:a})),o({response:a})):(e(n),o({response:a}))},A=e=>{let t=e.status,n=e.statusText;switch(t){case 403:a.a.fire("ERROR",d.a.translate("errors.user_not_authz"),"warning");break;case 401:a.a.fire("ERROR",d.a.translate("errors.session_expired"),"error");break;case 412:a.a.fire("ERROR",n,"warning");case 500:a.a.fire("ERROR",d.a.translate("errors.server_error"),"error")}},P=e=>{if(e.ok)return e.json();throw e},L=(e,t={})=>n=>{n(v()),a.a.fire(e).then(e=>{e.value&&"function"==typeof t&&t()})},D=e=>t=>{t(v()),a.a.fire({title:d.a.translate("general.done"),html:e,type:"success"})},z=(e,t,n)=>{let r=document.createElement("a");r.textContent="download",r.download=e,r.href=`data:${n},${encodeURIComponent(t)}`,document.body.appendChild(r),r.click(),document.body.removeChild(r)},M=(e,t,n,r=null)=>o=>{let u=i()(e);return S(t)||(u=u.query(t)),o(j()),fetch(u.toString()).then(e=>{if(e.ok)return e.text();throw e}).then(e=>{o(v()),r&&(e=r+"\r\r"+e),z(n,e,"text/csv;charset=utf-8")}).catch(A)},N=(e,t,n=null)=>{let r=i()(e);return S(t)||(r=r.query(t)),fetch(r.toString()).then(e=>{if(e.ok)return e.text();throw e}).then(e=>(n&&(e=n+"\r\r"+e),e)).catch(A)},G=e=>e=(e=e.replace(/,/g,"\\,")).replace(/;/g,"\\;")},,function(e,t){e.exports=require("i18n-react/dist/i18n-react")},function(e,t){e.exports=require("urijs")},function(e,t,n){"use strict";n.d(t,"g",(function(){return h})),n.d(t,"b",(function(){return m})),n.d(t,"d",(function(){return b})),n.d(t,"c",(function(){return g})),n.d(t,"a",(function(){return w})),n.d(t,"h",(function(){return y})),n.d(t,"f",(function(){return O})),n.d(t,"e",(function(){return _})),n.d(t,"i",(function(){return j})),n.d(t,"m",(function(){return v})),n.d(t,"n",(function(){return k})),n.d(t,"j",(function(){return R})),n.d(t,"k",(function(){return E})),n.d(t,"r",(function(){return U})),n.d(t,"p",(function(){return T})),n.d(t,"l",(function(){return x})),n.d(t,"o",(function(){return $})),n.d(t,"t",(function(){return I})),n.d(t,"s",(function(){return q})),n.d(t,"q",(function(){return C}));var r=n(4),o=n.n(r),u=n(2),i=n(1),c=n(5),a=n.n(c),s=n(12),d=n.n(s);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){p(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const h="SET_LOGGED_USER",m="LOGOUT_USER",b="REQUEST_USER_INFO",g="RECEIVE_USER_INFO",w="CLEAR_SESSION_STATE",y="UPDATE_SESSION_STATE_STATUS",O="unchanged",_="changed",j="UPDATE_USER_INFO",v=(e=null,t=null,n=null,r=null)=>{let o=Object(i.r)(),u=Object(i.s)(),c=Object(i.t)(),s=Object(i.j)();null!=e&&(s+="?BackUrl="+encodeURI(e));let d=S(16);console.log("created nonce "+d),Object(i.z)("nonce",d);let l=a()(u+"/oauth2/auth"),f={response_type:encodeURI("token id_token"),scope:encodeURI(c),nonce:d,client_id:encodeURI(o),redirect_uri:encodeURI(s)};return t&&(f.prompt=t),r&&(f.provider=r),n&&(f.id_token_hint=n),l=l.query(f),console.log("getAuthUrl "+l.toString()),l},k=e=>{let t=Object(i.s)(),n=Object(i.r)(),r=a()(t+"/oauth2/end-session"),o=S(16),u=Object(i.u)()+"/auth/logout";return Object(i.z)("post_logout_state",o),r.query({id_token_hint:e,post_logout_redirect_uri:encodeURI(u),client_id:encodeURI(n),state:o})},S=e=>{let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n="";for(let r=0;r<e;r++)n+=t.charAt(Math.floor(Math.random()*t.length));return n},R=(e=null,t=null,n=null)=>{let r=v(e,n,null,t);Object(i.m)().replace(r.toString())},E=(e=null)=>{R(e,null,null,null)},U=(e,t,n)=>r=>{r({type:h,payload:{accessToken:e,idToken:t,sessionState:n}})},T=()=>{Object(i.m)().replace(k(Object(i.q)()).toString())},x=e=>(t,n)=>{t({type:m,payload:{backUrl:e}})},$=(e="groups",t="",n=null,r=null,c=null)=>(a,s)=>{let d=Object(i.i)();d=""!==d?d.split(" "):[];let{loggedUserState:l}=s(),{accessToken:f,member:p}=l;if(null!=p)return null!=r&&null!=n&&r.push(n),Promise.resolve();null==c&&(c=u.g),a(Object(u.z)());let h={access_token:f,expand:e};return t&&(h.fields=t),Object(u.q)(Object(u.h)(b),Object(u.h)(g),Object(i.b)("/api/v1/members/me"),c)(h)(a,s).then(()=>{a(Object(u.A)());let{member:e}=s().loggedUserState;if(null==e){let e={title:"ERROR",html:o.a.translate("errors.user_not_set"),type:"error"};a(Object(u.x)(e,T))}if(d.length>0){if(0===e.groups.filter((e,t)=>d.includes(e.code)).length){let e={title:"ERROR",html:o.a.translate("errors.user_not_authz"),type:"error"};return void a(Object(u.x)(e,T))}}null!=r&&null!=n&&r.push(n)})},I=e=>(t,n)=>{let{loggedUserState:r}=n(),{member:o}=r;if(null==o)throw Error("Member is not set.");if(e.id!=o.id)throw Error("Member is not the same.");t({type:j,payload:f({},e)})},q=e=>(t,n)=>{t({type:y,payload:{sessionStateStatus:e}})},C=()=>(e,t)=>{let{loggedUserState:n}=t(),{accessToken:r,idToken:o,isLoggedUser:u}=n;if(!r)throw Error("Access Token not set.");if(!o)throw Error("Id Token not set.");if(!u)throw Error("User is not logged.");let c=Object(i.s)(),a=Object(i.r)();return new d.a({issuer:c,audience:a}).decode(o).payload.exp-(Math.floor(Date.now()/1e3)+500)>0}},function(e,t){e.exports=require("sweetalert2")},function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"j",(function(){return a})),n.d(t,"n",(function(){return s})),n.d(t,"l",(function(){return d})),n.d(t,"o",(function(){return l})),n.d(t,"r",(function(){return f})),n.d(t,"q",(function(){return p})),n.d(t,"h",(function(){return h})),n.d(t,"i",(function(){return m})),n.d(t,"g",(function(){return b})),n.d(t,"m",(function(){return g})),n.d(t,"f",(function(){return w})),n.d(t,"k",(function(){return y})),n.d(t,"e",(function(){return O})),n.d(t,"d",(function(){return _})),n.d(t,"b",(function(){return v})),n.d(t,"c",(function(){return k})),n.d(t,"p",(function(){return S}));var r=n(2),o=n(1),u=n(9),i=n.n(u);const c="RECEIVE_COUNTRIES",a=i.a.debounce((e,t)=>{let n=Object(o.h)();e=Object(r.l)(e);let u=encodeURIComponent(`full_name=@${e},first_name=@${e},last_name=@${e},email=@${e}`);fetch(Object(o.b)(`/api/v1/members?filter=${u}&expand=tickets,rsvp,schedule_summit_events,all_affiliations&access_token=${n}`)).then(r.n).then(e=>{let n=[...e.data];t(n)}).catch(r.m)},500),s=i.a.debounce((e,t)=>{let n=Object(o.h)();e=Object(r.l)(e);let u=encodeURIComponent("name=@"+e);fetch(Object(o.b)(`/api/v1/summits/all?filter=${u}&access_token=${n}`)).then(r.n).then(e=>{let n=[...e.data];t(n)}).catch(r.m)},500),d=i.a.debounce((e,t,n)=>{let u=Object(o.h)();t=Object(r.l)(t);let i="/api/v1";e&&(i+="/summits/"+e),i+=`/speakers?filter=${encodeURIComponent(`full_name=@${t},first_name=@${t},last_name=@${t},email=@${t}`)}&access_token=${u}&expand=member,registration_request`,fetch(Object(o.b)(i)).then(r.n).then(e=>{let t=[...e.data];n(t)}).catch(r.m)},500),l=i.a.debounce((e,t,n)=>{let u=Object(o.h)();t=Object(r.l)(t);let i="/api/v1",c=encodeURIComponent("tag=@"+t);i+=e?`/summits/${e}/track-tag-groups/all/allowed-tags?filter=${c}&expand=tag,track_tag_group`:"/tags?filter="+c,i+="&order=tag&page=1&per_page=50&access_token="+u,fetch(Object(o.b)(i)).then(r.n).then(t=>{let r=[...t.data];e&&(r=r.map(e=>e.tag)),n(r)}).catch(r.m)},500),f=i.a.debounce((e,t,n)=>{let u=Object(o.h)();t=Object(r.l)(t);let i=encodeURIComponent("name=@"+t);fetch(Object(o.b)(`/api/v1/summits/${e}/tracks?filter=${i}&order=name&access_token=${u}`)).then(r.n).then(e=>{let t=[...e.data];n(t)}).catch(r.m)},500),p=i.a.debounce((e,t,n)=>{let u=Object(o.h)(),i=(t=Object(r.l)(t))?encodeURIComponent("filter=name=@"+t):"";fetch(Object(o.b)(`/api/v1/summits/${e}/track-groups?order=name&access_token=${u}&${i}`)).then(r.n).then(e=>{let t=[...e.data];n(t)}).catch(r.m)},500),h=i.a.debounce((e,t,n=!1,u)=>{let i=Object(o.h)();t=Object(r.l)(t);let c=`/api/v1/summits/${e}/events`+(n?"/published":""),a=encodeURIComponent("title=@"+t);fetch(Object(o.b)(`${c}?filter=${a}&order=title&access_token=${i}`)).then(r.n).then(e=>{let t=[...e.data];u(t)}).catch(r.m)},500),m=i.a.debounce((e,t)=>{let n=Object(o.h)(),u=encodeURIComponent(`title=@${e},code=@${e}`);fetch(Object(o.b)(`/api/v1/groups?filter=${u}&access_token=${n}`)).then(r.n).then(e=>{let n=[...e.data];t(n)}).catch(r.m)},500),b=i.a.debounce((e,t)=>{let n=Object(o.h)();e=Object(r.l)(e);let u=encodeURIComponent("name=@"+e);fetch(Object(o.b)(`/api/v1/companies?filter=${u}&access_token=${n}`)).then(r.n).then(e=>{let n=[...e.data];t(n)}).catch(r.m)},500),g=i.a.debounce((e,t,n)=>{let u=Object(o.h)();t=Object(r.l)(t);let i=encodeURIComponent("company_name=@"+t);fetch(Object(o.b)(`/api/v1/summits/${e}/sponsors?filter=${i}&expand=company,sponsorship&access_token=${u}`)).then(r.n).then(e=>{let t=[...e.data];n(t)}).catch(r.m)},500),w=i.a.debounce((e,t,n)=>{let u=Object(o.h)();t=Object(r.l)(t);let i=encodeURIComponent("name=@"+t);fetch(Object(o.b)(`/api/v1/summits/${e}/access-level-types?filter=${i}&&access_token=${u}`)).then(r.n).then(e=>{let t=[...e.data];n(t)}).catch(r.m)},500),y=i.a.debounce((e,t)=>{let n=Object(o.h)();e=Object(r.l)(e);let u=encodeURIComponent("name=@"+e);fetch(Object(o.b)(`/api/v1/organizations?filter=${u}&access_token=${n}`)).then(r.n).then(e=>{let n=[...e.data];t(n)}).catch(r.m)},500),O=(e,t)=>{let n=Object(o.h)();return fetch(Object(o.b)("/api/public/v1/languages?access_token="+n),{signal:t}).then(r.n).then(t=>{e(t.data)}).catch(r.m)},_=(e,t)=>{let n=Object(o.h)();return fetch(Object(o.b)("/api/public/v1/countries?access_token="+n),{signal:t}).then(r.n).then(t=>{e(t.data)}).catch(r.m)};var j;const v=e=>(j||(j=new google.maps.Geocoder),new Promise((function(t,n){j.geocode({address:e},(function(e,r){r==google.maps.GeocoderStatus.OK?t(e):n(r)}))}))),k=(e,t)=>{j||(j=new google.maps.Geocoder);var n={lat:parseFloat(e),lng:parseFloat(t)};return new Promise((function(e,t){j.geocode({location:n},(function(n,r){r==google.maps.GeocoderStatus.OK?e(n):t(r)}))}))},S=i.a.debounce((e,t,n)=>{let u=Object(o.h)();t=Object(r.l)(t);let i=encodeURIComponent("name=@"+t);fetch(Object(o.b)(`/api/v1/summits/${e}/ticket-types?filter=${i}&&access_token=${u}`)).then(r.n).then(e=>{let t=[...e.data];n(t)}).catch(r.m)},500)},function(e,t){e.exports=require("lodash")},function(e,t){e.exports=require("moment-timezone")},,function(e,t){e.exports=require("idtoken-verifier")},function(e,t){e.exports=require("superagent")},,,,function(e){e.exports=JSON.parse('{"errors":{"user_not_authz":"Hold on. Your user is not authorized!.","session_expired":"Hold on. Your session expired!.","server_error":"There was a problem with our server, please contact admin."},"general":{"select_summit":"Select a Summit...","add":"Add","clear":"Clear","remove":"Remove","drop_files":"Drop images or click to select files to upload.","search":"Search","save":"Save","done":"Done!","drag_and_drop":"Drag and Drop to sort items.","other":"Other","type_something":"Type something and press tab or enter.","are_you_sure":"Are you sure?","yes_delete":"Yes, delete.","remove_warning":"Are you sure you want to delete this?"}}')},,,,,function(e,t,n){var r={"./en.json":17,"./es.json":23,"./zh.json":24};function o(e){var t=u(e);return n(t)}function u(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}o.keys=function(){return Object.keys(r)},o.resolve=u,e.exports=o,o.id=22},function(e){e.exports=JSON.parse('{"errors":{"user_not_authz":"Hold on. Your user is not authorized!.","session_expired":"Hold on. Your session expired!.","server_error":"There was a problem with our server, please contact admin."},"general":{"select_summit":"Select a Summit...","add":"Add","clear":"Clear","remove":"Remove","drop_files":"Drop images or click to select files to upload.","search":"Search","save":"Save","done":"Done!","drag_and_drop":"Drag and Drop to sort items.","other":"Other","type_something":"Type something and press tab or enter.","are_you_sure":"Are you sure?","yes_delete":"Yes, delete.","remove_warning":"Are you sure you want to delete this?"}}')},function(e){e.exports=JSON.parse('{"errors":{"user_not_authz":"坚持,稍等。您的用户未经授权!","session_expired":"坚持,稍等。你的会话已经过期了!","server_error":"我们的服务器出现问题,请联系管理员。"},"general":{"select_summit":"选择峰会...","add":"加","clear":"明确","remove":"去掉","drop_files":"删除图像或单击以选择要上载的文件。","search":"搜索","save":"保存","done":"完成!","drag_and_drop":"拖放以对项目进行排序。","other":"其他","type_something":"输入内容并按Tab键或输入。","are_you_sure":"你确定吗?","yes_delete":"是的,删除。","remove_warning":"你确定要删除这个吗?"}}')},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.r(t);n(0);var r=n(4),o=n.n(r),u=n(2);n.d(t,"resetLoading",(function(){return u.v})),n.d(t,"startLoading",(function(){return u.z})),n.d(t,"stopLoading",(function(){return u.A})),n.d(t,"responseHandler",(function(){return u.w})),n.d(t,"fetchErrorHandler",(function(){return u.m})),n.d(t,"fetchResponseHandler",(function(){return u.n})),n.d(t,"showMessage",(function(){return u.x})),n.d(t,"showSuccessMessage",(function(){return u.y})),n.d(t,"getCSV",(function(){return u.o})),n.d(t,"getRawCSV",(function(){return u.p})),n.d(t,"downloadFileByContent",(function(){return u.k})),n.d(t,"getRequest",(function(){return u.q})),n.d(t,"putRequest",(function(){return u.u})),n.d(t,"deleteRequest",(function(){return u.j})),n.d(t,"postRequest",(function(){return u.s})),n.d(t,"postFile",(function(){return u.r})),n.d(t,"putFile",(function(){return u.t})),n.d(t,"defaultErrorHandler",(function(){return u.i})),n.d(t,"createAction",(function(){return u.h})),n.d(t,"authErrorHandler",(function(){return u.g})),n.d(t,"escapeFilterValue",(function(){return u.l}));var i=n(8);n.d(t,"queryMembers",(function(){return i.j})),n.d(t,"querySpeakers",(function(){return i.l})),n.d(t,"queryTags",(function(){return i.o})),n.d(t,"queryTracks",(function(){return i.r})),n.d(t,"queryTrackGroups",(function(){return i.q})),n.d(t,"queryEvents",(function(){return i.h})),n.d(t,"queryGroups",(function(){return i.i})),n.d(t,"queryCompanies",(function(){return i.g})),n.d(t,"querySponsors",(function(){return i.m})),n.d(t,"getLanguageList",(function(){return i.e})),n.d(t,"queryOrganizations",(function(){return i.k})),n.d(t,"getCountryList",(function(){return i.d})),n.d(t,"geoCodeAddress",(function(){return i.b})),n.d(t,"geoCodeLatLng",(function(){return i.c}));var c=n(1);n.d(t,"findElementPos",(function(){return c.f})),n.d(t,"epochToMoment",(function(){return c.d})),n.d(t,"epochToMomentTimeZone",(function(){return c.e})),n.d(t,"formatEpoch",(function(){return c.g})),n.d(t,"objectToQueryString",(function(){return c.y})),n.d(t,"getBackURL",(function(){return c.k}));var a=n(6);n.d(t,"getAuthUrl",(function(){return a.m})),n.d(t,"getLogoutUrl",(function(){return a.n})),n.d(t,"doLogin",(function(){return a.j})),n.d(t,"doLoginBasicLogin",(function(){return a.k})),n.d(t,"onUserAuth",(function(){return a.r})),n.d(t,"initLogOut",(function(){return a.p})),n.d(t,"doLogout",(function(){return a.l})),n.d(t,"getUserInfo",(function(){return a.o})),n.d(t,"updateUserInfo",(function(){return a.t})),n.d(t,"isIdTokenAlive",(function(){return a.q}));let s=Object(c.o)();s.length>2&&(s=s.split("-")[0],s=s.split("_")[0]);try{o.a.setTexts(n(22)(`./${s}.json`))}catch(e){o.a.setTexts(n(17))}}])}));
|
package/lib/reducers.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],t):"object"==typeof exports?exports["openstack-uicore-foundation"]=t():e["openstack-uicore-foundation"]=t()}(this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=60)}({0:function(e,t){e.exports=require("react")},1:function(e,t,n){"use strict";n.d(t,"f",(function(){return c})),n.d(t,"d",(function(){return s})),n.d(t,"e",(function(){return l})),n.d(t,"g",(function(){return a})),n.d(t,"y",(function(){return d})),n.d(t,"k",(function(){return f})),n.d(t,"h",(function(){return p})),n.d(t,"q",(function(){return b})),n.d(t,"r",(function(){return w})),n.d(t,"s",(function(){return y})),n.d(t,"t",(function(){return g})),n.d(t,"j",(function(){return O})),n.d(t,"m",(function(){return h})),n.d(t,"u",(function(){return m})),n.d(t,"n",(function(){return j})),n.d(t,"l",(function(){return S})),n.d(t,"i",(function(){return _})),n.d(t,"b",(function(){return k})),n.d(t,"D",(function(){return E})),n.d(t,"c",(function(){return v})),n.d(t,"z",(function(){return P})),n.d(t,"p",(function(){return R})),n.d(t,"w",(function(){return T})),n.d(t,"B",(function(){return U})),n.d(t,"o",(function(){return x})),n.d(t,"A",(function(){return I})),n.d(t,"v",(function(){return A})),n.d(t,"C",(function(){return D})),n.d(t,"a",(function(){return q})),n.d(t,"x",(function(){return L}));var r=n(10),o=n.n(r),u=n(5),i=n.n(u);const c=e=>{var t=-70;if(e.offsetParent){do{t+=e.offsetTop}while(e=e.offsetParent);return[t]}},s=e=>e?(e*=1e3,o()(e)):e,l=(e,t)=>e?(e*=1e3,o()(e).tz(t)):e,a=(e,t="M/D/YYYY h:mm a")=>e?s(e).format(t):e,d=e=>{var t="";for(var n in e)""!=t&&(t+="&"),t+=n+"="+encodeURIComponent(e[n]);return t},f=()=>{let e=i()(window.location.href),t=e.search(!0),n=e.fragment(),r=t.hasOwnProperty("BackUrl")?t.BackUrl:null;return null!=n&&""!=n&&(r+="#"+n),r},p=()=>"undefined"!=typeof window?window.accessToken:null,b=()=>"undefined"!=typeof window?window.idToken:null,w=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,y=()=>"undefined"!=typeof window?window.IDP_BASE_URL:null,g=()=>"undefined"!=typeof window?window.SCOPES:null,O=()=>"undefined"!=typeof window?window.location.origin+"/auth/callback":null,h=()=>{let e="";return"undefined"!=typeof window&&(e=window.location,window.top&&(e=window.top.location)),e},m=()=>"undefined"!=typeof window?window.location.origin:null,j=()=>"undefined"!=typeof window?window.location.pathname:null,S=()=>"undefined"!=typeof window?window.location.href:null,_=()=>"undefined"!=typeof window?window.ALLOWED_USER_GROUPS||"":null,k=e=>"undefined"!=typeof window?`${window.API_BASE_URL}${e}`:null``,E=(e,t,n)=>{if("undefined"!=typeof window)return window.accessToken=e,window.idToken=t,void(window.sessionState=n)},v=()=>{if("undefined"!=typeof window)return window.accessToken=null,window.idToken=null,void(window.sessionState=null)},P=(e,t)=>{"undefined"!=typeof window&&window.localStorage.setItem(e,t)},R=(e,t)=>{if("undefined"!=typeof window){let n=window.localStorage.getItem(e);return t&&window.localStorage.removeItem(e),n}return null},T=()=>"undefined"!=typeof window&&window.clearing_session_state,U=e=>{"undefined"!=typeof window&&(window.clearing_session_state=e)},x=()=>{let e="en";return"undefined"!=typeof navigator&&(e=navigator.languages&&navigator.languages[0]||navigator.language||navigator.userLanguage),e},I=e=>{if(Object.keys(e).length>0){const t=Object.keys(e)[0],n=document.getElementById(t);n&&window.scrollTo(0,c(n))}},A=(e,t)=>e in t?t[e]:"",D=(e,t)=>{const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(e[r]!==t[r])return!1;return!0},q=(e,t)=>e.length===t.length&&e.every((e,n)=>D(e,t[n])),L=e=>0===Object.keys(e).length},10:function(e,t){e.exports=require("moment-timezone")},12:function(e,t){e.exports=require("idtoken-verifier")},13:function(e,t){e.exports=require("superagent")},2:function(e,t,n){"use strict";n.d(t,"b",(function(){return b})),n.d(t,"d",(function(){return w})),n.d(t,"e",(function(){return y})),n.d(t,"f",(function(){return g})),n.d(t,"a",(function(){return O})),n.d(t,"c",(function(){return h})),n.d(t,"h",(function(){return m})),n.d(t,"v",(function(){return j})),n.d(t,"z",(function(){return S})),n.d(t,"A",(function(){return _})),n.d(t,"g",(function(){return v})),n.d(t,"q",(function(){return P})),n.d(t,"u",(function(){return R})),n.d(t,"j",(function(){return T})),n.d(t,"s",(function(){return U})),n.d(t,"r",(function(){return x})),n.d(t,"t",(function(){return I})),n.d(t,"i",(function(){return A})),n.d(t,"w",(function(){return D})),n.d(t,"m",(function(){return q})),n.d(t,"n",(function(){return L})),n.d(t,"x",(function(){return C})),n.d(t,"y",(function(){return M})),n.d(t,"k",(function(){return N})),n.d(t,"o",(function(){return z})),n.d(t,"p",(function(){return G})),n.d(t,"l",(function(){return B}));var r=n(13),o=n.n(r),u=n(5),i=n.n(u),c=n(7),s=n.n(c),l=n(4),a=n.n(l),d=n(1),f=n(6);let p=o.a;const b="RESET_LOADING",w="START_LOADING",y="STOP_LOADING",g="VALIDATE",O="CLEAR_MESSAGE",h="SHOW_MESSAGE",m=e=>t=>({type:e,payload:t}),j=m(b),S=m(w),_=m(y),k={},E=e=>0===Object.keys(e).length&&e.constructor===Object,v=(e,t)=>(t,n)=>{let r=e.status,o="";switch(t(_()),r){case 403:let n={title:"ERROR",html:a.a.translate("errors.user_not_authz"),type:"error"};t(C(n,f.p));break;case 401:let r=Object(d.n)(),c=Object(d.w)();t({type:f.a,payload:{}}),c||(Object(d.B)(!0),console.log("authErrorHandler 401 - re login"),Object(f.j)(r));break;case 404:o="",o=e.response.body&&e.response.body.message?e.response.body.message:e.response.error&&e.response.error.message?e.response.error.message:e.message,s.a.fire("Not Found",o,"warning");break;case 412:for(var[u,i]of Object.entries(e.response.body.errors))isNaN(u)&&(o+=u+": "),o+=i+"<br>";s.a.fire("Validation error",o,"warning"),t({type:g,payload:{errors:e.response.body.errors}});break;default:s.a.fire("ERROR",a.a.translate("errors.server_error"),"error")}},P=(e,t,n,r=A,o={},u=60,c=60,s=!1)=>(l={})=>(a,d)=>{let f=i()(n);E(l)||(f=f.query(l));let b=f.toString();return e&&"function"==typeof e&&a(e(o)),(e=>{k[e]&&(k[e].abort(),console.log("aborted request "+e),delete k[e])})(b),new Promise((e,n)=>{let o=p.get(f.toString());s&&(o=o.withCredentials()),o.timeout({response:1e3*u,deadline:1e3*c}).end(D(a,d,t,r,e,n)),((e,t)=>{k[e]=t})(b,o)})},R=(e,t,n,r,o=A,u={},c=!1)=>(s={})=>(l,a)=>{let d=i()(n);return E(s)||(d=d.query(s)),e&&"function"==typeof e&&l(e(u)),new Promise((e,n)=>{null==r&&(r={});let u=p.put(d.toString());c&&(u=u.withCredentials()),u.send(r).end(D(l,a,t,o,e,n))})},T=(e,t,n,r,o=A,u={},c=!1)=>s=>(l,a)=>{let d=i()(n);return E(s)||(d=d.query(s)),e&&"function"==typeof e&&l(e(u)),new Promise((e,n)=>{null==r&&(r={});let u=p.delete(d);c&&(u=u.withCredentials()),u.send(r).end(D(l,a,t,o,e,n))})},U=(e,t,n,r,o=A,u={},c=!1)=>(s={})=>(l,a)=>{let d=i()(n);return E(s)||(d=d.query(s)),e&&"function"==typeof e&&l(e(u)),new Promise((e,n)=>{let u=p.post(d);c&&(u=u.withCredentials()),null!=r?u.send(r):u.set("Content-Type","text/plain"),u.end(D(l,a,t,o,e,n))})},x=(e,t,n,r,o={},u=A,c={})=>(s={})=>(l,a)=>{let d=i()(n);return E(s)||(d=d.query(s)),e&&"function"==typeof e&&l(e(c)),new Promise((e,n)=>{const i=p.post(d).attach("file",r);E(o)||Object.keys(o).forEach((function(e){let t=o[e];i.field(e,t)})),i.end(D(l,a,t,u,e,n))})},I=(e,t,n,r=null,o={},u=A,c={})=>(s={})=>(l,a)=>{let d=i()(n);return E(s)||(d=d.query(s)),e&&"function"==typeof e&&l(e(c)),new Promise((e,n)=>{const i=p.put(d);null!=r&&i.attach("file",r),E(o)||Object.keys(o).forEach((function(e){let t=o[e];i.field(e,t)})),i.end(D(l,a,t,u,e,n))})},A=(e,t)=>e=>{let n=t.body,r="";n instanceof Object&&n.hasOwnProperty("message")&&(r=n.message),s.a.fire(t.statusText,r,"error")},D=(e,t,n,r,o,u)=>(i,c)=>{if(i||!c.ok)return r&&r(i,c)(e,t),u({err:i,res:c,dispatch:e,state:t});let s=c.body;return"function"==typeof n?(e(n({response:s})),o({response:s})):(e(n),o({response:s}))},q=e=>{let t=e.status,n=e.statusText;switch(t){case 403:s.a.fire("ERROR",a.a.translate("errors.user_not_authz"),"warning");break;case 401:s.a.fire("ERROR",a.a.translate("errors.session_expired"),"error");break;case 412:s.a.fire("ERROR",n,"warning");case 500:s.a.fire("ERROR",a.a.translate("errors.server_error"),"error")}},L=e=>{if(e.ok)return e.json();throw e},C=(e,t={})=>n=>{n(_()),s.a.fire(e).then(e=>{e.value&&"function"==typeof t&&t()})},M=e=>t=>{t(_()),s.a.fire({title:a.a.translate("general.done"),html:e,type:"success"})},N=(e,t,n)=>{let r=document.createElement("a");r.textContent="download",r.download=e,r.href=`data:${n},${encodeURIComponent(t)}`,document.body.appendChild(r),r.click(),document.body.removeChild(r)},z=(e,t,n,r=null)=>o=>{let u=i()(e);return E(t)||(u=u.query(t)),o(S()),fetch(u.toString()).then(e=>{if(e.ok)return e.text();throw e}).then(e=>{o(_()),r&&(e=r+"\r\r"+e),N(n,e,"text/csv;charset=utf-8")}).catch(q)},G=(e,t,n=null)=>{let r=i()(e);return E(t)||(r=r.query(t)),fetch(r.toString()).then(e=>{if(e.ok)return e.text();throw e}).then(e=>(n&&(e=n+"\r\r"+e),e)).catch(q)},B=e=>e=(e=e.replace(/,/g,"\\,")).replace(/;/g,"\\;")},4:function(e,t){e.exports=require("i18n-react/dist/i18n-react")},5:function(e,t){e.exports=require("urijs")},6:function(e,t,n){"use strict";n.d(t,"g",(function(){return b})),n.d(t,"b",(function(){return w})),n.d(t,"d",(function(){return y})),n.d(t,"c",(function(){return g})),n.d(t,"a",(function(){return O})),n.d(t,"h",(function(){return h})),n.d(t,"f",(function(){return m})),n.d(t,"e",(function(){return j})),n.d(t,"i",(function(){return S})),n.d(t,"m",(function(){return _})),n.d(t,"n",(function(){return k})),n.d(t,"j",(function(){return v})),n.d(t,"k",(function(){return P})),n.d(t,"r",(function(){return R})),n.d(t,"p",(function(){return T})),n.d(t,"l",(function(){return U})),n.d(t,"o",(function(){return x})),n.d(t,"t",(function(){return I})),n.d(t,"s",(function(){return A})),n.d(t,"q",(function(){return D}));var r=n(4),o=n.n(r),u=n(2),i=n(1),c=n(5),s=n.n(c),l=n(12),a=n.n(l);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){p(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const b="SET_LOGGED_USER",w="LOGOUT_USER",y="REQUEST_USER_INFO",g="RECEIVE_USER_INFO",O="CLEAR_SESSION_STATE",h="UPDATE_SESSION_STATE_STATUS",m="unchanged",j="changed",S="UPDATE_USER_INFO",_=(e=null,t=null,n=null,r=null)=>{let o=Object(i.r)(),u=Object(i.s)(),c=Object(i.t)(),l=Object(i.j)();null!=e&&(l+="?BackUrl="+encodeURI(e));let a=E(16);console.log("created nonce "+a),Object(i.z)("nonce",a);let d=s()(u+"/oauth2/auth"),f={response_type:encodeURI("token id_token"),scope:encodeURI(c),nonce:a,client_id:encodeURI(o),redirect_uri:encodeURI(l)};return t&&(f.prompt=t),r&&(f.provider=r),n&&(f.id_token_hint=n),d=d.query(f),console.log("getAuthUrl "+d.toString()),d},k=e=>{let t=Object(i.s)(),n=Object(i.r)(),r=s()(t+"/oauth2/end-session"),o=E(16),u=Object(i.u)()+"/auth/logout";return Object(i.z)("post_logout_state",o),r.query({id_token_hint:e,post_logout_redirect_uri:encodeURI(u),client_id:encodeURI(n),state:o})},E=e=>{let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n="";for(let r=0;r<e;r++)n+=t.charAt(Math.floor(Math.random()*t.length));return n},v=(e=null,t=null,n="consent")=>{let r=_(e,n,null,t);Object(i.m)().replace(r.toString())},P=(e=null)=>{v(e,null,null)},R=(e,t,n)=>r=>{r({type:b,payload:{accessToken:e,idToken:t,sessionState:n}})},T=()=>{Object(i.m)().replace(k(Object(i.q)()).toString())},U=e=>(t,n)=>{t({type:w,payload:{backUrl:e}})},x=(e="groups",t="",n=null,r=null,c=null)=>(s,l)=>{let a=Object(i.i)();a=""!==a?a.split(" "):[];let{loggedUserState:d}=l(),{accessToken:f,member:p}=d;if(null!=p)return null!=r&&null!=n&&r.push(n),Promise.resolve();null==c&&(c=u.g),s(Object(u.z)());let b={access_token:f,expand:e};return t&&(b.fields=t),Object(u.q)(Object(u.h)(y),Object(u.h)(g),Object(i.b)("/api/v1/members/me"),c)(b)(s,l).then(()=>{s(Object(u.A)());let{member:e}=l().loggedUserState;if(null==e){let e={title:"ERROR",html:o.a.translate("errors.user_not_set"),type:"error"};s(Object(u.x)(e,T))}if(a.length>0){if(0===e.groups.filter((e,t)=>a.includes(e.code)).length){let e={title:"ERROR",html:o.a.translate("errors.user_not_authz"),type:"error"};return void s(Object(u.x)(e,T))}}null!=r&&null!=n&&r.push(n)})},I=e=>(t,n)=>{let{loggedUserState:r}=n(),{member:o}=r;if(null==o)throw Error("Member is not set.");if(e.id!=o.id)throw Error("Member is not the same.");t({type:S,payload:f({},e)})},A=e=>(t,n)=>{t({type:h,payload:{sessionStateStatus:e}})},D=()=>(e,t)=>{let{loggedUserState:n}=t(),{accessToken:r,idToken:o,isLoggedUser:u}=n;if(!r)throw Error("Access Token not set.");if(!o)throw Error("Id Token not set.");if(!u)throw Error("User is not logged.");let c=Object(i.s)(),s=Object(i.r)();return new a.a({issuer:c,audience:s}).decode(o).payload.exp-(Math.floor(Date.now()/1e3)+500)>0}},60:function(e,t,n){"use strict";n.r(t),n.d(t,"genericReducers",(function(){return s})),n.d(t,"loggedUserReducer",(function(){return g}));n(0);var r=n(2);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const c={msg:null,msg_type:null,params:{},loading:!1},s=function(e=c,t={}){switch(t.type){case r.c:return u(u({},e),{},{msg:t.payload.msg,msg_type:t.payload.msg_type});case r.a:return u(u({},e),{},{msg:null});case r.e:return u(u({},e),{},{loading:!1});default:return e}};var l=n(6),a=n(12),d=n.n(a),f=n(1);function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function b(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){w(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function w(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const y={isLoggedUser:!1,accessToken:null,member:null,idToken:null,sessionState:null,backUrl:null,sessionStateStatus:l.f},g=(e=y,t)=>{const{type:n,payload:r}=t;let o=Object(f.s)(),u=Object(f.r)();switch(n){case l.g:{let{accessToken:n,idToken:r,sessionState:o}=t.payload;return Object(f.D)(n,r,o),b(b({},e),{},{isLoggedUser:!0,accessToken:n,idToken:r,sessionState:o,backUrl:null,sessionStateStatus:l.f})}case l.h:{let{sessionStateStatus:n}=t.payload;return b(b({},e),{},{sessionStateStatus:n})}case l.a:return Object(f.c)(),b(b({},e),{},{isLoggedUser:!1,accessToken:null,idToken:null,sessionState:null,backUrl:null});case l.b:return Object(f.c)(),b(b({},y),{},{backUrl:r.backUrl});case l.c:{let{response:n}=t.payload;if(""!=o&&""!=u){let t=new d.a({issuer:o,audience:u}).decode(e.idToken),r=t.payload.groups||[],i=t.payload.address||{};r=r.map(e=>({id:e.id,title:e.name,description:e.name,code:e.slug,created:e.created_at,last_edited:e.updated_at})),n=b(b({},n),{},{groups:[...n.groups,...r],address:i})}return b(b({},e),{},{member:n})}case l.i:{let n=t.payload;return b(b({},e),{},{member:n})}default:return e}}},7:function(e,t){e.exports=require("sweetalert2")}})}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],t):"object"==typeof exports?exports["openstack-uicore-foundation"]=t():e["openstack-uicore-foundation"]=t()}(this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=60)}({0:function(e,t){e.exports=require("react")},1:function(e,t,n){"use strict";n.d(t,"f",(function(){return c})),n.d(t,"d",(function(){return l})),n.d(t,"e",(function(){return s})),n.d(t,"g",(function(){return a})),n.d(t,"y",(function(){return d})),n.d(t,"k",(function(){return f})),n.d(t,"h",(function(){return p})),n.d(t,"q",(function(){return b})),n.d(t,"r",(function(){return w})),n.d(t,"s",(function(){return y})),n.d(t,"t",(function(){return g})),n.d(t,"j",(function(){return O})),n.d(t,"m",(function(){return h})),n.d(t,"u",(function(){return m})),n.d(t,"n",(function(){return j})),n.d(t,"l",(function(){return S})),n.d(t,"i",(function(){return _})),n.d(t,"b",(function(){return k})),n.d(t,"D",(function(){return E})),n.d(t,"c",(function(){return v})),n.d(t,"z",(function(){return P})),n.d(t,"p",(function(){return R})),n.d(t,"w",(function(){return T})),n.d(t,"B",(function(){return U})),n.d(t,"o",(function(){return x})),n.d(t,"A",(function(){return I})),n.d(t,"v",(function(){return A})),n.d(t,"C",(function(){return D})),n.d(t,"a",(function(){return q})),n.d(t,"x",(function(){return L}));var r=n(10),o=n.n(r),u=n(5),i=n.n(u);const c=e=>{var t=-70;if(e.offsetParent){do{t+=e.offsetTop}while(e=e.offsetParent);return[t]}},l=e=>e?(e*=1e3,o()(e)):e,s=(e,t)=>e?(e*=1e3,o()(e).tz(t)):e,a=(e,t="M/D/YYYY h:mm a")=>e?l(e).format(t):e,d=e=>{var t="";for(var n in e)""!=t&&(t+="&"),t+=n+"="+encodeURIComponent(e[n]);return t},f=()=>{let e=i()(window.location.href),t=e.search(!0),n=e.fragment(),r=t.hasOwnProperty("BackUrl")?t.BackUrl:null;return null!=n&&""!=n&&(r+="#"+n),r},p=()=>"undefined"!=typeof window?window.accessToken:null,b=()=>"undefined"!=typeof window?window.idToken:null,w=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,y=()=>"undefined"!=typeof window?window.IDP_BASE_URL:null,g=()=>"undefined"!=typeof window?window.SCOPES:null,O=()=>"undefined"!=typeof window?window.location.origin+"/auth/callback":null,h=()=>{let e="";return"undefined"!=typeof window&&(e=window.location,window.top&&(e=window.top.location)),e},m=()=>"undefined"!=typeof window?window.location.origin:null,j=()=>"undefined"!=typeof window?window.location.pathname:null,S=()=>"undefined"!=typeof window?window.location.href:null,_=()=>"undefined"!=typeof window?window.ALLOWED_USER_GROUPS||"":null,k=e=>"undefined"!=typeof window?`${window.API_BASE_URL}${e}`:null``,E=(e,t,n)=>{if("undefined"!=typeof window)return window.accessToken=e,window.idToken=t,void(window.sessionState=n)},v=()=>{if("undefined"!=typeof window)return window.accessToken=null,window.idToken=null,void(window.sessionState=null)},P=(e,t)=>{"undefined"!=typeof window&&window.localStorage.setItem(e,t)},R=(e,t)=>{if("undefined"!=typeof window){let n=window.localStorage.getItem(e);return t&&window.localStorage.removeItem(e),n}return null},T=()=>"undefined"!=typeof window&&window.clearing_session_state,U=e=>{"undefined"!=typeof window&&(window.clearing_session_state=e)},x=()=>{let e="en";return"undefined"!=typeof navigator&&(e=navigator.languages&&navigator.languages[0]||navigator.language||navigator.userLanguage),e},I=e=>{if(Object.keys(e).length>0){const t=Object.keys(e)[0],n=document.getElementById(t);n&&window.scrollTo(0,c(n))}},A=(e,t)=>e in t?t[e]:"",D=(e,t)=>{const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(e[r]!==t[r])return!1;return!0},q=(e,t)=>e.length===t.length&&e.every((e,n)=>D(e,t[n])),L=e=>0===Object.keys(e).length},10:function(e,t){e.exports=require("moment-timezone")},12:function(e,t){e.exports=require("idtoken-verifier")},13:function(e,t){e.exports=require("superagent")},2:function(e,t,n){"use strict";n.d(t,"b",(function(){return b})),n.d(t,"d",(function(){return w})),n.d(t,"e",(function(){return y})),n.d(t,"f",(function(){return g})),n.d(t,"a",(function(){return O})),n.d(t,"c",(function(){return h})),n.d(t,"h",(function(){return m})),n.d(t,"v",(function(){return j})),n.d(t,"z",(function(){return S})),n.d(t,"A",(function(){return _})),n.d(t,"g",(function(){return v})),n.d(t,"q",(function(){return P})),n.d(t,"u",(function(){return R})),n.d(t,"j",(function(){return T})),n.d(t,"s",(function(){return U})),n.d(t,"r",(function(){return x})),n.d(t,"t",(function(){return I})),n.d(t,"i",(function(){return A})),n.d(t,"w",(function(){return D})),n.d(t,"m",(function(){return q})),n.d(t,"n",(function(){return L})),n.d(t,"x",(function(){return C})),n.d(t,"y",(function(){return M})),n.d(t,"k",(function(){return N})),n.d(t,"o",(function(){return z})),n.d(t,"p",(function(){return G})),n.d(t,"l",(function(){return B}));var r=n(13),o=n.n(r),u=n(5),i=n.n(u),c=n(7),l=n.n(c),s=n(4),a=n.n(s),d=n(1),f=n(6);let p=o.a;const b="RESET_LOADING",w="START_LOADING",y="STOP_LOADING",g="VALIDATE",O="CLEAR_MESSAGE",h="SHOW_MESSAGE",m=e=>t=>({type:e,payload:t}),j=m(b),S=m(w),_=m(y),k={},E=e=>0===Object.keys(e).length&&e.constructor===Object,v=(e,t)=>(t,n)=>{let r=e.status,o="";switch(t(_()),r){case 403:let n={title:"ERROR",html:a.a.translate("errors.user_not_authz"),type:"error"};t(C(n,f.p));break;case 401:let r=Object(d.n)(),c=Object(d.w)();t({type:f.a,payload:{}}),c||(Object(d.B)(!0),console.log("authErrorHandler 401 - re login"),Object(f.j)(r));break;case 404:o="",o=e.response.body&&e.response.body.message?e.response.body.message:e.response.error&&e.response.error.message?e.response.error.message:e.message,l.a.fire("Not Found",o,"warning");break;case 412:for(var[u,i]of Object.entries(e.response.body.errors))isNaN(u)&&(o+=u+": "),o+=i+"<br>";l.a.fire("Validation error",o,"warning"),t({type:g,payload:{errors:e.response.body.errors}});break;default:l.a.fire("ERROR",a.a.translate("errors.server_error"),"error")}},P=(e,t,n,r=A,o={},u=60,c=60,l=!1)=>(s={})=>(a,d)=>{let f=i()(n);E(s)||(f=f.query(s));let b=f.toString();return e&&"function"==typeof e&&a(e(o)),(e=>{k[e]&&(k[e].abort(),console.log("aborted request "+e),delete k[e])})(b),new Promise((e,n)=>{let o=p.get(f.toString());l&&(o=o.withCredentials()),o.timeout({response:1e3*u,deadline:1e3*c}).end(D(a,d,t,r,e,n)),((e,t)=>{k[e]=t})(b,o)})},R=(e,t,n,r,o=A,u={},c=!1)=>(l={})=>(s,a)=>{let d=i()(n);return E(l)||(d=d.query(l)),e&&"function"==typeof e&&s(e(u)),new Promise((e,n)=>{null==r&&(r={});let u=p.put(d.toString());c&&(u=u.withCredentials()),u.send(r).end(D(s,a,t,o,e,n))})},T=(e,t,n,r,o=A,u={},c=!1)=>l=>(s,a)=>{let d=i()(n);return E(l)||(d=d.query(l)),e&&"function"==typeof e&&s(e(u)),new Promise((e,n)=>{null==r&&(r={});let u=p.delete(d);c&&(u=u.withCredentials()),u.send(r).end(D(s,a,t,o,e,n))})},U=(e,t,n,r,o=A,u={},c=!1)=>(l={})=>(s,a)=>{let d=i()(n);return E(l)||(d=d.query(l)),e&&"function"==typeof e&&s(e(u)),new Promise((e,n)=>{let u=p.post(d);c&&(u=u.withCredentials()),null!=r?u.send(r):u.set("Content-Type","text/plain"),u.end(D(s,a,t,o,e,n))})},x=(e,t,n,r,o={},u=A,c={})=>(l={})=>(s,a)=>{let d=i()(n);return E(l)||(d=d.query(l)),e&&"function"==typeof e&&s(e(c)),new Promise((e,n)=>{const i=p.post(d).attach("file",r);E(o)||Object.keys(o).forEach((function(e){let t=o[e];i.field(e,t)})),i.end(D(s,a,t,u,e,n))})},I=(e,t,n,r=null,o={},u=A,c={})=>(l={})=>(s,a)=>{let d=i()(n);return E(l)||(d=d.query(l)),e&&"function"==typeof e&&s(e(c)),new Promise((e,n)=>{const i=p.put(d);null!=r&&i.attach("file",r),E(o)||Object.keys(o).forEach((function(e){let t=o[e];i.field(e,t)})),i.end(D(s,a,t,u,e,n))})},A=(e,t)=>e=>{let n=t.body,r="";n instanceof Object&&n.hasOwnProperty("message")&&(r=n.message),l.a.fire(t.statusText,r,"error")},D=(e,t,n,r,o,u)=>(i,c)=>{if(i||!c.ok)return r&&r(i,c)(e,t),u({err:i,res:c,dispatch:e,state:t});let l=c.body;return"function"==typeof n?(e(n({response:l})),o({response:l})):(e(n),o({response:l}))},q=e=>{let t=e.status,n=e.statusText;switch(t){case 403:l.a.fire("ERROR",a.a.translate("errors.user_not_authz"),"warning");break;case 401:l.a.fire("ERROR",a.a.translate("errors.session_expired"),"error");break;case 412:l.a.fire("ERROR",n,"warning");case 500:l.a.fire("ERROR",a.a.translate("errors.server_error"),"error")}},L=e=>{if(e.ok)return e.json();throw e},C=(e,t={})=>n=>{n(_()),l.a.fire(e).then(e=>{e.value&&"function"==typeof t&&t()})},M=e=>t=>{t(_()),l.a.fire({title:a.a.translate("general.done"),html:e,type:"success"})},N=(e,t,n)=>{let r=document.createElement("a");r.textContent="download",r.download=e,r.href=`data:${n},${encodeURIComponent(t)}`,document.body.appendChild(r),r.click(),document.body.removeChild(r)},z=(e,t,n,r=null)=>o=>{let u=i()(e);return E(t)||(u=u.query(t)),o(S()),fetch(u.toString()).then(e=>{if(e.ok)return e.text();throw e}).then(e=>{o(_()),r&&(e=r+"\r\r"+e),N(n,e,"text/csv;charset=utf-8")}).catch(q)},G=(e,t,n=null)=>{let r=i()(e);return E(t)||(r=r.query(t)),fetch(r.toString()).then(e=>{if(e.ok)return e.text();throw e}).then(e=>(n&&(e=n+"\r\r"+e),e)).catch(q)},B=e=>e=(e=e.replace(/,/g,"\\,")).replace(/;/g,"\\;")},4:function(e,t){e.exports=require("i18n-react/dist/i18n-react")},5:function(e,t){e.exports=require("urijs")},6:function(e,t,n){"use strict";n.d(t,"g",(function(){return b})),n.d(t,"b",(function(){return w})),n.d(t,"d",(function(){return y})),n.d(t,"c",(function(){return g})),n.d(t,"a",(function(){return O})),n.d(t,"h",(function(){return h})),n.d(t,"f",(function(){return m})),n.d(t,"e",(function(){return j})),n.d(t,"i",(function(){return S})),n.d(t,"m",(function(){return _})),n.d(t,"n",(function(){return k})),n.d(t,"j",(function(){return v})),n.d(t,"k",(function(){return P})),n.d(t,"r",(function(){return R})),n.d(t,"p",(function(){return T})),n.d(t,"l",(function(){return U})),n.d(t,"o",(function(){return x})),n.d(t,"t",(function(){return I})),n.d(t,"s",(function(){return A})),n.d(t,"q",(function(){return D}));var r=n(4),o=n.n(r),u=n(2),i=n(1),c=n(5),l=n.n(c),s=n(12),a=n.n(s);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){p(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const b="SET_LOGGED_USER",w="LOGOUT_USER",y="REQUEST_USER_INFO",g="RECEIVE_USER_INFO",O="CLEAR_SESSION_STATE",h="UPDATE_SESSION_STATE_STATUS",m="unchanged",j="changed",S="UPDATE_USER_INFO",_=(e=null,t=null,n=null,r=null)=>{let o=Object(i.r)(),u=Object(i.s)(),c=Object(i.t)(),s=Object(i.j)();null!=e&&(s+="?BackUrl="+encodeURI(e));let a=E(16);console.log("created nonce "+a),Object(i.z)("nonce",a);let d=l()(u+"/oauth2/auth"),f={response_type:encodeURI("token id_token"),scope:encodeURI(c),nonce:a,client_id:encodeURI(o),redirect_uri:encodeURI(s)};return t&&(f.prompt=t),r&&(f.provider=r),n&&(f.id_token_hint=n),d=d.query(f),console.log("getAuthUrl "+d.toString()),d},k=e=>{let t=Object(i.s)(),n=Object(i.r)(),r=l()(t+"/oauth2/end-session"),o=E(16),u=Object(i.u)()+"/auth/logout";return Object(i.z)("post_logout_state",o),r.query({id_token_hint:e,post_logout_redirect_uri:encodeURI(u),client_id:encodeURI(n),state:o})},E=e=>{let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n="";for(let r=0;r<e;r++)n+=t.charAt(Math.floor(Math.random()*t.length));return n},v=(e=null,t=null,n=null)=>{let r=_(e,n,null,t);Object(i.m)().replace(r.toString())},P=(e=null)=>{v(e,null,null,null)},R=(e,t,n)=>r=>{r({type:b,payload:{accessToken:e,idToken:t,sessionState:n}})},T=()=>{Object(i.m)().replace(k(Object(i.q)()).toString())},U=e=>(t,n)=>{t({type:w,payload:{backUrl:e}})},x=(e="groups",t="",n=null,r=null,c=null)=>(l,s)=>{let a=Object(i.i)();a=""!==a?a.split(" "):[];let{loggedUserState:d}=s(),{accessToken:f,member:p}=d;if(null!=p)return null!=r&&null!=n&&r.push(n),Promise.resolve();null==c&&(c=u.g),l(Object(u.z)());let b={access_token:f,expand:e};return t&&(b.fields=t),Object(u.q)(Object(u.h)(y),Object(u.h)(g),Object(i.b)("/api/v1/members/me"),c)(b)(l,s).then(()=>{l(Object(u.A)());let{member:e}=s().loggedUserState;if(null==e){let e={title:"ERROR",html:o.a.translate("errors.user_not_set"),type:"error"};l(Object(u.x)(e,T))}if(a.length>0){if(0===e.groups.filter((e,t)=>a.includes(e.code)).length){let e={title:"ERROR",html:o.a.translate("errors.user_not_authz"),type:"error"};return void l(Object(u.x)(e,T))}}null!=r&&null!=n&&r.push(n)})},I=e=>(t,n)=>{let{loggedUserState:r}=n(),{member:o}=r;if(null==o)throw Error("Member is not set.");if(e.id!=o.id)throw Error("Member is not the same.");t({type:S,payload:f({},e)})},A=e=>(t,n)=>{t({type:h,payload:{sessionStateStatus:e}})},D=()=>(e,t)=>{let{loggedUserState:n}=t(),{accessToken:r,idToken:o,isLoggedUser:u}=n;if(!r)throw Error("Access Token not set.");if(!o)throw Error("Id Token not set.");if(!u)throw Error("User is not logged.");let c=Object(i.s)(),l=Object(i.r)();return new a.a({issuer:c,audience:l}).decode(o).payload.exp-(Math.floor(Date.now()/1e3)+500)>0}},60:function(e,t,n){"use strict";n.r(t),n.d(t,"genericReducers",(function(){return l})),n.d(t,"loggedUserReducer",(function(){return g}));n(0);var r=n(2);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const c={msg:null,msg_type:null,params:{},loading:!1},l=function(e=c,t={}){switch(t.type){case r.c:return u(u({},e),{},{msg:t.payload.msg,msg_type:t.payload.msg_type});case r.a:return u(u({},e),{},{msg:null});case r.e:return u(u({},e),{},{loading:!1});default:return e}};var s=n(6),a=n(12),d=n.n(a),f=n(1);function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function b(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){w(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function w(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const y={isLoggedUser:!1,accessToken:null,member:null,idToken:null,sessionState:null,backUrl:null,sessionStateStatus:s.f},g=(e=y,t)=>{const{type:n,payload:r}=t;let o=Object(f.s)(),u=Object(f.r)();switch(n){case s.g:{let{accessToken:n,idToken:r,sessionState:o}=t.payload;return Object(f.D)(n,r,o),b(b({},e),{},{isLoggedUser:!0,accessToken:n,idToken:r,sessionState:o,backUrl:null,sessionStateStatus:s.f})}case s.h:{let{sessionStateStatus:n}=t.payload;return b(b({},e),{},{sessionStateStatus:n})}case s.a:return Object(f.c)(),b(b({},e),{},{isLoggedUser:!1,accessToken:null,idToken:null,sessionState:null,backUrl:null});case s.b:return Object(f.c)(),b(b({},y),{},{backUrl:r.backUrl});case s.c:{let{response:n}=t.payload;if(""!=o&&""!=u){let t=new d.a({issuer:o,audience:u}).decode(e.idToken),r=t.payload.groups||[],i=t.payload.address||{};r=r.map(e=>({id:e.id,title:e.name,description:e.name,code:e.slug,created:e.created_at,last_edited:e.updated_at})),n=b(b({},n),{},{groups:[...n.groups,...r],address:i})}return b(b({},e),{},{member:n})}case s.i:{let n=t.payload;return b(b({},e),{},{member:n})}default:return e}}},7:function(e,t){e.exports=require("sweetalert2")}})}));
|