openstack-uicore-foundation 4.0.95 → 4.0.97

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.
Files changed (149) hide show
  1. package/lib/components/ajaxloader.js +1 -2
  2. package/lib/components/attendance-tracker.js +1 -2
  3. package/lib/components/bulk-actions-selector.js +1 -2
  4. package/lib/components/circle-button.js +1 -2
  5. package/lib/components/clock.js +1 -2
  6. package/lib/components/exclusive-wrapper.js +1 -2
  7. package/lib/components/extra-questions.js +1 -2
  8. package/lib/components/form-validation.js +1 -2
  9. package/lib/components/forms/rsvp-form.js +1 -2
  10. package/lib/components/forms/simple-form.js +1 -2
  11. package/lib/components/free-text-search.js +1 -2
  12. package/lib/components/google-map.js +1 -2
  13. package/lib/components/index.js +1 -2
  14. package/lib/components/inputs/access-levels-input.js +1 -2
  15. package/lib/components/inputs/action-dropdown.js +1 -2
  16. package/lib/components/inputs/checkbox-list.js +1 -2
  17. package/lib/components/inputs/company-input.js +1 -2
  18. package/lib/components/inputs/country-dropdown.js +1 -2
  19. package/lib/components/inputs/country-input.js +1 -2
  20. package/lib/components/inputs/datetimepicker.js +1 -2
  21. package/lib/components/inputs/dropdown.js +1 -2
  22. package/lib/components/inputs/editor-input.js +1 -2
  23. package/lib/components/inputs/event-input.js +1 -2
  24. package/lib/components/inputs/free-multi-text-input.js +1 -2
  25. package/lib/components/inputs/group-input.js +1 -2
  26. package/lib/components/inputs/grouped-dropdown.js +1 -2
  27. package/lib/components/inputs/language-input.js +1 -2
  28. package/lib/components/inputs/member-input.js +1 -2
  29. package/lib/components/inputs/operator-input.js +1 -2
  30. package/lib/components/inputs/organization-input.js +1 -2
  31. package/lib/components/inputs/promocode-input.js +1 -2
  32. package/lib/components/inputs/radio-list.js +1 -2
  33. package/lib/components/inputs/registration-company-input.js +1 -2
  34. package/lib/components/inputs/speaker-input.js +1 -2
  35. package/lib/components/inputs/sponsor-input.js +1 -2
  36. package/lib/components/inputs/stepped-select.js +1 -2
  37. package/lib/components/inputs/summit-days-select.js +1 -2
  38. package/lib/components/inputs/summit-input.js +1 -2
  39. package/lib/components/inputs/summit-venues-select.js +1 -2
  40. package/lib/components/inputs/tag-input.js +1 -2
  41. package/lib/components/inputs/text-input.js +1 -2
  42. package/lib/components/inputs/textarea-input.js +1 -2
  43. package/lib/components/inputs/ticket-types-input.js +1 -2
  44. package/lib/components/inputs/upload-input-v2.js +1 -2
  45. package/lib/components/inputs/upload-input.js +1 -2
  46. package/lib/components/progressive-img.js +1 -2
  47. package/lib/components/raw-html.js +1 -2
  48. package/lib/components/schedule-builder-constants.js +1 -2
  49. package/lib/components/schedule-builder-view.js +1 -2
  50. package/lib/components/sections/panel.js +1 -2
  51. package/lib/components/simple-link-list.js +1 -2
  52. package/lib/components/sponsored-project-input.js +1 -2
  53. package/lib/components/summit-dropdown.js +1 -2
  54. package/lib/components/table-editable.js +1 -2
  55. package/lib/components/table-selectable.js +1 -2
  56. package/lib/components/table-sortable.js +1 -2
  57. package/lib/components/table.js +1 -2
  58. package/lib/components/video-stream.js +1 -2
  59. package/lib/i18n.js +1 -2
  60. package/lib/models/index.js +1 -2
  61. package/lib/models/summit-event.js +1 -2
  62. package/lib/security/abstract-auth-callback-route.js +1 -2
  63. package/lib/security/actions.js +1 -2
  64. package/lib/security/constants.js +1 -2
  65. package/lib/security/methods.js +1 -2
  66. package/lib/security/reducers.js +1 -2
  67. package/lib/security/session-checker.js +1 -2
  68. package/lib/utils/actions.js +1 -2
  69. package/lib/utils/fragment-parser.js +1 -2
  70. package/lib/utils/methods.js +1 -2
  71. package/lib/utils/query-actions.js +1 -2
  72. package/lib/utils/questions-set.js +1 -2
  73. package/lib/utils/reducers.js +1 -2
  74. package/lib/utils/use-fit-text.js +1 -2
  75. package/package.json +1 -1
  76. package/lib/components/ajaxloader.js.map +0 -1
  77. package/lib/components/attendance-tracker.js.map +0 -1
  78. package/lib/components/bulk-actions-selector.js.map +0 -1
  79. package/lib/components/circle-button.js.map +0 -1
  80. package/lib/components/clock.js.map +0 -1
  81. package/lib/components/exclusive-wrapper.js.map +0 -1
  82. package/lib/components/extra-questions.js.map +0 -1
  83. package/lib/components/form-validation.js.map +0 -1
  84. package/lib/components/forms/rsvp-form.js.map +0 -1
  85. package/lib/components/forms/simple-form.js.map +0 -1
  86. package/lib/components/free-text-search.js.map +0 -1
  87. package/lib/components/google-map.js.map +0 -1
  88. package/lib/components/index.js.map +0 -1
  89. package/lib/components/inputs/access-levels-input.js.map +0 -1
  90. package/lib/components/inputs/action-dropdown.js.map +0 -1
  91. package/lib/components/inputs/checkbox-list.js.map +0 -1
  92. package/lib/components/inputs/company-input.js.map +0 -1
  93. package/lib/components/inputs/country-dropdown.js.map +0 -1
  94. package/lib/components/inputs/country-input.js.map +0 -1
  95. package/lib/components/inputs/datetimepicker.js.map +0 -1
  96. package/lib/components/inputs/dropdown.js.map +0 -1
  97. package/lib/components/inputs/editor-input.js.map +0 -1
  98. package/lib/components/inputs/event-input.js.map +0 -1
  99. package/lib/components/inputs/free-multi-text-input.js.map +0 -1
  100. package/lib/components/inputs/group-input.js.map +0 -1
  101. package/lib/components/inputs/grouped-dropdown.js.map +0 -1
  102. package/lib/components/inputs/language-input.js.map +0 -1
  103. package/lib/components/inputs/member-input.js.map +0 -1
  104. package/lib/components/inputs/operator-input.js.map +0 -1
  105. package/lib/components/inputs/organization-input.js.map +0 -1
  106. package/lib/components/inputs/promocode-input.js.map +0 -1
  107. package/lib/components/inputs/radio-list.js.map +0 -1
  108. package/lib/components/inputs/registration-company-input.js.map +0 -1
  109. package/lib/components/inputs/speaker-input.js.map +0 -1
  110. package/lib/components/inputs/sponsor-input.js.map +0 -1
  111. package/lib/components/inputs/stepped-select.js.map +0 -1
  112. package/lib/components/inputs/summit-days-select.js.map +0 -1
  113. package/lib/components/inputs/summit-input.js.map +0 -1
  114. package/lib/components/inputs/summit-venues-select.js.map +0 -1
  115. package/lib/components/inputs/tag-input.js.map +0 -1
  116. package/lib/components/inputs/text-input.js.map +0 -1
  117. package/lib/components/inputs/textarea-input.js.map +0 -1
  118. package/lib/components/inputs/ticket-types-input.js.map +0 -1
  119. package/lib/components/inputs/upload-input-v2.js.map +0 -1
  120. package/lib/components/inputs/upload-input.js.map +0 -1
  121. package/lib/components/progressive-img.js.map +0 -1
  122. package/lib/components/raw-html.js.map +0 -1
  123. package/lib/components/schedule-builder-constants.js.map +0 -1
  124. package/lib/components/schedule-builder-view.js.map +0 -1
  125. package/lib/components/sections/panel.js.map +0 -1
  126. package/lib/components/simple-link-list.js.map +0 -1
  127. package/lib/components/sponsored-project-input.js.map +0 -1
  128. package/lib/components/summit-dropdown.js.map +0 -1
  129. package/lib/components/table-editable.js.map +0 -1
  130. package/lib/components/table-selectable.js.map +0 -1
  131. package/lib/components/table-sortable.js.map +0 -1
  132. package/lib/components/table.js.map +0 -1
  133. package/lib/components/video-stream.js.map +0 -1
  134. package/lib/i18n.js.map +0 -1
  135. package/lib/models/index.js.map +0 -1
  136. package/lib/models/summit-event.js.map +0 -1
  137. package/lib/security/abstract-auth-callback-route.js.map +0 -1
  138. package/lib/security/actions.js.map +0 -1
  139. package/lib/security/constants.js.map +0 -1
  140. package/lib/security/methods.js.map +0 -1
  141. package/lib/security/reducers.js.map +0 -1
  142. package/lib/security/session-checker.js.map +0 -1
  143. package/lib/utils/actions.js.map +0 -1
  144. package/lib/utils/fragment-parser.js.map +0 -1
  145. package/lib/utils/methods.js.map +0 -1
  146. package/lib/utils/query-actions.js.map +0 -1
  147. package/lib/utils/questions-set.js.map +0 -1
  148. package/lib/utils/reducers.js.map +0 -1
  149. package/lib/utils/use-fit-text.js.map +0 -1
@@ -1,2 +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,(()=>(()=>{"use strict";var e={4341:(e,t,n)=>{n(8779),n(4656),n(4054),n(6793),n(8576)},1593:(e,t,n)=>{n.d(t,{AUTH_ERROR_ACCESS_TOKEN_EXPIRED:()=>o,AUTH_ERROR_LOCK_ACQUIRE_ERROR:()=>s,AUTH_ERROR_MISSING_AUTH_INFO:()=>r,AUTH_ERROR_MISSING_REFRESH_TOKEN:()=>a,AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR:()=>c});const r="AUTH_ERROR_MISSING_AUTH_INFO",a="AUTH_ERROR_MISSING_REFRESH_TOKEN",o="AUTH_ERROR_ACCESS_TOKEN_EXPIRED",s="AUTH_ERROR_LOCK_ACQUIRE_ERROR",c="AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR"},8576:(e,t,n)=>{n.d(t,{getAccessToken:()=>h});var r=n(6793);n(2691);const a=require("browser-tabs-lock");var o=n.n(a);n(6530),n(3856),n(4341);require("crypto-js/sha256"),require("crypto-js/enc-base64url"),require("crypto-js/enc-hex"),"undefined"!=typeof window&&(window.crypto||window.msCrypto);var s=n(1593);const c=new(o()),i="openstackuicore.lock.getTokenSilently",l="code",d="authInfo",p="nonce",u="pkce",h=async()=>{if(await(0,r.retryPromise)((()=>c.acquireLock(i,5e3)),10))try{let e=m();if(!e)throw Error(s.AUTH_ERROR_MISSING_AUTH_INFO);let{accessToken:t,expiresIn:n,accessTokenUpdatedAt:r,refreshToken:a}=e,o=g(),c=Math.floor(Date.now()/1e3);if(n-=20,c-r>n||null==t){if(console.log("getAccessToken access token expired"),o===l&&w()){if(!a)throw _(),Error(s.AUTH_ERROR_MISSING_REFRESH_TOKEN);let e=await f(a),{access_token:t,expires_in:n,refresh_token:r}=e;return void 0===r&&(r=null),R(t,n,r),t}throw _(),Error(s.AUTH_ERROR_ACCESS_TOKEN_EXPIRED)}return t}finally{await c.releaseLock(i)}throw Error(s.AUTH_ERROR_LOCK_ACQUIRE_ERROR)},f=async e=>{let t=y(),n=E();const a={grant_type:"refresh_token",client_id:encodeURI(n),refresh_token:e};try{const e=await fetch(`${t}/oauth2/token`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(a)}).then((e=>{if(400===e.status){(0,r.getCurrentPathName)();throw(0,r.setSessionClearingState)(!0),Error(`${s.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${e.status} - ${e.statusText}`)}return e})).catch((function(e){throw Error(`${s.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${e.message}`)})),n=await e.json();let{access_token:o,refresh_token:c,expires_in:i}=n;return{access_token:o,refresh_token:c,expires_in:i}}catch(e){throw console.log(e),e}},R=(e,t,n=null,a=null)=>{let o=m(),s={accessToken:e,expiresIn:t,accessTokenUpdatedAt:Math.floor(Date.now()/1e3)};null===n&&o&&(n=o.refreshToken),null===a&&o&&(a=o.idToken),n&&(s.refreshToken=n),a&&(s.idToken=a),(0,r.putOnLocalStorage)(d,JSON.stringify(s))},m=()=>{try{let e=(0,r.getFromLocalStorage)(d,!1);return e?JSON.parse(e):null}catch(e){return null}},_=()=>{if("undefined"!=typeof window)return(0,r.removeFromLocalStorage)(d),(0,r.removeFromLocalStorage)(p),void(0,r.removeFromLocalStorage)(u)},E=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,g=()=>"undefined"!=typeof window&&window.OAUTH2_FLOW||"token id_token",w=()=>"undefined"==typeof window||new Boolean(window.OAUTH2_USE_REFRESH_TOKEN||!0),y=()=>"undefined"!=typeof window?window.IDP_BASE_URL:null},4054:(e,t,n)=>{n.d(t,{escapeFilterValue:()=>d,fetchErrorHandler:()=>i,fetchResponseHandler:()=>l});n(3838),n(2691),n(6530);var r=n(271),a=n.n(r),o=n(4656),s=n.n(o);n(6793),n(4341),n(8576);const c=e=>t=>({type:e,payload:t}),i=(c("RESET_LOADING"),c("START_LOADING"),c("STOP_LOADING"),e=>{let t=e.status,n=e.statusText;switch(t){case 403:a().fire("ERROR",s().translate("errors.user_not_authz"),"warning");break;case 401:a().fire("ERROR",s().translate("errors.session_expired"),"error");break;case 412:a().fire("ERROR",n,"warning");case 500:a().fire("ERROR",s().translate("errors.server_error"),"error")}}),l=e=>{if(e.ok)return e.json();throw e},d=e=>e=(e=e.replace(/,/g,"\\,")).replace(/;/g,"\\;")},6793:(e,t,n)=>{n.d(t,{buildAPIBaseUrl:()=>a,getCurrentPathName:()=>r,getFromLocalStorage:()=>s,putOnLocalStorage:()=>o,removeFromLocalStorage:()=>c,retryPromise:()=>l,setSessionClearingState:()=>i});n(8362),n(6530);const r=()=>"undefined"!=typeof window?window.location.pathname:null,a=e=>"undefined"!=typeof window?`${window.API_BASE_URL}${e}`:null``,o=(e,t)=>{"undefined"!=typeof window&&window.localStorage.setItem(e,t)},s=(e,t)=>{if("undefined"!=typeof window){let n=window.localStorage.getItem(e);return t&&(console.log(`getFromLocalStorage removing key ${e}`),c(e)),n}return null},c=e=>{"undefined"!=typeof window&&window.localStorage.removeItem(e)},i=e=>{"undefined"!=typeof window&&(window.clearing_session_state=e)},l=async(e,t=3)=>{for(let n=0;n<t;n++)if(await e())return!0;return!1}},7525:(e,t,n)=>{n.d(t,{querySpeakers:()=>p});var r=n(4054),a=n(8576),o=n(6793);const s=require("lodash");var c=n.n(s),i=n(6530),l=n.n(i);const d=500,p=(c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`full_name=@${e},first_name=@${e},last_name=@${e},email=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/members?filter=${s}&expand=tickets,rsvp,schedule_summit_events,all_affiliations&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/all?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c="/api/v1";e&&(c+=`/summits/${e}`),c+=`/speakers?filter=${encodeURIComponent(`full_name=@${t},first_name=@${t},last_name=@${t},email=@${t}`)}&access_token=${s}&expand=member,registration_request`,fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d));c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c="/api/v1",i=encodeURIComponent(`tag=@${t}`);c+=e?`/summits/${e}/track-tag-groups/all/allowed-tags?filter=${i}&expand=tag,track_tag_group`:`/tags?filter=${i}`,c+=`&order=tag&page=1&per_page=50&access_token=${s}`,fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((t=>{let r=[...t.data];e&&(r=r.map((e=>e.tag))),n(r)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/tracks?filter=${c}&order=name&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();let c=(t=(0,r.escapeFilterValue)(t))?encodeURIComponent(`filter=name=@${t}`):"";fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/track-groups?order=name&access_token=${s}&${c}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n=!1,s)=>{const c=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let i=`/api/v1/summits/${e}/events`+(n?"/published":""),l=encodeURIComponent(`title=@${t}`);fetch((0,o.buildAPIBaseUrl)(`${i}?filter=${l}&order=title&access_token=${c}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];s(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n,s=null)=>{let c=`/api/v1/summits/${e}/event-types?order=name&access_token=${await(0,a.getAccessToken)()}`;if(t=(0,r.escapeFilterValue)(t)){c+=`&filter[]=${encodeURIComponent(`name=@${t}`)}`}if(s){c+=`&filter[]=${encodeURIComponent(`class_name==${s}`)}`}fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();let s=encodeURIComponent(`title=@${e},code=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/groups?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/companies?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{let s;try{s=await(0,a.getAccessToken)()}catch(e){return void n(e)}let c=l()(`/api/v1/summits/${e}/registration-companies`);c.addQuery("access_token",s),c.addQuery("order","name"),t&&(t=(0,r.escapeFilterValue)(t),c.addQuery("filter[]",`name@@${t}`)),fetch((0,o.buildAPIBaseUrl)(c.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`company_name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/sponsors?filter=${c}&expand=company,sponsorship&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/access-level-types?filter=${c}&&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/organizations?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d);c().debounce((async(e,t={},n,s="v1")=>{const c=await(0,a.getAccessToken)();let i=l()(`/api/${s}/summits/${e}/ticket-types`);if(i.addQuery("access_token",c),i.addQuery("order","name"),t.hasOwnProperty("name")){const e=(0,r.escapeFilterValue)(t.name);i.addQuery("filter[]",`name@@${e}`)}if(t.hasOwnProperty("audience")){const e=(0,r.escapeFilterValue)(t.audience);i.addQuery("filter[]",`audience==${e}`)}fetch((0,o.buildAPIBaseUrl)(i.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)(),s=l()("/api/v1/sponsored-projects");s.addQuery("access_token",n),e&&(e=(0,r.escapeFilterValue)(e),s.addQuery("filter[]",`name=@${e}`)),fetch((0,o.buildAPIBaseUrl)(s.toString())).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`code=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/promo-codes?filter=${c}&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d)},8779:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},8213:e=>{e.exports=require("@babel/runtime/helpers/extends")},3838:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},4656:e=>{e.exports=require("i18n-react/dist/i18n-react")},3856:e=>{e.exports=require("idtoken-verifier")},8362:e=>{e.exports=require("moment-timezone")},6689:e=>{e.exports=require("react")},9953:e=>{e.exports=require("react-select/lib/Async")},2691:e=>{e.exports=require("superagent/lib/client")},271:e=>{e.exports=require("sweetalert2")},6530:e=>{e.exports=require("urijs")}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}(()=>{n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t}})(),(()=>{n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}})(),(()=>{n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var r={};return(()=>{n.r(r),n.d(r,{default:()=>h});var e=n(8213),t=n.n(e),a=n(3838),o=n.n(a),s=n(6689),c=n.n(s),i=n(9953),l=n.n(i);const d=require("react-select/lib/components");var p=n(7525);const u=["value","onChange","history","summitId","error","id","multi"];class h extends c().Component{constructor(e){super(e),this.handleChange=this.handleChange.bind(this),this.getSpeakers=this.getSpeakers.bind(this),this.handleClick=this.handleClick.bind(this),this.getOptionValue=this.getOptionValue.bind(this),this.getOptionLabel=this.getOptionLabel.bind(this)}handleChange(e){let t={target:{id:this.props.id,value:e,type:"speakerinput"}};this.props.onChange(t)}handleClick(e){let{history:t}=this.props;t.push(`/app/speakers/${e}`)}getSpeakers(e,t){if(!e)return Promise.resolve({options:[]});let n=this.props.hasOwnProperty("summitId")?this.props.summitId:null;(0,p.querySpeakers)(n,e,t)}getOptionValue(e){return this.props.hasOwnProperty("getOptionValue")?this.props.getOptionValue(e):e.id}getOptionLabel(e){return this.props.hasOwnProperty("getOptionLabel")?this.props.getOptionLabel(e):`${e.first_name} ${e.last_name} (${e.id})`}render(){let e=this.props,{value:n,onChange:r,history:a,summitId:s,error:i,id:p,multi:h}=e,f=o()(e,u),R=this.props.hasOwnProperty("error")&&""!=i,m=this.props.hasOwnProperty("multi");return c().createElement("div",null,c().createElement(l(),t()({value:n,onChange:this.handleChange,loadOptions:this.getSpeakers,components:{MultiValueLabel:e=>c().createElement("a",{onClick:()=>this.handleClick(e.data.id),style:{cursor:"pointer"}},c().createElement(d.components.MultiValueLabel,e))},getOptionValue:e=>this.getOptionValue(e),getOptionLabel:e=>this.getOptionLabel(e),isMulti:m},f)),R&&c().createElement("p",{className:"error-label"},i))}}})(),r})()));
2
- //# sourceMappingURL=speaker-input.js.map
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,(()=>(()=>{"use strict";var e={4341:(e,t,n)=>{n(8779),n(4656),n(4054),n(6793),n(8576)},1593:(e,t,n)=>{n.d(t,{AUTH_ERROR_ACCESS_TOKEN_EXPIRED:()=>o,AUTH_ERROR_LOCK_ACQUIRE_ERROR:()=>s,AUTH_ERROR_MISSING_AUTH_INFO:()=>r,AUTH_ERROR_MISSING_REFRESH_TOKEN:()=>a,AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR:()=>c});const r="AUTH_ERROR_MISSING_AUTH_INFO",a="AUTH_ERROR_MISSING_REFRESH_TOKEN",o="AUTH_ERROR_ACCESS_TOKEN_EXPIRED",s="AUTH_ERROR_LOCK_ACQUIRE_ERROR",c="AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR"},8576:(e,t,n)=>{n.d(t,{getAccessToken:()=>h});var r=n(6793);n(2691);const a=require("browser-tabs-lock");var o=n.n(a);n(6530),n(3856),n(4341);require("crypto-js/sha256"),require("crypto-js/enc-base64url"),require("crypto-js/enc-hex"),"undefined"!=typeof window&&(window.crypto||window.msCrypto);var s=n(1593);const c=new(o()),i="openstackuicore.lock.getTokenSilently",l="code",d="authInfo",p="nonce",u="pkce",h=async()=>{if(await(0,r.retryPromise)((()=>c.acquireLock(i,5e3)),10))try{let e=m();if(!e)throw Error(s.AUTH_ERROR_MISSING_AUTH_INFO);let{accessToken:t,expiresIn:n,accessTokenUpdatedAt:r,refreshToken:a}=e,o=g(),c=Math.floor(Date.now()/1e3);if(n-=20,c-r>n||null==t){if(console.log("getAccessToken access token expired"),o===l&&w()){if(!a)throw _(),Error(s.AUTH_ERROR_MISSING_REFRESH_TOKEN);let e=await f(a),{access_token:t,expires_in:n,refresh_token:r}=e;return void 0===r&&(r=null),R(t,n,r),t}throw _(),Error(s.AUTH_ERROR_ACCESS_TOKEN_EXPIRED)}return t}finally{await c.releaseLock(i)}throw Error(s.AUTH_ERROR_LOCK_ACQUIRE_ERROR)},f=async e=>{let t=y(),n=E();const a={grant_type:"refresh_token",client_id:encodeURI(n),refresh_token:e};try{const e=await fetch(`${t}/oauth2/token`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(a)}).then((e=>{if(400===e.status){(0,r.getCurrentPathName)();throw(0,r.setSessionClearingState)(!0),Error(`${s.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${e.status} - ${e.statusText}`)}return e})).catch((function(e){throw Error(`${s.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${e.message}`)})),n=await e.json();let{access_token:o,refresh_token:c,expires_in:i}=n;return{access_token:o,refresh_token:c,expires_in:i}}catch(e){throw console.log(e),e}},R=(e,t,n=null,a=null)=>{let o=m(),s={accessToken:e,expiresIn:t,accessTokenUpdatedAt:Math.floor(Date.now()/1e3)};null===n&&o&&(n=o.refreshToken),null===a&&o&&(a=o.idToken),n&&(s.refreshToken=n),a&&(s.idToken=a),(0,r.putOnLocalStorage)(d,JSON.stringify(s))},m=()=>{try{let e=(0,r.getFromLocalStorage)(d,!1);return e?JSON.parse(e):null}catch(e){return null}},_=()=>{if("undefined"!=typeof window)return(0,r.removeFromLocalStorage)(d),(0,r.removeFromLocalStorage)(p),void(0,r.removeFromLocalStorage)(u)},E=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,g=()=>"undefined"!=typeof window&&window.OAUTH2_FLOW||"token id_token",w=()=>"undefined"==typeof window||new Boolean(window.OAUTH2_USE_REFRESH_TOKEN||!0),y=()=>"undefined"!=typeof window?window.IDP_BASE_URL:null},4054:(e,t,n)=>{n.d(t,{escapeFilterValue:()=>d,fetchErrorHandler:()=>i,fetchResponseHandler:()=>l});n(3838),n(2691),n(6530);var r=n(271),a=n.n(r),o=n(4656),s=n.n(o);n(6793),n(4341),n(8576);const c=e=>t=>({type:e,payload:t}),i=(c("RESET_LOADING"),c("START_LOADING"),c("STOP_LOADING"),e=>{let t=e.status,n=e.statusText;switch(t){case 403:a().fire("ERROR",s().translate("errors.user_not_authz"),"warning");break;case 401:a().fire("ERROR",s().translate("errors.session_expired"),"error");break;case 412:a().fire("ERROR",n,"warning");case 500:a().fire("ERROR",s().translate("errors.server_error"),"error")}}),l=e=>{if(e.ok)return e.json();throw e},d=e=>e=(e=e.replace(/,/g,"\\,")).replace(/;/g,"\\;")},6793:(e,t,n)=>{n.d(t,{buildAPIBaseUrl:()=>a,getCurrentPathName:()=>r,getFromLocalStorage:()=>s,putOnLocalStorage:()=>o,removeFromLocalStorage:()=>c,retryPromise:()=>l,setSessionClearingState:()=>i});n(8362),n(6530);const r=()=>"undefined"!=typeof window?window.location.pathname:null,a=e=>"undefined"!=typeof window?`${window.API_BASE_URL}${e}`:null``,o=(e,t)=>{"undefined"!=typeof window&&window.localStorage.setItem(e,t)},s=(e,t)=>{if("undefined"!=typeof window){let n=window.localStorage.getItem(e);return t&&(console.log(`getFromLocalStorage removing key ${e}`),c(e)),n}return null},c=e=>{"undefined"!=typeof window&&window.localStorage.removeItem(e)},i=e=>{"undefined"!=typeof window&&(window.clearing_session_state=e)},l=async(e,t=3)=>{for(let n=0;n<t;n++)if(await e())return!0;return!1}},7525:(e,t,n)=>{n.d(t,{querySpeakers:()=>p});var r=n(4054),a=n(8576),o=n(6793);const s=require("lodash");var c=n.n(s),i=n(6530),l=n.n(i);const d=500,p=(c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`full_name=@${e},first_name=@${e},last_name=@${e},email=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/members?filter=${s}&expand=tickets,rsvp,schedule_summit_events,all_affiliations&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/all?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c="/api/v1";e&&(c+=`/summits/${e}`),c+=`/speakers?filter=${encodeURIComponent(`full_name=@${t},first_name=@${t},last_name=@${t},email=@${t}`)}&access_token=${s}&expand=member,registration_request`,fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d));c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c="/api/v1",i=encodeURIComponent(`tag=@${t}`);c+=e?`/summits/${e}/track-tag-groups/all/allowed-tags?filter=${i}&expand=tag,track_tag_group`:`/tags?filter=${i}`,c+=`&order=tag&page=1&per_page=50&access_token=${s}`,fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((t=>{let r=[...t.data];e&&(r=r.map((e=>e.tag))),n(r)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/tracks?filter=${c}&order=name&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();let c=(t=(0,r.escapeFilterValue)(t))?encodeURIComponent(`filter=name=@${t}`):"";fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/track-groups?order=name&access_token=${s}&${c}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n=!1,s)=>{const c=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let i=`/api/v1/summits/${e}/events`+(n?"/published":""),l=encodeURIComponent(`title=@${t}`);fetch((0,o.buildAPIBaseUrl)(`${i}?filter=${l}&order=title&access_token=${c}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];s(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n,s=null)=>{let c=`/api/v1/summits/${e}/event-types?order=name&access_token=${await(0,a.getAccessToken)()}`;if(t=(0,r.escapeFilterValue)(t)){c+=`&filter[]=${encodeURIComponent(`name=@${t}`)}`}if(s){c+=`&filter[]=${encodeURIComponent(`class_name==${s}`)}`}fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();let s=encodeURIComponent(`title=@${e},code=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/groups?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/companies?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{let s;try{s=await(0,a.getAccessToken)()}catch(e){return void n(e)}let c=l()(`/api/v1/summits/${e}/registration-companies`);c.addQuery("access_token",s),c.addQuery("order","name"),t&&(t=(0,r.escapeFilterValue)(t),c.addQuery("filter[]",`name@@${t}`)),fetch((0,o.buildAPIBaseUrl)(c.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`company_name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/sponsors?filter=${c}&expand=company,sponsorship&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/access-level-types?filter=${c}&&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/organizations?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d);c().debounce((async(e,t={},n,s="v1")=>{const c=await(0,a.getAccessToken)();let i=l()(`/api/${s}/summits/${e}/ticket-types`);if(i.addQuery("access_token",c),i.addQuery("order","name"),t.hasOwnProperty("name")){const e=(0,r.escapeFilterValue)(t.name);i.addQuery("filter[]",`name@@${e}`)}if(t.hasOwnProperty("audience")){const e=(0,r.escapeFilterValue)(t.audience);i.addQuery("filter[]",`audience==${e}`)}fetch((0,o.buildAPIBaseUrl)(i.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)(),s=l()("/api/v1/sponsored-projects");s.addQuery("access_token",n),e&&(e=(0,r.escapeFilterValue)(e),s.addQuery("filter[]",`name=@${e}`)),fetch((0,o.buildAPIBaseUrl)(s.toString())).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`code=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/promo-codes?filter=${c}&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d)},8779:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},8213:e=>{e.exports=require("@babel/runtime/helpers/extends")},3838:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},4656:e=>{e.exports=require("i18n-react/dist/i18n-react")},3856:e=>{e.exports=require("idtoken-verifier")},8362:e=>{e.exports=require("moment-timezone")},6689:e=>{e.exports=require("react")},9953:e=>{e.exports=require("react-select/lib/Async")},2691:e=>{e.exports=require("superagent/lib/client")},271:e=>{e.exports=require("sweetalert2")},6530:e=>{e.exports=require("urijs")}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}(()=>{n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t}})(),(()=>{n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}})(),(()=>{n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var r={};return(()=>{n.r(r),n.d(r,{default:()=>h});var e=n(8213),t=n.n(e),a=n(3838),o=n.n(a),s=n(6689),c=n.n(s),i=n(9953),l=n.n(i);const d=require("react-select/lib/components");var p=n(7525);const u=["value","onChange","history","summitId","error","id","multi"];class h extends c().Component{constructor(e){super(e),this.handleChange=this.handleChange.bind(this),this.getSpeakers=this.getSpeakers.bind(this),this.handleClick=this.handleClick.bind(this),this.getOptionValue=this.getOptionValue.bind(this),this.getOptionLabel=this.getOptionLabel.bind(this)}handleChange(e){let t={target:{id:this.props.id,value:e,type:"speakerinput"}};this.props.onChange(t)}handleClick(e){let{history:t}=this.props;t.push(`/app/speakers/${e}`)}getSpeakers(e,t){if(!e)return Promise.resolve({options:[]});let n=this.props.hasOwnProperty("summitId")?this.props.summitId:null;(0,p.querySpeakers)(n,e,t)}getOptionValue(e){return this.props.hasOwnProperty("getOptionValue")?this.props.getOptionValue(e):e.id}getOptionLabel(e){return this.props.hasOwnProperty("getOptionLabel")?this.props.getOptionLabel(e):`${e.first_name} ${e.last_name} (${e.id})`}render(){let e=this.props,{value:n,onChange:r,history:a,summitId:s,error:i,id:p,multi:h}=e,f=o()(e,u),R=this.props.hasOwnProperty("error")&&""!=i,m=this.props.hasOwnProperty("multi");return c().createElement("div",null,c().createElement(l(),t()({value:n,onChange:this.handleChange,loadOptions:this.getSpeakers,components:{MultiValueLabel:e=>c().createElement("a",{onClick:()=>this.handleClick(e.data.id),style:{cursor:"pointer"}},c().createElement(d.components.MultiValueLabel,e))},getOptionValue:e=>this.getOptionValue(e),getOptionLabel:e=>this.getOptionLabel(e),isMulti:m},f)),R&&c().createElement("p",{className:"error-label"},i))}}})(),r})()));
@@ -1,2 +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,(()=>(()=>{"use strict";var e={4341:(e,t,n)=>{n(8779),n(4656),n(4054),n(6793),n(8576)},1593:(e,t,n)=>{n.d(t,{AUTH_ERROR_ACCESS_TOKEN_EXPIRED:()=>o,AUTH_ERROR_LOCK_ACQUIRE_ERROR:()=>s,AUTH_ERROR_MISSING_AUTH_INFO:()=>r,AUTH_ERROR_MISSING_REFRESH_TOKEN:()=>a,AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR:()=>c});const r="AUTH_ERROR_MISSING_AUTH_INFO",a="AUTH_ERROR_MISSING_REFRESH_TOKEN",o="AUTH_ERROR_ACCESS_TOKEN_EXPIRED",s="AUTH_ERROR_LOCK_ACQUIRE_ERROR",c="AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR"},8576:(e,t,n)=>{n.d(t,{getAccessToken:()=>h});var r=n(6793);n(2691);const a=require("browser-tabs-lock");var o=n.n(a);n(6530),n(3856),n(4341);require("crypto-js/sha256"),require("crypto-js/enc-base64url"),require("crypto-js/enc-hex"),"undefined"!=typeof window&&(window.crypto||window.msCrypto);var s=n(1593);const c=new(o()),i="openstackuicore.lock.getTokenSilently",l="code",d="authInfo",p="nonce",u="pkce",h=async()=>{if(await(0,r.retryPromise)((()=>c.acquireLock(i,5e3)),10))try{let e=_();if(!e)throw Error(s.AUTH_ERROR_MISSING_AUTH_INFO);let{accessToken:t,expiresIn:n,accessTokenUpdatedAt:r,refreshToken:a}=e,o=g(),c=Math.floor(Date.now()/1e3);if(n-=20,c-r>n||null==t){if(console.log("getAccessToken access token expired"),o===l&&w()){if(!a)throw m(),Error(s.AUTH_ERROR_MISSING_REFRESH_TOKEN);let e=await f(a),{access_token:t,expires_in:n,refresh_token:r}=e;return void 0===r&&(r=null),R(t,n,r),t}throw m(),Error(s.AUTH_ERROR_ACCESS_TOKEN_EXPIRED)}return t}finally{await c.releaseLock(i)}throw Error(s.AUTH_ERROR_LOCK_ACQUIRE_ERROR)},f=async e=>{let t=y(),n=E();const a={grant_type:"refresh_token",client_id:encodeURI(n),refresh_token:e};try{const e=await fetch(`${t}/oauth2/token`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(a)}).then((e=>{if(400===e.status){(0,r.getCurrentPathName)();throw(0,r.setSessionClearingState)(!0),Error(`${s.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${e.status} - ${e.statusText}`)}return e})).catch((function(e){throw Error(`${s.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${e.message}`)})),n=await e.json();let{access_token:o,refresh_token:c,expires_in:i}=n;return{access_token:o,refresh_token:c,expires_in:i}}catch(e){throw console.log(e),e}},R=(e,t,n=null,a=null)=>{let o=_(),s={accessToken:e,expiresIn:t,accessTokenUpdatedAt:Math.floor(Date.now()/1e3)};null===n&&o&&(n=o.refreshToken),null===a&&o&&(a=o.idToken),n&&(s.refreshToken=n),a&&(s.idToken=a),(0,r.putOnLocalStorage)(d,JSON.stringify(s))},_=()=>{try{let e=(0,r.getFromLocalStorage)(d,!1);return e?JSON.parse(e):null}catch(e){return null}},m=()=>{if("undefined"!=typeof window)return(0,r.removeFromLocalStorage)(d),(0,r.removeFromLocalStorage)(p),void(0,r.removeFromLocalStorage)(u)},E=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,g=()=>"undefined"!=typeof window&&window.OAUTH2_FLOW||"token id_token",w=()=>"undefined"==typeof window||new Boolean(window.OAUTH2_USE_REFRESH_TOKEN||!0),y=()=>"undefined"!=typeof window?window.IDP_BASE_URL:null},4054:(e,t,n)=>{n.d(t,{escapeFilterValue:()=>d,fetchErrorHandler:()=>i,fetchResponseHandler:()=>l});n(3838),n(2691),n(6530);var r=n(271),a=n.n(r),o=n(4656),s=n.n(o);n(6793),n(4341),n(8576);const c=e=>t=>({type:e,payload:t}),i=(c("RESET_LOADING"),c("START_LOADING"),c("STOP_LOADING"),e=>{let t=e.status,n=e.statusText;switch(t){case 403:a().fire("ERROR",s().translate("errors.user_not_authz"),"warning");break;case 401:a().fire("ERROR",s().translate("errors.session_expired"),"error");break;case 412:a().fire("ERROR",n,"warning");case 500:a().fire("ERROR",s().translate("errors.server_error"),"error")}}),l=e=>{if(e.ok)return e.json();throw e},d=e=>e=(e=e.replace(/,/g,"\\,")).replace(/;/g,"\\;")},6793:(e,t,n)=>{n.d(t,{buildAPIBaseUrl:()=>a,getCurrentPathName:()=>r,getFromLocalStorage:()=>s,putOnLocalStorage:()=>o,removeFromLocalStorage:()=>c,retryPromise:()=>l,setSessionClearingState:()=>i});n(8362),n(6530);const r=()=>"undefined"!=typeof window?window.location.pathname:null,a=e=>"undefined"!=typeof window?`${window.API_BASE_URL}${e}`:null``,o=(e,t)=>{"undefined"!=typeof window&&window.localStorage.setItem(e,t)},s=(e,t)=>{if("undefined"!=typeof window){let n=window.localStorage.getItem(e);return t&&(console.log(`getFromLocalStorage removing key ${e}`),c(e)),n}return null},c=e=>{"undefined"!=typeof window&&window.localStorage.removeItem(e)},i=e=>{"undefined"!=typeof window&&(window.clearing_session_state=e)},l=async(e,t=3)=>{for(let n=0;n<t;n++)if(await e())return!0;return!1}},7525:(e,t,n)=>{n.d(t,{querySponsors:()=>p});var r=n(4054),a=n(8576),o=n(6793);const s=require("lodash");var c=n.n(s),i=n(6530),l=n.n(i);const d=500,p=(c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`full_name=@${e},first_name=@${e},last_name=@${e},email=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/members?filter=${s}&expand=tickets,rsvp,schedule_summit_events,all_affiliations&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/all?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c="/api/v1";e&&(c+=`/summits/${e}`),c+=`/speakers?filter=${encodeURIComponent(`full_name=@${t},first_name=@${t},last_name=@${t},email=@${t}`)}&access_token=${s}&expand=member,registration_request`,fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c="/api/v1",i=encodeURIComponent(`tag=@${t}`);c+=e?`/summits/${e}/track-tag-groups/all/allowed-tags?filter=${i}&expand=tag,track_tag_group`:`/tags?filter=${i}`,c+=`&order=tag&page=1&per_page=50&access_token=${s}`,fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((t=>{let r=[...t.data];e&&(r=r.map((e=>e.tag))),n(r)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/tracks?filter=${c}&order=name&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();let c=(t=(0,r.escapeFilterValue)(t))?encodeURIComponent(`filter=name=@${t}`):"";fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/track-groups?order=name&access_token=${s}&${c}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n=!1,s)=>{const c=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let i=`/api/v1/summits/${e}/events`+(n?"/published":""),l=encodeURIComponent(`title=@${t}`);fetch((0,o.buildAPIBaseUrl)(`${i}?filter=${l}&order=title&access_token=${c}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];s(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n,s=null)=>{let c=`/api/v1/summits/${e}/event-types?order=name&access_token=${await(0,a.getAccessToken)()}`;if(t=(0,r.escapeFilterValue)(t)){c+=`&filter[]=${encodeURIComponent(`name=@${t}`)}`}if(s){c+=`&filter[]=${encodeURIComponent(`class_name==${s}`)}`}fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();let s=encodeURIComponent(`title=@${e},code=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/groups?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/companies?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{let s;try{s=await(0,a.getAccessToken)()}catch(e){return void n(e)}let c=l()(`/api/v1/summits/${e}/registration-companies`);c.addQuery("access_token",s),c.addQuery("order","name"),t&&(t=(0,r.escapeFilterValue)(t),c.addQuery("filter[]",`name@@${t}`)),fetch((0,o.buildAPIBaseUrl)(c.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`company_name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/sponsors?filter=${c}&expand=company,sponsorship&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d));c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/access-level-types?filter=${c}&&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/organizations?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d);c().debounce((async(e,t={},n,s="v1")=>{const c=await(0,a.getAccessToken)();let i=l()(`/api/${s}/summits/${e}/ticket-types`);if(i.addQuery("access_token",c),i.addQuery("order","name"),t.hasOwnProperty("name")){const e=(0,r.escapeFilterValue)(t.name);i.addQuery("filter[]",`name@@${e}`)}if(t.hasOwnProperty("audience")){const e=(0,r.escapeFilterValue)(t.audience);i.addQuery("filter[]",`audience==${e}`)}fetch((0,o.buildAPIBaseUrl)(i.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)(),s=l()("/api/v1/sponsored-projects");s.addQuery("access_token",n),e&&(e=(0,r.escapeFilterValue)(e),s.addQuery("filter[]",`name=@${e}`)),fetch((0,o.buildAPIBaseUrl)(s.toString())).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`code=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/promo-codes?filter=${c}&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d)},8779:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},8213:e=>{e.exports=require("@babel/runtime/helpers/extends")},3838:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},4656:e=>{e.exports=require("i18n-react/dist/i18n-react")},3856:e=>{e.exports=require("idtoken-verifier")},8362:e=>{e.exports=require("moment-timezone")},6689:e=>{e.exports=require("react")},9953:e=>{e.exports=require("react-select/lib/Async")},2691:e=>{e.exports=require("superagent/lib/client")},271:e=>{e.exports=require("sweetalert2")},6530:e=>{e.exports=require("urijs")}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}(()=>{n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t}})(),(()=>{n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}})(),(()=>{n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var r={};return(()=>{n.r(r),n.d(r,{default:()=>u});var e=n(8213),t=n.n(e),a=n(3838),o=n.n(a),s=n(6689),c=n.n(s),i=n(9953),l=n.n(i),d=n(7525);const p=["error","value","onChange","id","multi","summitId"];class u extends c().Component{constructor(e){super(e),this.handleChange=this.handleChange.bind(this),this.getSponsors=this.getSponsors.bind(this)}handleChange(e){let t={target:{id:this.props.id,value:e,type:"sponsorinput"}};this.props.onChange(t)}getSponsors(e,t){let{summitId:n}=this.props;if(!e)return Promise.resolve({options:[]});(0,d.querySponsors)(n,e,t)}render(){let e=this.props,{error:n,value:r,onChange:a,id:s,multi:i,summitId:d}=e,u=o()(e,p),h=this.props.hasOwnProperty("error")&&""!=n,f=this.props.hasOwnProperty("multi");return c().createElement("div",null,c().createElement(l(),t()({value:r,getOptionValue:e=>e.id,getOptionLabel:e=>`${e.company.name} (${e.sponsorship.label})`,onChange:this.handleChange,loadOptions:this.getSponsors,isMulti:f},u)),h&&c().createElement("p",{className:"error-label"},n))}}})(),r})()));
2
- //# sourceMappingURL=sponsor-input.js.map
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,(()=>(()=>{"use strict";var e={4341:(e,t,n)=>{n(8779),n(4656),n(4054),n(6793),n(8576)},1593:(e,t,n)=>{n.d(t,{AUTH_ERROR_ACCESS_TOKEN_EXPIRED:()=>o,AUTH_ERROR_LOCK_ACQUIRE_ERROR:()=>s,AUTH_ERROR_MISSING_AUTH_INFO:()=>r,AUTH_ERROR_MISSING_REFRESH_TOKEN:()=>a,AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR:()=>c});const r="AUTH_ERROR_MISSING_AUTH_INFO",a="AUTH_ERROR_MISSING_REFRESH_TOKEN",o="AUTH_ERROR_ACCESS_TOKEN_EXPIRED",s="AUTH_ERROR_LOCK_ACQUIRE_ERROR",c="AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR"},8576:(e,t,n)=>{n.d(t,{getAccessToken:()=>h});var r=n(6793);n(2691);const a=require("browser-tabs-lock");var o=n.n(a);n(6530),n(3856),n(4341);require("crypto-js/sha256"),require("crypto-js/enc-base64url"),require("crypto-js/enc-hex"),"undefined"!=typeof window&&(window.crypto||window.msCrypto);var s=n(1593);const c=new(o()),i="openstackuicore.lock.getTokenSilently",l="code",d="authInfo",p="nonce",u="pkce",h=async()=>{if(await(0,r.retryPromise)((()=>c.acquireLock(i,5e3)),10))try{let e=_();if(!e)throw Error(s.AUTH_ERROR_MISSING_AUTH_INFO);let{accessToken:t,expiresIn:n,accessTokenUpdatedAt:r,refreshToken:a}=e,o=g(),c=Math.floor(Date.now()/1e3);if(n-=20,c-r>n||null==t){if(console.log("getAccessToken access token expired"),o===l&&w()){if(!a)throw m(),Error(s.AUTH_ERROR_MISSING_REFRESH_TOKEN);let e=await f(a),{access_token:t,expires_in:n,refresh_token:r}=e;return void 0===r&&(r=null),R(t,n,r),t}throw m(),Error(s.AUTH_ERROR_ACCESS_TOKEN_EXPIRED)}return t}finally{await c.releaseLock(i)}throw Error(s.AUTH_ERROR_LOCK_ACQUIRE_ERROR)},f=async e=>{let t=y(),n=E();const a={grant_type:"refresh_token",client_id:encodeURI(n),refresh_token:e};try{const e=await fetch(`${t}/oauth2/token`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(a)}).then((e=>{if(400===e.status){(0,r.getCurrentPathName)();throw(0,r.setSessionClearingState)(!0),Error(`${s.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${e.status} - ${e.statusText}`)}return e})).catch((function(e){throw Error(`${s.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${e.message}`)})),n=await e.json();let{access_token:o,refresh_token:c,expires_in:i}=n;return{access_token:o,refresh_token:c,expires_in:i}}catch(e){throw console.log(e),e}},R=(e,t,n=null,a=null)=>{let o=_(),s={accessToken:e,expiresIn:t,accessTokenUpdatedAt:Math.floor(Date.now()/1e3)};null===n&&o&&(n=o.refreshToken),null===a&&o&&(a=o.idToken),n&&(s.refreshToken=n),a&&(s.idToken=a),(0,r.putOnLocalStorage)(d,JSON.stringify(s))},_=()=>{try{let e=(0,r.getFromLocalStorage)(d,!1);return e?JSON.parse(e):null}catch(e){return null}},m=()=>{if("undefined"!=typeof window)return(0,r.removeFromLocalStorage)(d),(0,r.removeFromLocalStorage)(p),void(0,r.removeFromLocalStorage)(u)},E=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,g=()=>"undefined"!=typeof window&&window.OAUTH2_FLOW||"token id_token",w=()=>"undefined"==typeof window||new Boolean(window.OAUTH2_USE_REFRESH_TOKEN||!0),y=()=>"undefined"!=typeof window?window.IDP_BASE_URL:null},4054:(e,t,n)=>{n.d(t,{escapeFilterValue:()=>d,fetchErrorHandler:()=>i,fetchResponseHandler:()=>l});n(3838),n(2691),n(6530);var r=n(271),a=n.n(r),o=n(4656),s=n.n(o);n(6793),n(4341),n(8576);const c=e=>t=>({type:e,payload:t}),i=(c("RESET_LOADING"),c("START_LOADING"),c("STOP_LOADING"),e=>{let t=e.status,n=e.statusText;switch(t){case 403:a().fire("ERROR",s().translate("errors.user_not_authz"),"warning");break;case 401:a().fire("ERROR",s().translate("errors.session_expired"),"error");break;case 412:a().fire("ERROR",n,"warning");case 500:a().fire("ERROR",s().translate("errors.server_error"),"error")}}),l=e=>{if(e.ok)return e.json();throw e},d=e=>e=(e=e.replace(/,/g,"\\,")).replace(/;/g,"\\;")},6793:(e,t,n)=>{n.d(t,{buildAPIBaseUrl:()=>a,getCurrentPathName:()=>r,getFromLocalStorage:()=>s,putOnLocalStorage:()=>o,removeFromLocalStorage:()=>c,retryPromise:()=>l,setSessionClearingState:()=>i});n(8362),n(6530);const r=()=>"undefined"!=typeof window?window.location.pathname:null,a=e=>"undefined"!=typeof window?`${window.API_BASE_URL}${e}`:null``,o=(e,t)=>{"undefined"!=typeof window&&window.localStorage.setItem(e,t)},s=(e,t)=>{if("undefined"!=typeof window){let n=window.localStorage.getItem(e);return t&&(console.log(`getFromLocalStorage removing key ${e}`),c(e)),n}return null},c=e=>{"undefined"!=typeof window&&window.localStorage.removeItem(e)},i=e=>{"undefined"!=typeof window&&(window.clearing_session_state=e)},l=async(e,t=3)=>{for(let n=0;n<t;n++)if(await e())return!0;return!1}},7525:(e,t,n)=>{n.d(t,{querySponsors:()=>p});var r=n(4054),a=n(8576),o=n(6793);const s=require("lodash");var c=n.n(s),i=n(6530),l=n.n(i);const d=500,p=(c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`full_name=@${e},first_name=@${e},last_name=@${e},email=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/members?filter=${s}&expand=tickets,rsvp,schedule_summit_events,all_affiliations&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/all?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c="/api/v1";e&&(c+=`/summits/${e}`),c+=`/speakers?filter=${encodeURIComponent(`full_name=@${t},first_name=@${t},last_name=@${t},email=@${t}`)}&access_token=${s}&expand=member,registration_request`,fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c="/api/v1",i=encodeURIComponent(`tag=@${t}`);c+=e?`/summits/${e}/track-tag-groups/all/allowed-tags?filter=${i}&expand=tag,track_tag_group`:`/tags?filter=${i}`,c+=`&order=tag&page=1&per_page=50&access_token=${s}`,fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((t=>{let r=[...t.data];e&&(r=r.map((e=>e.tag))),n(r)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/tracks?filter=${c}&order=name&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();let c=(t=(0,r.escapeFilterValue)(t))?encodeURIComponent(`filter=name=@${t}`):"";fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/track-groups?order=name&access_token=${s}&${c}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n=!1,s)=>{const c=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let i=`/api/v1/summits/${e}/events`+(n?"/published":""),l=encodeURIComponent(`title=@${t}`);fetch((0,o.buildAPIBaseUrl)(`${i}?filter=${l}&order=title&access_token=${c}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];s(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n,s=null)=>{let c=`/api/v1/summits/${e}/event-types?order=name&access_token=${await(0,a.getAccessToken)()}`;if(t=(0,r.escapeFilterValue)(t)){c+=`&filter[]=${encodeURIComponent(`name=@${t}`)}`}if(s){c+=`&filter[]=${encodeURIComponent(`class_name==${s}`)}`}fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();let s=encodeURIComponent(`title=@${e},code=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/groups?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/companies?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{let s;try{s=await(0,a.getAccessToken)()}catch(e){return void n(e)}let c=l()(`/api/v1/summits/${e}/registration-companies`);c.addQuery("access_token",s),c.addQuery("order","name"),t&&(t=(0,r.escapeFilterValue)(t),c.addQuery("filter[]",`name@@${t}`)),fetch((0,o.buildAPIBaseUrl)(c.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`company_name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/sponsors?filter=${c}&expand=company,sponsorship&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d));c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/access-level-types?filter=${c}&&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/organizations?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d);c().debounce((async(e,t={},n,s="v1")=>{const c=await(0,a.getAccessToken)();let i=l()(`/api/${s}/summits/${e}/ticket-types`);if(i.addQuery("access_token",c),i.addQuery("order","name"),t.hasOwnProperty("name")){const e=(0,r.escapeFilterValue)(t.name);i.addQuery("filter[]",`name@@${e}`)}if(t.hasOwnProperty("audience")){const e=(0,r.escapeFilterValue)(t.audience);i.addQuery("filter[]",`audience==${e}`)}fetch((0,o.buildAPIBaseUrl)(i.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)(),s=l()("/api/v1/sponsored-projects");s.addQuery("access_token",n),e&&(e=(0,r.escapeFilterValue)(e),s.addQuery("filter[]",`name=@${e}`)),fetch((0,o.buildAPIBaseUrl)(s.toString())).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`code=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/promo-codes?filter=${c}&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d)},8779:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},8213:e=>{e.exports=require("@babel/runtime/helpers/extends")},3838:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},4656:e=>{e.exports=require("i18n-react/dist/i18n-react")},3856:e=>{e.exports=require("idtoken-verifier")},8362:e=>{e.exports=require("moment-timezone")},6689:e=>{e.exports=require("react")},9953:e=>{e.exports=require("react-select/lib/Async")},2691:e=>{e.exports=require("superagent/lib/client")},271:e=>{e.exports=require("sweetalert2")},6530:e=>{e.exports=require("urijs")}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}(()=>{n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t}})(),(()=>{n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}})(),(()=>{n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var r={};return(()=>{n.r(r),n.d(r,{default:()=>u});var e=n(8213),t=n.n(e),a=n(3838),o=n.n(a),s=n(6689),c=n.n(s),i=n(9953),l=n.n(i),d=n(7525);const p=["error","value","onChange","id","multi","summitId"];class u extends c().Component{constructor(e){super(e),this.handleChange=this.handleChange.bind(this),this.getSponsors=this.getSponsors.bind(this)}handleChange(e){let t={target:{id:this.props.id,value:e,type:"sponsorinput"}};this.props.onChange(t)}getSponsors(e,t){let{summitId:n}=this.props;if(!e)return Promise.resolve({options:[]});(0,d.querySponsors)(n,e,t)}render(){let e=this.props,{error:n,value:r,onChange:a,id:s,multi:i,summitId:d}=e,u=o()(e,p),h=this.props.hasOwnProperty("error")&&""!=n,f=this.props.hasOwnProperty("multi");return c().createElement("div",null,c().createElement(l(),t()({value:r,getOptionValue:e=>e.id,getOptionLabel:e=>`${e.company.name} (${e.sponsorship.label})`,onChange:this.handleChange,loadOptions:this.getSponsors,isMulti:f},u)),h&&c().createElement("p",{className:"error-label"},n))}}})(),r})()));
@@ -1,2 +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,(()=>(()=>{"use strict";var e={8213:e=>{e.exports=require("@babel/runtime/helpers/extends")},3838:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},6689:e=>{e.exports=require("react")}},t={};function o(n){var r=t[n];if(void 0!==r)return r.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,o),a.exports}(()=>{o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t}})(),(()=>{o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}})(),(()=>{o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var n={};return(()=>{o.r(n),o.d(n,{default:()=>p});var e=o(8213),t=o.n(e),r=o(3838),a=o.n(r),l=o(6689),s=o.n(l);const u="tDZTa8dy9OMVyGAtxNOS",i="VoBl8JcsRZelj8EKGKtC",c=["value","options","onChange"],p=e=>{let{value:o,options:n,onChange:r}=e,l=a()(e,c);const p=e=>{const t=n.findIndex((e=>e.value===o));t>=0&&(e?t<n.length-1&&r(n[t+1].value):t>0&&r(n[t-1].value))},d=n.find((e=>e.value===o)).label;return s().createElement("div",t()({className:u},l),s().createElement("button",{className:"btn btn-default",onClick:()=>p(!1)},s().createElement("i",{className:"fa fa-minus"})),s().createElement("span",{className:i},d),s().createElement("button",{className:"btn btn-default",onClick:()=>p(!0)},s().createElement("i",{className:"fa fa-plus"})))}})(),n})()));
2
- //# sourceMappingURL=stepped-select.js.map
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,(()=>(()=>{"use strict";var e={8213:e=>{e.exports=require("@babel/runtime/helpers/extends")},3838:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},6689:e=>{e.exports=require("react")}},t={};function o(n){var r=t[n];if(void 0!==r)return r.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,o),a.exports}(()=>{o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t}})(),(()=>{o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}})(),(()=>{o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var n={};return(()=>{o.r(n),o.d(n,{default:()=>p});var e=o(8213),t=o.n(e),r=o(3838),a=o.n(r),l=o(6689),s=o.n(l);const u="tDZTa8dy9OMVyGAtxNOS",i="VoBl8JcsRZelj8EKGKtC",c=["value","options","onChange"],p=e=>{let{value:o,options:n,onChange:r}=e,l=a()(e,c);const p=e=>{const t=n.findIndex((e=>e.value===o));t>=0&&(e?t<n.length-1&&r(n[t+1].value):t>0&&r(n[t-1].value))},d=n.find((e=>e.value===o)).label;return s().createElement("div",t()({className:u},l),s().createElement("button",{className:"btn btn-default",onClick:()=>p(!1)},s().createElement("i",{className:"fa fa-minus"})),s().createElement("span",{className:i},d),s().createElement("button",{className:"btn btn-default",onClick:()=>p(!0)},s().createElement("i",{className:"fa fa-plus"})))}})(),n})()));
@@ -1,2 +1 @@
1
- !function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],o):"object"==typeof exports?exports["openstack-uicore-foundation"]=o():e["openstack-uicore-foundation"]=o()}(this,(()=>(()=>{"use strict";var e={6689:e=>{e.exports=require("react")},1929:e=>{e.exports=require("react-select")}},o={};function t(r){var n=o[r];if(void 0!==n)return n.exports;var a=o[r]={exports:{}};return e[r](a,a.exports,t),a.exports}(()=>{t.n=e=>{var o=e&&e.__esModule?()=>e.default:()=>e;return t.d(o,{a:o}),o}})(),(()=>{t.d=(e,o)=>{for(var r in o)t.o(o,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:o[r]})}})(),(()=>{t.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o)})(),(()=>{t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var r={};return(()=>{t.r(r),t.d(r,{default:()=>u});var e=t(6689),o=t.n(e),n=t(1929),a=t.n(n);const u=({days:e,currentValue:t,placeholder:r,onDayChanged:n})=>{const u=e.find((e=>e.value===t));return o().createElement(a(),{placeholder:r,className:"day-selector",name:"form-field-name",value:u,onChange:e=>{n((null==e?void 0:e.value)||null)},options:e})}})(),r})()));
2
- //# sourceMappingURL=summit-days-select.js.map
1
+ !function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],o):"object"==typeof exports?exports["openstack-uicore-foundation"]=o():e["openstack-uicore-foundation"]=o()}(this,(()=>(()=>{"use strict";var e={6689:e=>{e.exports=require("react")},1929:e=>{e.exports=require("react-select")}},o={};function t(r){var n=o[r];if(void 0!==n)return n.exports;var a=o[r]={exports:{}};return e[r](a,a.exports,t),a.exports}(()=>{t.n=e=>{var o=e&&e.__esModule?()=>e.default:()=>e;return t.d(o,{a:o}),o}})(),(()=>{t.d=(e,o)=>{for(var r in o)t.o(o,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:o[r]})}})(),(()=>{t.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o)})(),(()=>{t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var r={};return(()=>{t.r(r),t.d(r,{default:()=>u});var e=t(6689),o=t.n(e),n=t(1929),a=t.n(n);const u=({days:e,currentValue:t,placeholder:r,onDayChanged:n})=>{const u=e.find((e=>e.value===t));return o().createElement(a(),{placeholder:r,className:"day-selector",name:"form-field-name",value:u,onChange:e=>{n((null==e?void 0:e.value)||null)},options:e})}})(),r})()));
@@ -1,2 +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,(()=>(()=>{"use strict";var e={4341:(e,t,n)=>{n(8779),n(4656),n(4054),n(6793),n(8576)},1593:(e,t,n)=>{n.d(t,{AUTH_ERROR_ACCESS_TOKEN_EXPIRED:()=>o,AUTH_ERROR_LOCK_ACQUIRE_ERROR:()=>s,AUTH_ERROR_MISSING_AUTH_INFO:()=>r,AUTH_ERROR_MISSING_REFRESH_TOKEN:()=>a,AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR:()=>c});const r="AUTH_ERROR_MISSING_AUTH_INFO",a="AUTH_ERROR_MISSING_REFRESH_TOKEN",o="AUTH_ERROR_ACCESS_TOKEN_EXPIRED",s="AUTH_ERROR_LOCK_ACQUIRE_ERROR",c="AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR"},8576:(e,t,n)=>{n.d(t,{getAccessToken:()=>h});var r=n(6793);n(2691);const a=require("browser-tabs-lock");var o=n.n(a);n(6530),n(3856),n(4341);require("crypto-js/sha256"),require("crypto-js/enc-base64url"),require("crypto-js/enc-hex"),"undefined"!=typeof window&&(window.crypto||window.msCrypto);var s=n(1593);const c=new(o()),i="openstackuicore.lock.getTokenSilently",l="code",d="authInfo",u="nonce",p="pkce",h=async()=>{if(await(0,r.retryPromise)((()=>c.acquireLock(i,5e3)),10))try{let e=m();if(!e)throw Error(s.AUTH_ERROR_MISSING_AUTH_INFO);let{accessToken:t,expiresIn:n,accessTokenUpdatedAt:r,refreshToken:a}=e,o=g(),c=Math.floor(Date.now()/1e3);if(n-=20,c-r>n||null==t){if(console.log("getAccessToken access token expired"),o===l&&w()){if(!a)throw _(),Error(s.AUTH_ERROR_MISSING_REFRESH_TOKEN);let e=await f(a),{access_token:t,expires_in:n,refresh_token:r}=e;return void 0===r&&(r=null),R(t,n,r),t}throw _(),Error(s.AUTH_ERROR_ACCESS_TOKEN_EXPIRED)}return t}finally{await c.releaseLock(i)}throw Error(s.AUTH_ERROR_LOCK_ACQUIRE_ERROR)},f=async e=>{let t=y(),n=E();const a={grant_type:"refresh_token",client_id:encodeURI(n),refresh_token:e};try{const e=await fetch(`${t}/oauth2/token`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(a)}).then((e=>{if(400===e.status){(0,r.getCurrentPathName)();throw(0,r.setSessionClearingState)(!0),Error(`${s.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${e.status} - ${e.statusText}`)}return e})).catch((function(e){throw Error(`${s.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${e.message}`)})),n=await e.json();let{access_token:o,refresh_token:c,expires_in:i}=n;return{access_token:o,refresh_token:c,expires_in:i}}catch(e){throw console.log(e),e}},R=(e,t,n=null,a=null)=>{let o=m(),s={accessToken:e,expiresIn:t,accessTokenUpdatedAt:Math.floor(Date.now()/1e3)};null===n&&o&&(n=o.refreshToken),null===a&&o&&(a=o.idToken),n&&(s.refreshToken=n),a&&(s.idToken=a),(0,r.putOnLocalStorage)(d,JSON.stringify(s))},m=()=>{try{let e=(0,r.getFromLocalStorage)(d,!1);return e?JSON.parse(e):null}catch(e){return null}},_=()=>{if("undefined"!=typeof window)return(0,r.removeFromLocalStorage)(d),(0,r.removeFromLocalStorage)(u),void(0,r.removeFromLocalStorage)(p)},E=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,g=()=>"undefined"!=typeof window&&window.OAUTH2_FLOW||"token id_token",w=()=>"undefined"==typeof window||new Boolean(window.OAUTH2_USE_REFRESH_TOKEN||!0),y=()=>"undefined"!=typeof window?window.IDP_BASE_URL:null},4054:(e,t,n)=>{n.d(t,{escapeFilterValue:()=>d,fetchErrorHandler:()=>i,fetchResponseHandler:()=>l});n(3838),n(2691),n(6530);var r=n(271),a=n.n(r),o=n(4656),s=n.n(o);n(6793),n(4341),n(8576);const c=e=>t=>({type:e,payload:t}),i=(c("RESET_LOADING"),c("START_LOADING"),c("STOP_LOADING"),e=>{let t=e.status,n=e.statusText;switch(t){case 403:a().fire("ERROR",s().translate("errors.user_not_authz"),"warning");break;case 401:a().fire("ERROR",s().translate("errors.session_expired"),"error");break;case 412:a().fire("ERROR",n,"warning");case 500:a().fire("ERROR",s().translate("errors.server_error"),"error")}}),l=e=>{if(e.ok)return e.json();throw e},d=e=>e=(e=e.replace(/,/g,"\\,")).replace(/;/g,"\\;")},6793:(e,t,n)=>{n.d(t,{buildAPIBaseUrl:()=>a,getCurrentPathName:()=>r,getFromLocalStorage:()=>s,putOnLocalStorage:()=>o,removeFromLocalStorage:()=>c,retryPromise:()=>l,setSessionClearingState:()=>i});n(8362),n(6530);const r=()=>"undefined"!=typeof window?window.location.pathname:null,a=e=>"undefined"!=typeof window?`${window.API_BASE_URL}${e}`:null``,o=(e,t)=>{"undefined"!=typeof window&&window.localStorage.setItem(e,t)},s=(e,t)=>{if("undefined"!=typeof window){let n=window.localStorage.getItem(e);return t&&(console.log(`getFromLocalStorage removing key ${e}`),c(e)),n}return null},c=e=>{"undefined"!=typeof window&&window.localStorage.removeItem(e)},i=e=>{"undefined"!=typeof window&&(window.clearing_session_state=e)},l=async(e,t=3)=>{for(let n=0;n<t;n++)if(await e())return!0;return!1}},7525:(e,t,n)=>{n.d(t,{querySummits:()=>u});var r=n(4054),a=n(8576),o=n(6793);const s=require("lodash");var c=n.n(s),i=n(6530),l=n.n(i);const d=500,u=(c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`full_name=@${e},first_name=@${e},last_name=@${e},email=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/members?filter=${s}&expand=tickets,rsvp,schedule_summit_events,all_affiliations&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/all?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d));c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c="/api/v1";e&&(c+=`/summits/${e}`),c+=`/speakers?filter=${encodeURIComponent(`full_name=@${t},first_name=@${t},last_name=@${t},email=@${t}`)}&access_token=${s}&expand=member,registration_request`,fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c="/api/v1",i=encodeURIComponent(`tag=@${t}`);c+=e?`/summits/${e}/track-tag-groups/all/allowed-tags?filter=${i}&expand=tag,track_tag_group`:`/tags?filter=${i}`,c+=`&order=tag&page=1&per_page=50&access_token=${s}`,fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((t=>{let r=[...t.data];e&&(r=r.map((e=>e.tag))),n(r)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/tracks?filter=${c}&order=name&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();let c=(t=(0,r.escapeFilterValue)(t))?encodeURIComponent(`filter=name=@${t}`):"";fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/track-groups?order=name&access_token=${s}&${c}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n=!1,s)=>{const c=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let i=`/api/v1/summits/${e}/events`+(n?"/published":""),l=encodeURIComponent(`title=@${t}`);fetch((0,o.buildAPIBaseUrl)(`${i}?filter=${l}&order=title&access_token=${c}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];s(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n,s=null)=>{let c=`/api/v1/summits/${e}/event-types?order=name&access_token=${await(0,a.getAccessToken)()}`;if(t=(0,r.escapeFilterValue)(t)){c+=`&filter[]=${encodeURIComponent(`name=@${t}`)}`}if(s){c+=`&filter[]=${encodeURIComponent(`class_name==${s}`)}`}fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();let s=encodeURIComponent(`title=@${e},code=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/groups?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/companies?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{let s;try{s=await(0,a.getAccessToken)()}catch(e){return void n(e)}let c=l()(`/api/v1/summits/${e}/registration-companies`);c.addQuery("access_token",s),c.addQuery("order","name"),t&&(t=(0,r.escapeFilterValue)(t),c.addQuery("filter[]",`name@@${t}`)),fetch((0,o.buildAPIBaseUrl)(c.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`company_name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/sponsors?filter=${c}&expand=company,sponsorship&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/access-level-types?filter=${c}&&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/organizations?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d);c().debounce((async(e,t={},n,s="v1")=>{const c=await(0,a.getAccessToken)();let i=l()(`/api/${s}/summits/${e}/ticket-types`);if(i.addQuery("access_token",c),i.addQuery("order","name"),t.hasOwnProperty("name")){const e=(0,r.escapeFilterValue)(t.name);i.addQuery("filter[]",`name@@${e}`)}if(t.hasOwnProperty("audience")){const e=(0,r.escapeFilterValue)(t.audience);i.addQuery("filter[]",`audience==${e}`)}fetch((0,o.buildAPIBaseUrl)(i.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)(),s=l()("/api/v1/sponsored-projects");s.addQuery("access_token",n),e&&(e=(0,r.escapeFilterValue)(e),s.addQuery("filter[]",`name=@${e}`)),fetch((0,o.buildAPIBaseUrl)(s.toString())).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`code=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/promo-codes?filter=${c}&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d)},8779:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},8213:e=>{e.exports=require("@babel/runtime/helpers/extends")},3838:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},4656:e=>{e.exports=require("i18n-react/dist/i18n-react")},3856:e=>{e.exports=require("idtoken-verifier")},8362:e=>{e.exports=require("moment-timezone")},6689:e=>{e.exports=require("react")},9953:e=>{e.exports=require("react-select/lib/Async")},2691:e=>{e.exports=require("superagent/lib/client")},271:e=>{e.exports=require("sweetalert2")},6530:e=>{e.exports=require("urijs")}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}(()=>{n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t}})(),(()=>{n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}})(),(()=>{n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var r={};return(()=>{n.r(r),n.d(r,{default:()=>p});var e=n(8213),t=n.n(e),a=n(3838),o=n.n(a),s=n(6689),c=n.n(s),i=n(9953),l=n.n(i),d=n(7525);const u=["value","error","onChange","id","multi"];class p extends c().Component{constructor(e){super(e),this.state={value:e.value},this.handleChange=this.handleChange.bind(this),this.getSummits=this.getSummits.bind(this)}handleChange(e){let t={target:{id:this.props.id,value:e,type:"summitinput"}};this.props.onChange(t)}getSummits(e,t){if(!e)return Promise.resolve({options:[]});(0,d.querySummits)(e,t)}render(){let e=this.props,{value:n,error:r,onChange:a,id:s,multi:i}=e,d=o()(e,u),p=this.props.hasOwnProperty("multi"),h=this.props.hasOwnProperty("error")&&""!=r;return c().createElement("div",null,c().createElement(l(),t()({value:n,onChange:this.handleChange,loadOptions:this.getSummits,getOptionValue:e=>e.id,getOptionLabel:e=>`${e.name} (${e.id})`,isMulti:p},d)),h&&c().createElement("p",{className:"error-label"},r))}}})(),r})()));
2
- //# sourceMappingURL=summit-input.js.map
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,(()=>(()=>{"use strict";var e={4341:(e,t,n)=>{n(8779),n(4656),n(4054),n(6793),n(8576)},1593:(e,t,n)=>{n.d(t,{AUTH_ERROR_ACCESS_TOKEN_EXPIRED:()=>o,AUTH_ERROR_LOCK_ACQUIRE_ERROR:()=>s,AUTH_ERROR_MISSING_AUTH_INFO:()=>r,AUTH_ERROR_MISSING_REFRESH_TOKEN:()=>a,AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR:()=>c});const r="AUTH_ERROR_MISSING_AUTH_INFO",a="AUTH_ERROR_MISSING_REFRESH_TOKEN",o="AUTH_ERROR_ACCESS_TOKEN_EXPIRED",s="AUTH_ERROR_LOCK_ACQUIRE_ERROR",c="AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR"},8576:(e,t,n)=>{n.d(t,{getAccessToken:()=>h});var r=n(6793);n(2691);const a=require("browser-tabs-lock");var o=n.n(a);n(6530),n(3856),n(4341);require("crypto-js/sha256"),require("crypto-js/enc-base64url"),require("crypto-js/enc-hex"),"undefined"!=typeof window&&(window.crypto||window.msCrypto);var s=n(1593);const c=new(o()),i="openstackuicore.lock.getTokenSilently",l="code",d="authInfo",u="nonce",p="pkce",h=async()=>{if(await(0,r.retryPromise)((()=>c.acquireLock(i,5e3)),10))try{let e=m();if(!e)throw Error(s.AUTH_ERROR_MISSING_AUTH_INFO);let{accessToken:t,expiresIn:n,accessTokenUpdatedAt:r,refreshToken:a}=e,o=g(),c=Math.floor(Date.now()/1e3);if(n-=20,c-r>n||null==t){if(console.log("getAccessToken access token expired"),o===l&&w()){if(!a)throw _(),Error(s.AUTH_ERROR_MISSING_REFRESH_TOKEN);let e=await f(a),{access_token:t,expires_in:n,refresh_token:r}=e;return void 0===r&&(r=null),R(t,n,r),t}throw _(),Error(s.AUTH_ERROR_ACCESS_TOKEN_EXPIRED)}return t}finally{await c.releaseLock(i)}throw Error(s.AUTH_ERROR_LOCK_ACQUIRE_ERROR)},f=async e=>{let t=y(),n=E();const a={grant_type:"refresh_token",client_id:encodeURI(n),refresh_token:e};try{const e=await fetch(`${t}/oauth2/token`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(a)}).then((e=>{if(400===e.status){(0,r.getCurrentPathName)();throw(0,r.setSessionClearingState)(!0),Error(`${s.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${e.status} - ${e.statusText}`)}return e})).catch((function(e){throw Error(`${s.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${e.message}`)})),n=await e.json();let{access_token:o,refresh_token:c,expires_in:i}=n;return{access_token:o,refresh_token:c,expires_in:i}}catch(e){throw console.log(e),e}},R=(e,t,n=null,a=null)=>{let o=m(),s={accessToken:e,expiresIn:t,accessTokenUpdatedAt:Math.floor(Date.now()/1e3)};null===n&&o&&(n=o.refreshToken),null===a&&o&&(a=o.idToken),n&&(s.refreshToken=n),a&&(s.idToken=a),(0,r.putOnLocalStorage)(d,JSON.stringify(s))},m=()=>{try{let e=(0,r.getFromLocalStorage)(d,!1);return e?JSON.parse(e):null}catch(e){return null}},_=()=>{if("undefined"!=typeof window)return(0,r.removeFromLocalStorage)(d),(0,r.removeFromLocalStorage)(u),void(0,r.removeFromLocalStorage)(p)},E=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,g=()=>"undefined"!=typeof window&&window.OAUTH2_FLOW||"token id_token",w=()=>"undefined"==typeof window||new Boolean(window.OAUTH2_USE_REFRESH_TOKEN||!0),y=()=>"undefined"!=typeof window?window.IDP_BASE_URL:null},4054:(e,t,n)=>{n.d(t,{escapeFilterValue:()=>d,fetchErrorHandler:()=>i,fetchResponseHandler:()=>l});n(3838),n(2691),n(6530);var r=n(271),a=n.n(r),o=n(4656),s=n.n(o);n(6793),n(4341),n(8576);const c=e=>t=>({type:e,payload:t}),i=(c("RESET_LOADING"),c("START_LOADING"),c("STOP_LOADING"),e=>{let t=e.status,n=e.statusText;switch(t){case 403:a().fire("ERROR",s().translate("errors.user_not_authz"),"warning");break;case 401:a().fire("ERROR",s().translate("errors.session_expired"),"error");break;case 412:a().fire("ERROR",n,"warning");case 500:a().fire("ERROR",s().translate("errors.server_error"),"error")}}),l=e=>{if(e.ok)return e.json();throw e},d=e=>e=(e=e.replace(/,/g,"\\,")).replace(/;/g,"\\;")},6793:(e,t,n)=>{n.d(t,{buildAPIBaseUrl:()=>a,getCurrentPathName:()=>r,getFromLocalStorage:()=>s,putOnLocalStorage:()=>o,removeFromLocalStorage:()=>c,retryPromise:()=>l,setSessionClearingState:()=>i});n(8362),n(6530);const r=()=>"undefined"!=typeof window?window.location.pathname:null,a=e=>"undefined"!=typeof window?`${window.API_BASE_URL}${e}`:null``,o=(e,t)=>{"undefined"!=typeof window&&window.localStorage.setItem(e,t)},s=(e,t)=>{if("undefined"!=typeof window){let n=window.localStorage.getItem(e);return t&&(console.log(`getFromLocalStorage removing key ${e}`),c(e)),n}return null},c=e=>{"undefined"!=typeof window&&window.localStorage.removeItem(e)},i=e=>{"undefined"!=typeof window&&(window.clearing_session_state=e)},l=async(e,t=3)=>{for(let n=0;n<t;n++)if(await e())return!0;return!1}},7525:(e,t,n)=>{n.d(t,{querySummits:()=>u});var r=n(4054),a=n(8576),o=n(6793);const s=require("lodash");var c=n.n(s),i=n(6530),l=n.n(i);const d=500,u=(c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`full_name=@${e},first_name=@${e},last_name=@${e},email=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/members?filter=${s}&expand=tickets,rsvp,schedule_summit_events,all_affiliations&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/all?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d));c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c="/api/v1";e&&(c+=`/summits/${e}`),c+=`/speakers?filter=${encodeURIComponent(`full_name=@${t},first_name=@${t},last_name=@${t},email=@${t}`)}&access_token=${s}&expand=member,registration_request`,fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c="/api/v1",i=encodeURIComponent(`tag=@${t}`);c+=e?`/summits/${e}/track-tag-groups/all/allowed-tags?filter=${i}&expand=tag,track_tag_group`:`/tags?filter=${i}`,c+=`&order=tag&page=1&per_page=50&access_token=${s}`,fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((t=>{let r=[...t.data];e&&(r=r.map((e=>e.tag))),n(r)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/tracks?filter=${c}&order=name&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();let c=(t=(0,r.escapeFilterValue)(t))?encodeURIComponent(`filter=name=@${t}`):"";fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/track-groups?order=name&access_token=${s}&${c}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n=!1,s)=>{const c=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let i=`/api/v1/summits/${e}/events`+(n?"/published":""),l=encodeURIComponent(`title=@${t}`);fetch((0,o.buildAPIBaseUrl)(`${i}?filter=${l}&order=title&access_token=${c}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];s(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n,s=null)=>{let c=`/api/v1/summits/${e}/event-types?order=name&access_token=${await(0,a.getAccessToken)()}`;if(t=(0,r.escapeFilterValue)(t)){c+=`&filter[]=${encodeURIComponent(`name=@${t}`)}`}if(s){c+=`&filter[]=${encodeURIComponent(`class_name==${s}`)}`}fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();let s=encodeURIComponent(`title=@${e},code=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/groups?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/companies?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{let s;try{s=await(0,a.getAccessToken)()}catch(e){return void n(e)}let c=l()(`/api/v1/summits/${e}/registration-companies`);c.addQuery("access_token",s),c.addQuery("order","name"),t&&(t=(0,r.escapeFilterValue)(t),c.addQuery("filter[]",`name@@${t}`)),fetch((0,o.buildAPIBaseUrl)(c.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`company_name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/sponsors?filter=${c}&expand=company,sponsorship&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/access-level-types?filter=${c}&&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/organizations?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d);c().debounce((async(e,t={},n,s="v1")=>{const c=await(0,a.getAccessToken)();let i=l()(`/api/${s}/summits/${e}/ticket-types`);if(i.addQuery("access_token",c),i.addQuery("order","name"),t.hasOwnProperty("name")){const e=(0,r.escapeFilterValue)(t.name);i.addQuery("filter[]",`name@@${e}`)}if(t.hasOwnProperty("audience")){const e=(0,r.escapeFilterValue)(t.audience);i.addQuery("filter[]",`audience==${e}`)}fetch((0,o.buildAPIBaseUrl)(i.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)(),s=l()("/api/v1/sponsored-projects");s.addQuery("access_token",n),e&&(e=(0,r.escapeFilterValue)(e),s.addQuery("filter[]",`name=@${e}`)),fetch((0,o.buildAPIBaseUrl)(s.toString())).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`code=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/promo-codes?filter=${c}&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d)},8779:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},8213:e=>{e.exports=require("@babel/runtime/helpers/extends")},3838:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},4656:e=>{e.exports=require("i18n-react/dist/i18n-react")},3856:e=>{e.exports=require("idtoken-verifier")},8362:e=>{e.exports=require("moment-timezone")},6689:e=>{e.exports=require("react")},9953:e=>{e.exports=require("react-select/lib/Async")},2691:e=>{e.exports=require("superagent/lib/client")},271:e=>{e.exports=require("sweetalert2")},6530:e=>{e.exports=require("urijs")}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}(()=>{n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t}})(),(()=>{n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}})(),(()=>{n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var r={};return(()=>{n.r(r),n.d(r,{default:()=>p});var e=n(8213),t=n.n(e),a=n(3838),o=n.n(a),s=n(6689),c=n.n(s),i=n(9953),l=n.n(i),d=n(7525);const u=["value","error","onChange","id","multi"];class p extends c().Component{constructor(e){super(e),this.state={value:e.value},this.handleChange=this.handleChange.bind(this),this.getSummits=this.getSummits.bind(this)}handleChange(e){let t={target:{id:this.props.id,value:e,type:"summitinput"}};this.props.onChange(t)}getSummits(e,t){if(!e)return Promise.resolve({options:[]});(0,d.querySummits)(e,t)}render(){let e=this.props,{value:n,error:r,onChange:a,id:s,multi:i}=e,d=o()(e,u),p=this.props.hasOwnProperty("multi"),h=this.props.hasOwnProperty("error")&&""!=r;return c().createElement("div",null,c().createElement(l(),t()({value:n,onChange:this.handleChange,loadOptions:this.getSummits,getOptionValue:e=>e.id,getOptionLabel:e=>`${e.name} (${e.id})`,isMulti:p},d)),h&&c().createElement("p",{className:"error-label"},r))}}})(),r})()));
@@ -1,2 +1 @@
1
- !function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],o):"object"==typeof exports?exports["openstack-uicore-foundation"]=o():e["openstack-uicore-foundation"]=o()}(this,(()=>(()=>{"use strict";var e={6689:e=>{e.exports=require("react")},1929:e=>{e.exports=require("react-select")}},o={};function t(n){var r=o[n];if(void 0!==r)return r.exports;var a=o[n]={exports:{}};return e[n](a,a.exports,t),a.exports}(()=>{t.n=e=>{var o=e&&e.__esModule?()=>e.default:()=>e;return t.d(o,{a:o}),o}})(),(()=>{t.d=(e,o)=>{for(var n in o)t.o(o,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:o[n]})}})(),(()=>{t.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o)})(),(()=>{t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var n={};return(()=>{t.r(n),t.d(n,{default:()=>l});var e=t(6689),o=t.n(e),r=t(1929),a=t.n(r);const l=({venues:e,currentValue:t,placeholder:n,onVenueChanged:r})=>{const l=e.find((e=>e.value.id===(null==t?void 0:t.id)))||null;return o().createElement(a(),{placeholder:n,className:"venues-selector",name:"form-field-name",value:l,onChange:e=>{r((null==e?void 0:e.value)||null)},options:e,optionRenderer:e=>{let t=e.value;return"SummitVenue"===t.class_name?o().createElement("span",{className:"location-option-venue"},t.name):o().createElement("span",{className:"location-option-room"},"- ",t.name)}})}})(),n})()));
2
- //# sourceMappingURL=summit-venues-select.js.map
1
+ !function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],o):"object"==typeof exports?exports["openstack-uicore-foundation"]=o():e["openstack-uicore-foundation"]=o()}(this,(()=>(()=>{"use strict";var e={6689:e=>{e.exports=require("react")},1929:e=>{e.exports=require("react-select")}},o={};function t(n){var r=o[n];if(void 0!==r)return r.exports;var a=o[n]={exports:{}};return e[n](a,a.exports,t),a.exports}(()=>{t.n=e=>{var o=e&&e.__esModule?()=>e.default:()=>e;return t.d(o,{a:o}),o}})(),(()=>{t.d=(e,o)=>{for(var n in o)t.o(o,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:o[n]})}})(),(()=>{t.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o)})(),(()=>{t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var n={};return(()=>{t.r(n),t.d(n,{default:()=>l});var e=t(6689),o=t.n(e),r=t(1929),a=t.n(r);const l=({venues:e,currentValue:t,placeholder:n,onVenueChanged:r})=>{const l=e.find((e=>e.value.id===(null==t?void 0:t.id)))||null;return o().createElement(a(),{placeholder:n,className:"venues-selector",name:"form-field-name",value:l,onChange:e=>{r((null==e?void 0:e.value)||null)},options:e,optionRenderer:e=>{let t=e.value;return"SummitVenue"===t.class_name?o().createElement("span",{className:"location-option-venue"},t.name):o().createElement("span",{className:"location-option-room"},"- ",t.name)}})}})(),n})()));
@@ -1,2 +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,(()=>(()=>{"use strict";var e={4341:(e,t,r)=>{r(8779),r(4656),r(4054),r(6793),r(8576)},1593:(e,t,r)=>{r.d(t,{AUTH_ERROR_ACCESS_TOKEN_EXPIRED:()=>o,AUTH_ERROR_LOCK_ACQUIRE_ERROR:()=>s,AUTH_ERROR_MISSING_AUTH_INFO:()=>a,AUTH_ERROR_MISSING_REFRESH_TOKEN:()=>n,AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR:()=>c});const a="AUTH_ERROR_MISSING_AUTH_INFO",n="AUTH_ERROR_MISSING_REFRESH_TOKEN",o="AUTH_ERROR_ACCESS_TOKEN_EXPIRED",s="AUTH_ERROR_LOCK_ACQUIRE_ERROR",c="AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR"},8576:(e,t,r)=>{r.d(t,{getAccessToken:()=>h});var a=r(6793);r(2691);const n=require("browser-tabs-lock");var o=r.n(n);r(6530),r(3856),r(4341);require("crypto-js/sha256"),require("crypto-js/enc-base64url"),require("crypto-js/enc-hex"),"undefined"!=typeof window&&(window.crypto||window.msCrypto);var s=r(1593);const c=new(o()),l="openstackuicore.lock.getTokenSilently",i="code",d="authInfo",u="nonce",p="pkce",h=async()=>{if(await(0,a.retryPromise)((()=>c.acquireLock(l,5e3)),10))try{let e=_();if(!e)throw Error(s.AUTH_ERROR_MISSING_AUTH_INFO);let{accessToken:t,expiresIn:r,accessTokenUpdatedAt:a,refreshToken:n}=e,o=w(),c=Math.floor(Date.now()/1e3);if(r-=20,c-a>r||null==t){if(console.log("getAccessToken access token expired"),o===i&&E()){if(!n)throw m(),Error(s.AUTH_ERROR_MISSING_REFRESH_TOKEN);let e=await f(n),{access_token:t,expires_in:r,refresh_token:a}=e;return void 0===a&&(a=null),R(t,r,a),t}throw m(),Error(s.AUTH_ERROR_ACCESS_TOKEN_EXPIRED)}return t}finally{await c.releaseLock(l)}throw Error(s.AUTH_ERROR_LOCK_ACQUIRE_ERROR)},f=async e=>{let t=y(),r=g();const n={grant_type:"refresh_token",client_id:encodeURI(r),refresh_token:e};try{const e=await fetch(`${t}/oauth2/token`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(n)}).then((e=>{if(400===e.status){(0,a.getCurrentPathName)();throw(0,a.setSessionClearingState)(!0),Error(`${s.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${e.status} - ${e.statusText}`)}return e})).catch((function(e){throw Error(`${s.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${e.message}`)})),r=await e.json();let{access_token:o,refresh_token:c,expires_in:l}=r;return{access_token:o,refresh_token:c,expires_in:l}}catch(e){throw console.log(e),e}},R=(e,t,r=null,n=null)=>{let o=_(),s={accessToken:e,expiresIn:t,accessTokenUpdatedAt:Math.floor(Date.now()/1e3)};null===r&&o&&(r=o.refreshToken),null===n&&o&&(n=o.idToken),r&&(s.refreshToken=r),n&&(s.idToken=n),(0,a.putOnLocalStorage)(d,JSON.stringify(s))},_=()=>{try{let e=(0,a.getFromLocalStorage)(d,!1);return e?JSON.parse(e):null}catch(e){return null}},m=()=>{if("undefined"!=typeof window)return(0,a.removeFromLocalStorage)(d),(0,a.removeFromLocalStorage)(u),void(0,a.removeFromLocalStorage)(p)},g=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,w=()=>"undefined"!=typeof window&&window.OAUTH2_FLOW||"token id_token",E=()=>"undefined"==typeof window||new Boolean(window.OAUTH2_USE_REFRESH_TOKEN||!0),y=()=>"undefined"!=typeof window?window.IDP_BASE_URL:null},4054:(e,t,r)=>{r.d(t,{escapeFilterValue:()=>d,fetchErrorHandler:()=>l,fetchResponseHandler:()=>i});r(3838),r(2691),r(6530);var a=r(271),n=r.n(a),o=r(4656),s=r.n(o);r(6793),r(4341),r(8576);const c=e=>t=>({type:e,payload:t}),l=(c("RESET_LOADING"),c("START_LOADING"),c("STOP_LOADING"),e=>{let t=e.status,r=e.statusText;switch(t){case 403:n().fire("ERROR",s().translate("errors.user_not_authz"),"warning");break;case 401:n().fire("ERROR",s().translate("errors.session_expired"),"error");break;case 412:n().fire("ERROR",r,"warning");case 500:n().fire("ERROR",s().translate("errors.server_error"),"error")}}),i=e=>{if(e.ok)return e.json();throw e},d=e=>e=(e=e.replace(/,/g,"\\,")).replace(/;/g,"\\;")},6793:(e,t,r)=>{r.d(t,{buildAPIBaseUrl:()=>n,getCurrentPathName:()=>a,getFromLocalStorage:()=>s,putOnLocalStorage:()=>o,removeFromLocalStorage:()=>c,retryPromise:()=>d,setSessionClearingState:()=>l,shallowEqual:()=>i});r(8362),r(6530);const a=()=>"undefined"!=typeof window?window.location.pathname:null,n=e=>"undefined"!=typeof window?`${window.API_BASE_URL}${e}`:null``,o=(e,t)=>{"undefined"!=typeof window&&window.localStorage.setItem(e,t)},s=(e,t)=>{if("undefined"!=typeof window){let r=window.localStorage.getItem(e);return t&&(console.log(`getFromLocalStorage removing key ${e}`),c(e)),r}return null},c=e=>{"undefined"!=typeof window&&window.localStorage.removeItem(e)},l=e=>{"undefined"!=typeof window&&(window.clearing_session_state=e)},i=(e,t)=>{const r=Object.keys(e),a=Object.keys(t);if(r.length!==a.length)return!1;for(let a of r)if(e[a]!==t[a])return!1;return!0},d=async(e,t=3)=>{for(let r=0;r<t;r++)if(await e())return!0;return!1}},7525:(e,t,r)=>{r.d(t,{queryTags:()=>u});var a=r(4054),n=r(8576),o=r(6793);const s=require("lodash");var c=r.n(s),l=r(6530),i=r.n(l);const d=500,u=(c().debounce((async(e,t)=>{const r=await(0,n.getAccessToken)();e=(0,a.escapeFilterValue)(e);let s=encodeURIComponent(`full_name=@${e},first_name=@${e},last_name=@${e},email=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/members?filter=${s}&expand=tickets,rsvp,schedule_summit_events,all_affiliations&access_token=${r}`)).then(a.fetchResponseHandler).then((e=>{let r=[...e.data];t(r)})).catch(a.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const r=await(0,n.getAccessToken)();e=(0,a.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/all?filter=${s}&access_token=${r}`)).then(a.fetchResponseHandler).then((e=>{let r=[...e.data];t(r)})).catch(a.fetchErrorHandler)}),d),c().debounce((async(e,t,r)=>{const s=await(0,n.getAccessToken)();t=(0,a.escapeFilterValue)(t);let c="/api/v1";e&&(c+=`/summits/${e}`),c+=`/speakers?filter=${encodeURIComponent(`full_name=@${t},first_name=@${t},last_name=@${t},email=@${t}`)}&access_token=${s}&expand=member,registration_request`,fetch((0,o.buildAPIBaseUrl)(c)).then(a.fetchResponseHandler).then((e=>{let t=[...e.data];r(t)})).catch(a.fetchErrorHandler)}),d),c().debounce((async(e,t,r)=>{const s=await(0,n.getAccessToken)();t=(0,a.escapeFilterValue)(t);let c="/api/v1",l=encodeURIComponent(`tag=@${t}`);c+=e?`/summits/${e}/track-tag-groups/all/allowed-tags?filter=${l}&expand=tag,track_tag_group`:`/tags?filter=${l}`,c+=`&order=tag&page=1&per_page=50&access_token=${s}`,fetch((0,o.buildAPIBaseUrl)(c)).then(a.fetchResponseHandler).then((t=>{let a=[...t.data];e&&(a=a.map((e=>e.tag))),r(a)})).catch(a.fetchErrorHandler)}),d));c().debounce((async(e,t,r)=>{const s=await(0,n.getAccessToken)();t=(0,a.escapeFilterValue)(t);let c=encodeURIComponent(`name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/tracks?filter=${c}&order=name&access_token=${s}`)).then(a.fetchResponseHandler).then((e=>{let t=[...e.data];r(t)})).catch(a.fetchErrorHandler)}),d),c().debounce((async(e,t,r)=>{const s=await(0,n.getAccessToken)();let c=(t=(0,a.escapeFilterValue)(t))?encodeURIComponent(`filter=name=@${t}`):"";fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/track-groups?order=name&access_token=${s}&${c}`)).then(a.fetchResponseHandler).then((e=>{let t=[...e.data];r(t)})).catch(a.fetchErrorHandler)}),d),c().debounce((async(e,t,r=!1,s)=>{const c=await(0,n.getAccessToken)();t=(0,a.escapeFilterValue)(t);let l=`/api/v1/summits/${e}/events`+(r?"/published":""),i=encodeURIComponent(`title=@${t}`);fetch((0,o.buildAPIBaseUrl)(`${l}?filter=${i}&order=title&access_token=${c}`)).then(a.fetchResponseHandler).then((e=>{let t=[...e.data];s(t)})).catch(a.fetchErrorHandler)}),d),c().debounce((async(e,t,r,s=null)=>{let c=`/api/v1/summits/${e}/event-types?order=name&access_token=${await(0,n.getAccessToken)()}`;if(t=(0,a.escapeFilterValue)(t)){c+=`&filter[]=${encodeURIComponent(`name=@${t}`)}`}if(s){c+=`&filter[]=${encodeURIComponent(`class_name==${s}`)}`}fetch((0,o.buildAPIBaseUrl)(c)).then(a.fetchResponseHandler).then((e=>{let t=[...e.data];r(t)})).catch(a.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const r=await(0,n.getAccessToken)();let s=encodeURIComponent(`title=@${e},code=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/groups?filter=${s}&access_token=${r}`)).then(a.fetchResponseHandler).then((e=>{let r=[...e.data];t(r)})).catch(a.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const r=await(0,n.getAccessToken)();e=(0,a.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/companies?filter=${s}&access_token=${r}`)).then(a.fetchResponseHandler).then((e=>{let r=[...e.data];t(r)})).catch(a.fetchErrorHandler)}),d),c().debounce((async(e,t,r)=>{let s;try{s=await(0,n.getAccessToken)()}catch(e){return void r(e)}let c=i()(`/api/v1/summits/${e}/registration-companies`);c.addQuery("access_token",s),c.addQuery("order","name"),t&&(t=(0,a.escapeFilterValue)(t),c.addQuery("filter[]",`name@@${t}`)),fetch((0,o.buildAPIBaseUrl)(c.toString())).then(a.fetchResponseHandler).then((e=>{let t=[...e.data];r(t)})).catch(a.fetchErrorHandler)}),d),c().debounce((async(e,t,r)=>{const s=await(0,n.getAccessToken)();t=(0,a.escapeFilterValue)(t);let c=encodeURIComponent(`company_name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/sponsors?filter=${c}&expand=company,sponsorship&access_token=${s}`)).then(a.fetchResponseHandler).then((e=>{let t=[...e.data];r(t)})).catch(a.fetchErrorHandler)}),d),c().debounce((async(e,t,r)=>{const s=await(0,n.getAccessToken)();t=(0,a.escapeFilterValue)(t);let c=encodeURIComponent(`name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/access-level-types?filter=${c}&&access_token=${s}`)).then(a.fetchResponseHandler).then((e=>{let t=[...e.data];r(t)})).catch(a.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const r=await(0,n.getAccessToken)();e=(0,a.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/organizations?filter=${s}&access_token=${r}`)).then(a.fetchResponseHandler).then((e=>{let r=[...e.data];t(r)})).catch(a.fetchErrorHandler)}),d);c().debounce((async(e,t={},r,s="v1")=>{const c=await(0,n.getAccessToken)();let l=i()(`/api/${s}/summits/${e}/ticket-types`);if(l.addQuery("access_token",c),l.addQuery("order","name"),t.hasOwnProperty("name")){const e=(0,a.escapeFilterValue)(t.name);l.addQuery("filter[]",`name@@${e}`)}if(t.hasOwnProperty("audience")){const e=(0,a.escapeFilterValue)(t.audience);l.addQuery("filter[]",`audience==${e}`)}fetch((0,o.buildAPIBaseUrl)(l.toString())).then(a.fetchResponseHandler).then((e=>{let t=[...e.data];r(t)})).catch(a.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const r=await(0,n.getAccessToken)(),s=i()("/api/v1/sponsored-projects");s.addQuery("access_token",r),e&&(e=(0,a.escapeFilterValue)(e),s.addQuery("filter[]",`name=@${e}`)),fetch((0,o.buildAPIBaseUrl)(s.toString())).then(a.fetchResponseHandler).then((e=>{let r=[...e.data];t(r)})).catch(a.fetchErrorHandler)}),d),c().debounce((async(e,t,r)=>{const s=await(0,n.getAccessToken)();t=(0,a.escapeFilterValue)(t);let c=encodeURIComponent(`code=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/promo-codes?filter=${c}&access_token=${s}`)).then(a.fetchResponseHandler).then((e=>{let t=[...e.data];r(t)})).catch(a.fetchErrorHandler)}),d)},8779:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},8213:e=>{e.exports=require("@babel/runtime/helpers/extends")},3838:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},4656:e=>{e.exports=require("i18n-react/dist/i18n-react")},3856:e=>{e.exports=require("idtoken-verifier")},8362:e=>{e.exports=require("moment-timezone")},580:e=>{e.exports=require("prop-types")},6689:e=>{e.exports=require("react")},9953:e=>{e.exports=require("react-select/lib/Async")},9503:e=>{e.exports=require("react-select/lib/AsyncCreatable")},2691:e=>{e.exports=require("superagent/lib/client")},271:e=>{e.exports=require("sweetalert2")},6530:e=>{e.exports=require("urijs")}},t={};function r(a){var n=t[a];if(void 0!==n)return n.exports;var o=t[a]={exports:{}};return e[a](o,o.exports,r),o.exports}(()=>{r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t}})(),(()=>{r.d=(e,t)=>{for(var a in t)r.o(t,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})}})(),(()=>{r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var a={};return(()=>{r.r(a),r.d(a,{default:()=>m});var e=r(8213),t=r.n(e),n=r(3838),o=r.n(n),s=r(6689),c=r.n(s),l=r(580),i=r.n(l),d=r(9953),u=r.n(d),p=r(9503),h=r.n(p),f=r(7525),R=r(6793);const _=["className","error","allowCreate"];class m extends c().Component{constructor(e){super(e),this.state={tagValue:e.value.map((e=>({tag:e.tag,id:e.id})))},this.handleChange=this.handleChange.bind(this),this.handleNew=this.handleNew.bind(this),this.getTags=this.getTags.bind(this)}componentDidUpdate(e,t,r){if(!(0,R.shallowEqual)(this.props.value,e.value)){let e=this.props.value.map((e=>({tag:e.tag,id:e.id})));this.setState({tagValue:e})}}handleNew(e){const t={tag:e};this.props.onCreate(e,this.setState({value:[...this.state.tagValue,t]}))}handleChange(e){let t={target:{id:this.props.id,value:e,type:"taginput"}};this.props.onChange(t)}getTags(e,t){if(!e)return Promise.resolve({options:[]});let r=this.props.hasOwnProperty("summitId")?this.props.summitId:null;(0,f.queryTags)(r,e,t)}render(){let e=this.props,{className:r,error:a,allowCreate:n}=e,s=o()(e,_),{tagValue:l}=this.state,i=this.props.hasOwnProperty("error")&&""!=a,d=l.sort(((e,t)=>e.tag.toLowerCase()>t.tag.toLowerCase()?1:e.tag.toLowerCase()<t.tag.toLowerCase()?-1:0));const p=n?h():u();return c().createElement("div",null,c().createElement(p,t()({},s,{className:r+" "+(i?"error":""),isMulti:!0,value:d,onChange:this.handleChange,onCreateOption:this.handleNew,loadOptions:this.getTags,getOptionLabel:e=>e.__isNew__?e.label:e.tag,getOptionValue:e=>e.__isNew__?e.value:e.tag})),i&&c().createElement("p",{className:"error-label"},a))}}m.propTypes={allowCreate:i().bool,className:i().string,summitId:i().number,id:i().string.isRequired,value:i().array,onCreate:i().func,onChange:i().func.isRequired},m.defaultProps={allowCreate:!1}})(),a})()));
2
- //# sourceMappingURL=tag-input.js.map
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,(()=>(()=>{"use strict";var e={4341:(e,t,r)=>{r(8779),r(4656),r(4054),r(6793),r(8576)},1593:(e,t,r)=>{r.d(t,{AUTH_ERROR_ACCESS_TOKEN_EXPIRED:()=>o,AUTH_ERROR_LOCK_ACQUIRE_ERROR:()=>s,AUTH_ERROR_MISSING_AUTH_INFO:()=>a,AUTH_ERROR_MISSING_REFRESH_TOKEN:()=>n,AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR:()=>c});const a="AUTH_ERROR_MISSING_AUTH_INFO",n="AUTH_ERROR_MISSING_REFRESH_TOKEN",o="AUTH_ERROR_ACCESS_TOKEN_EXPIRED",s="AUTH_ERROR_LOCK_ACQUIRE_ERROR",c="AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR"},8576:(e,t,r)=>{r.d(t,{getAccessToken:()=>h});var a=r(6793);r(2691);const n=require("browser-tabs-lock");var o=r.n(n);r(6530),r(3856),r(4341);require("crypto-js/sha256"),require("crypto-js/enc-base64url"),require("crypto-js/enc-hex"),"undefined"!=typeof window&&(window.crypto||window.msCrypto);var s=r(1593);const c=new(o()),l="openstackuicore.lock.getTokenSilently",i="code",d="authInfo",u="nonce",p="pkce",h=async()=>{if(await(0,a.retryPromise)((()=>c.acquireLock(l,5e3)),10))try{let e=_();if(!e)throw Error(s.AUTH_ERROR_MISSING_AUTH_INFO);let{accessToken:t,expiresIn:r,accessTokenUpdatedAt:a,refreshToken:n}=e,o=w(),c=Math.floor(Date.now()/1e3);if(r-=20,c-a>r||null==t){if(console.log("getAccessToken access token expired"),o===i&&E()){if(!n)throw m(),Error(s.AUTH_ERROR_MISSING_REFRESH_TOKEN);let e=await f(n),{access_token:t,expires_in:r,refresh_token:a}=e;return void 0===a&&(a=null),R(t,r,a),t}throw m(),Error(s.AUTH_ERROR_ACCESS_TOKEN_EXPIRED)}return t}finally{await c.releaseLock(l)}throw Error(s.AUTH_ERROR_LOCK_ACQUIRE_ERROR)},f=async e=>{let t=y(),r=g();const n={grant_type:"refresh_token",client_id:encodeURI(r),refresh_token:e};try{const e=await fetch(`${t}/oauth2/token`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(n)}).then((e=>{if(400===e.status){(0,a.getCurrentPathName)();throw(0,a.setSessionClearingState)(!0),Error(`${s.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${e.status} - ${e.statusText}`)}return e})).catch((function(e){throw Error(`${s.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${e.message}`)})),r=await e.json();let{access_token:o,refresh_token:c,expires_in:l}=r;return{access_token:o,refresh_token:c,expires_in:l}}catch(e){throw console.log(e),e}},R=(e,t,r=null,n=null)=>{let o=_(),s={accessToken:e,expiresIn:t,accessTokenUpdatedAt:Math.floor(Date.now()/1e3)};null===r&&o&&(r=o.refreshToken),null===n&&o&&(n=o.idToken),r&&(s.refreshToken=r),n&&(s.idToken=n),(0,a.putOnLocalStorage)(d,JSON.stringify(s))},_=()=>{try{let e=(0,a.getFromLocalStorage)(d,!1);return e?JSON.parse(e):null}catch(e){return null}},m=()=>{if("undefined"!=typeof window)return(0,a.removeFromLocalStorage)(d),(0,a.removeFromLocalStorage)(u),void(0,a.removeFromLocalStorage)(p)},g=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,w=()=>"undefined"!=typeof window&&window.OAUTH2_FLOW||"token id_token",E=()=>"undefined"==typeof window||new Boolean(window.OAUTH2_USE_REFRESH_TOKEN||!0),y=()=>"undefined"!=typeof window?window.IDP_BASE_URL:null},4054:(e,t,r)=>{r.d(t,{escapeFilterValue:()=>d,fetchErrorHandler:()=>l,fetchResponseHandler:()=>i});r(3838),r(2691),r(6530);var a=r(271),n=r.n(a),o=r(4656),s=r.n(o);r(6793),r(4341),r(8576);const c=e=>t=>({type:e,payload:t}),l=(c("RESET_LOADING"),c("START_LOADING"),c("STOP_LOADING"),e=>{let t=e.status,r=e.statusText;switch(t){case 403:n().fire("ERROR",s().translate("errors.user_not_authz"),"warning");break;case 401:n().fire("ERROR",s().translate("errors.session_expired"),"error");break;case 412:n().fire("ERROR",r,"warning");case 500:n().fire("ERROR",s().translate("errors.server_error"),"error")}}),i=e=>{if(e.ok)return e.json();throw e},d=e=>e=(e=e.replace(/,/g,"\\,")).replace(/;/g,"\\;")},6793:(e,t,r)=>{r.d(t,{buildAPIBaseUrl:()=>n,getCurrentPathName:()=>a,getFromLocalStorage:()=>s,putOnLocalStorage:()=>o,removeFromLocalStorage:()=>c,retryPromise:()=>d,setSessionClearingState:()=>l,shallowEqual:()=>i});r(8362),r(6530);const a=()=>"undefined"!=typeof window?window.location.pathname:null,n=e=>"undefined"!=typeof window?`${window.API_BASE_URL}${e}`:null``,o=(e,t)=>{"undefined"!=typeof window&&window.localStorage.setItem(e,t)},s=(e,t)=>{if("undefined"!=typeof window){let r=window.localStorage.getItem(e);return t&&(console.log(`getFromLocalStorage removing key ${e}`),c(e)),r}return null},c=e=>{"undefined"!=typeof window&&window.localStorage.removeItem(e)},l=e=>{"undefined"!=typeof window&&(window.clearing_session_state=e)},i=(e,t)=>{const r=Object.keys(e),a=Object.keys(t);if(r.length!==a.length)return!1;for(let a of r)if(e[a]!==t[a])return!1;return!0},d=async(e,t=3)=>{for(let r=0;r<t;r++)if(await e())return!0;return!1}},7525:(e,t,r)=>{r.d(t,{queryTags:()=>u});var a=r(4054),n=r(8576),o=r(6793);const s=require("lodash");var c=r.n(s),l=r(6530),i=r.n(l);const d=500,u=(c().debounce((async(e,t)=>{const r=await(0,n.getAccessToken)();e=(0,a.escapeFilterValue)(e);let s=encodeURIComponent(`full_name=@${e},first_name=@${e},last_name=@${e},email=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/members?filter=${s}&expand=tickets,rsvp,schedule_summit_events,all_affiliations&access_token=${r}`)).then(a.fetchResponseHandler).then((e=>{let r=[...e.data];t(r)})).catch(a.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const r=await(0,n.getAccessToken)();e=(0,a.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/all?filter=${s}&access_token=${r}`)).then(a.fetchResponseHandler).then((e=>{let r=[...e.data];t(r)})).catch(a.fetchErrorHandler)}),d),c().debounce((async(e,t,r)=>{const s=await(0,n.getAccessToken)();t=(0,a.escapeFilterValue)(t);let c="/api/v1";e&&(c+=`/summits/${e}`),c+=`/speakers?filter=${encodeURIComponent(`full_name=@${t},first_name=@${t},last_name=@${t},email=@${t}`)}&access_token=${s}&expand=member,registration_request`,fetch((0,o.buildAPIBaseUrl)(c)).then(a.fetchResponseHandler).then((e=>{let t=[...e.data];r(t)})).catch(a.fetchErrorHandler)}),d),c().debounce((async(e,t,r)=>{const s=await(0,n.getAccessToken)();t=(0,a.escapeFilterValue)(t);let c="/api/v1",l=encodeURIComponent(`tag=@${t}`);c+=e?`/summits/${e}/track-tag-groups/all/allowed-tags?filter=${l}&expand=tag,track_tag_group`:`/tags?filter=${l}`,c+=`&order=tag&page=1&per_page=50&access_token=${s}`,fetch((0,o.buildAPIBaseUrl)(c)).then(a.fetchResponseHandler).then((t=>{let a=[...t.data];e&&(a=a.map((e=>e.tag))),r(a)})).catch(a.fetchErrorHandler)}),d));c().debounce((async(e,t,r)=>{const s=await(0,n.getAccessToken)();t=(0,a.escapeFilterValue)(t);let c=encodeURIComponent(`name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/tracks?filter=${c}&order=name&access_token=${s}`)).then(a.fetchResponseHandler).then((e=>{let t=[...e.data];r(t)})).catch(a.fetchErrorHandler)}),d),c().debounce((async(e,t,r)=>{const s=await(0,n.getAccessToken)();let c=(t=(0,a.escapeFilterValue)(t))?encodeURIComponent(`filter=name=@${t}`):"";fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/track-groups?order=name&access_token=${s}&${c}`)).then(a.fetchResponseHandler).then((e=>{let t=[...e.data];r(t)})).catch(a.fetchErrorHandler)}),d),c().debounce((async(e,t,r=!1,s)=>{const c=await(0,n.getAccessToken)();t=(0,a.escapeFilterValue)(t);let l=`/api/v1/summits/${e}/events`+(r?"/published":""),i=encodeURIComponent(`title=@${t}`);fetch((0,o.buildAPIBaseUrl)(`${l}?filter=${i}&order=title&access_token=${c}`)).then(a.fetchResponseHandler).then((e=>{let t=[...e.data];s(t)})).catch(a.fetchErrorHandler)}),d),c().debounce((async(e,t,r,s=null)=>{let c=`/api/v1/summits/${e}/event-types?order=name&access_token=${await(0,n.getAccessToken)()}`;if(t=(0,a.escapeFilterValue)(t)){c+=`&filter[]=${encodeURIComponent(`name=@${t}`)}`}if(s){c+=`&filter[]=${encodeURIComponent(`class_name==${s}`)}`}fetch((0,o.buildAPIBaseUrl)(c)).then(a.fetchResponseHandler).then((e=>{let t=[...e.data];r(t)})).catch(a.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const r=await(0,n.getAccessToken)();let s=encodeURIComponent(`title=@${e},code=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/groups?filter=${s}&access_token=${r}`)).then(a.fetchResponseHandler).then((e=>{let r=[...e.data];t(r)})).catch(a.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const r=await(0,n.getAccessToken)();e=(0,a.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/companies?filter=${s}&access_token=${r}`)).then(a.fetchResponseHandler).then((e=>{let r=[...e.data];t(r)})).catch(a.fetchErrorHandler)}),d),c().debounce((async(e,t,r)=>{let s;try{s=await(0,n.getAccessToken)()}catch(e){return void r(e)}let c=i()(`/api/v1/summits/${e}/registration-companies`);c.addQuery("access_token",s),c.addQuery("order","name"),t&&(t=(0,a.escapeFilterValue)(t),c.addQuery("filter[]",`name@@${t}`)),fetch((0,o.buildAPIBaseUrl)(c.toString())).then(a.fetchResponseHandler).then((e=>{let t=[...e.data];r(t)})).catch(a.fetchErrorHandler)}),d),c().debounce((async(e,t,r)=>{const s=await(0,n.getAccessToken)();t=(0,a.escapeFilterValue)(t);let c=encodeURIComponent(`company_name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/sponsors?filter=${c}&expand=company,sponsorship&access_token=${s}`)).then(a.fetchResponseHandler).then((e=>{let t=[...e.data];r(t)})).catch(a.fetchErrorHandler)}),d),c().debounce((async(e,t,r)=>{const s=await(0,n.getAccessToken)();t=(0,a.escapeFilterValue)(t);let c=encodeURIComponent(`name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/access-level-types?filter=${c}&&access_token=${s}`)).then(a.fetchResponseHandler).then((e=>{let t=[...e.data];r(t)})).catch(a.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const r=await(0,n.getAccessToken)();e=(0,a.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/organizations?filter=${s}&access_token=${r}`)).then(a.fetchResponseHandler).then((e=>{let r=[...e.data];t(r)})).catch(a.fetchErrorHandler)}),d);c().debounce((async(e,t={},r,s="v1")=>{const c=await(0,n.getAccessToken)();let l=i()(`/api/${s}/summits/${e}/ticket-types`);if(l.addQuery("access_token",c),l.addQuery("order","name"),t.hasOwnProperty("name")){const e=(0,a.escapeFilterValue)(t.name);l.addQuery("filter[]",`name@@${e}`)}if(t.hasOwnProperty("audience")){const e=(0,a.escapeFilterValue)(t.audience);l.addQuery("filter[]",`audience==${e}`)}fetch((0,o.buildAPIBaseUrl)(l.toString())).then(a.fetchResponseHandler).then((e=>{let t=[...e.data];r(t)})).catch(a.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const r=await(0,n.getAccessToken)(),s=i()("/api/v1/sponsored-projects");s.addQuery("access_token",r),e&&(e=(0,a.escapeFilterValue)(e),s.addQuery("filter[]",`name=@${e}`)),fetch((0,o.buildAPIBaseUrl)(s.toString())).then(a.fetchResponseHandler).then((e=>{let r=[...e.data];t(r)})).catch(a.fetchErrorHandler)}),d),c().debounce((async(e,t,r)=>{const s=await(0,n.getAccessToken)();t=(0,a.escapeFilterValue)(t);let c=encodeURIComponent(`code=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/promo-codes?filter=${c}&access_token=${s}`)).then(a.fetchResponseHandler).then((e=>{let t=[...e.data];r(t)})).catch(a.fetchErrorHandler)}),d)},8779:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},8213:e=>{e.exports=require("@babel/runtime/helpers/extends")},3838:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},4656:e=>{e.exports=require("i18n-react/dist/i18n-react")},3856:e=>{e.exports=require("idtoken-verifier")},8362:e=>{e.exports=require("moment-timezone")},580:e=>{e.exports=require("prop-types")},6689:e=>{e.exports=require("react")},9953:e=>{e.exports=require("react-select/lib/Async")},9503:e=>{e.exports=require("react-select/lib/AsyncCreatable")},2691:e=>{e.exports=require("superagent/lib/client")},271:e=>{e.exports=require("sweetalert2")},6530:e=>{e.exports=require("urijs")}},t={};function r(a){var n=t[a];if(void 0!==n)return n.exports;var o=t[a]={exports:{}};return e[a](o,o.exports,r),o.exports}(()=>{r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t}})(),(()=>{r.d=(e,t)=>{for(var a in t)r.o(t,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})}})(),(()=>{r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var a={};return(()=>{r.r(a),r.d(a,{default:()=>m});var e=r(8213),t=r.n(e),n=r(3838),o=r.n(n),s=r(6689),c=r.n(s),l=r(580),i=r.n(l),d=r(9953),u=r.n(d),p=r(9503),h=r.n(p),f=r(7525),R=r(6793);const _=["className","error","allowCreate"];class m extends c().Component{constructor(e){super(e),this.state={tagValue:e.value.map((e=>({tag:e.tag,id:e.id})))},this.handleChange=this.handleChange.bind(this),this.handleNew=this.handleNew.bind(this),this.getTags=this.getTags.bind(this)}componentDidUpdate(e,t,r){if(!(0,R.shallowEqual)(this.props.value,e.value)){let e=this.props.value.map((e=>({tag:e.tag,id:e.id})));this.setState({tagValue:e})}}handleNew(e){const t={tag:e};this.props.onCreate(e,this.setState({value:[...this.state.tagValue,t]}))}handleChange(e){let t={target:{id:this.props.id,value:e,type:"taginput"}};this.props.onChange(t)}getTags(e,t){if(!e)return Promise.resolve({options:[]});let r=this.props.hasOwnProperty("summitId")?this.props.summitId:null;(0,f.queryTags)(r,e,t)}render(){let e=this.props,{className:r,error:a,allowCreate:n}=e,s=o()(e,_),{tagValue:l}=this.state,i=this.props.hasOwnProperty("error")&&""!=a,d=l.sort(((e,t)=>e.tag.toLowerCase()>t.tag.toLowerCase()?1:e.tag.toLowerCase()<t.tag.toLowerCase()?-1:0));const p=n?h():u();return c().createElement("div",null,c().createElement(p,t()({},s,{className:r+" "+(i?"error":""),isMulti:!0,value:d,onChange:this.handleChange,onCreateOption:this.handleNew,loadOptions:this.getTags,getOptionLabel:e=>e.__isNew__?e.label:e.tag,getOptionValue:e=>e.__isNew__?e.value:e.tag})),i&&c().createElement("p",{className:"error-label"},a))}}m.propTypes={allowCreate:i().bool,className:i().string,summitId:i().number,id:i().string.isRequired,value:i().array,onCreate:i().func,onChange:i().func.isRequired},m.defaultProps={allowCreate:!1}})(),a})()));
@@ -1,2 +1 @@
1
- !function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],r):"object"==typeof exports?exports["openstack-uicore-foundation"]=r():e["openstack-uicore-foundation"]=r()}(this,(()=>(()=>{"use strict";var e={8213:e=>{e.exports=require("@babel/runtime/helpers/extends")},3838:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},6689:e=>{e.exports=require("react")}},r={};function t(o){var a=r[o];if(void 0!==a)return a.exports;var n=r[o]={exports:{}};return e[o](n,n.exports,t),n.exports}(()=>{t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r}})(),(()=>{t.d=(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})}})(),(()=>{t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r)})(),(()=>{t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var o={};return(()=>{t.r(o),t.d(o,{default:()=>p});var e=t(8213),r=t.n(e),a=t(3838),n=t.n(a),s=t(6689),l=t.n(s);const i=["onChange","value","className","error","ariaLabelledBy","containerClassName"];class p extends l().Component{constructor(e){super(e),this.handleChange=this.handleChange.bind(this)}componentDidUpdate(e,r,t){this.props.value!==e.value&&(this.input.value=this.props.value)}handleChange(e){this.props.onChange(e)}render(){let e=this.props,{onChange:t,value:o,className:a,error:s,ariaLabelledBy:p,containerClassName:u}=e,c=n()(e,i),d=this.props.hasOwnProperty("error")&&""!==s,h=this.props.hasOwnProperty("className")?a:"form-control",f=this.props.hasOwnProperty("containerClassName")?u:"container-form-control";return l().createElement("div",{className:f},l().createElement("input",r()({className:`${h} ${d?"error":""}`,ref:e=>{this.input=e},defaultValue:o,"aria-labelledby":p,onChange:this.handleChange},c)),d&&l().createElement("p",{className:"error-label"},s))}}p.defaultProps={ariaLabelledBy:null}})(),o})()));
2
- //# sourceMappingURL=text-input.js.map
1
+ !function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],r):"object"==typeof exports?exports["openstack-uicore-foundation"]=r():e["openstack-uicore-foundation"]=r()}(this,(()=>(()=>{"use strict";var e={8213:e=>{e.exports=require("@babel/runtime/helpers/extends")},3838:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},6689:e=>{e.exports=require("react")}},r={};function t(o){var a=r[o];if(void 0!==a)return a.exports;var n=r[o]={exports:{}};return e[o](n,n.exports,t),n.exports}(()=>{t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r}})(),(()=>{t.d=(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})}})(),(()=>{t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r)})(),(()=>{t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var o={};return(()=>{t.r(o),t.d(o,{default:()=>p});var e=t(8213),r=t.n(e),a=t(3838),n=t.n(a),s=t(6689),l=t.n(s);const i=["onChange","value","className","error","ariaLabelledBy","containerClassName"];class p extends l().Component{constructor(e){super(e),this.handleChange=this.handleChange.bind(this)}componentDidUpdate(e,r,t){this.props.value!==e.value&&(this.input.value=this.props.value)}handleChange(e){this.props.onChange(e)}render(){let e=this.props,{onChange:t,value:o,className:a,error:s,ariaLabelledBy:p,containerClassName:u}=e,c=n()(e,i),d=this.props.hasOwnProperty("error")&&""!==s,h=this.props.hasOwnProperty("className")?a:"form-control",f=this.props.hasOwnProperty("containerClassName")?u:"container-form-control";return l().createElement("div",{className:f},l().createElement("input",r()({className:`${h} ${d?"error":""}`,ref:e=>{this.input=e},defaultValue:o,"aria-labelledby":p,onChange:this.handleChange},c)),d&&l().createElement("p",{className:"error-label"},s))}}p.defaultProps={ariaLabelledBy:null}})(),o})()));
@@ -1,2 +1 @@
1
- !function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],r):"object"==typeof exports?exports["openstack-uicore-foundation"]=r():e["openstack-uicore-foundation"]=r()}(this,(()=>(()=>{"use strict";var e={8213:e=>{e.exports=require("@babel/runtime/helpers/extends")},3838:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},6689:e=>{e.exports=require("react")}},r={};function t(o){var n=r[o];if(void 0!==n)return n.exports;var a=r[o]={exports:{}};return e[o](a,a.exports,t),a.exports}(()=>{t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r}})(),(()=>{t.d=(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})}})(),(()=>{t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r)})(),(()=>{t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var o={};return(()=>{t.r(o),t.d(o,{default:()=>i});var e=t(8213),r=t.n(e),n=t(3838),a=t.n(n),u=t(6689),l=t.n(u);const s=["onChange","value","className","error"],i=e=>{let{onChange:t,value:o,className:n,error:i}=e,c=a()(e,s);const[p,d]=(0,u.useState)(o);let f=i&&""!=i,b=n||"form-control";return l().createElement("div",null,l().createElement("textarea",r()({className:b+" "+(f?"error":""),value:p,onChange:e=>{d(e.target.value),t(e)}},c)),f&&l().createElement("p",{className:"error-label"},i))}})(),o})()));
2
- //# sourceMappingURL=textarea-input.js.map
1
+ !function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],r):"object"==typeof exports?exports["openstack-uicore-foundation"]=r():e["openstack-uicore-foundation"]=r()}(this,(()=>(()=>{"use strict";var e={8213:e=>{e.exports=require("@babel/runtime/helpers/extends")},3838:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},6689:e=>{e.exports=require("react")}},r={};function t(o){var n=r[o];if(void 0!==n)return n.exports;var a=r[o]={exports:{}};return e[o](a,a.exports,t),a.exports}(()=>{t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r}})(),(()=>{t.d=(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})}})(),(()=>{t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r)})(),(()=>{t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var o={};return(()=>{t.r(o),t.d(o,{default:()=>i});var e=t(8213),r=t.n(e),n=t(3838),a=t.n(n),u=t(6689),l=t.n(u);const s=["onChange","value","className","error"],i=e=>{let{onChange:t,value:o,className:n,error:i}=e,c=a()(e,s);const[p,d]=(0,u.useState)(o);let f=i&&""!=i,b=n||"form-control";return l().createElement("div",null,l().createElement("textarea",r()({className:b+" "+(f?"error":""),value:p,onChange:e=>{d(e.target.value),t(e)}},c)),f&&l().createElement("p",{className:"error-label"},i))}})(),o})()));
@@ -1,2 +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,(()=>(()=>{"use strict";var e={4341:(e,t,n)=>{n(8779),n(4656),n(4054),n(6793),n(8576)},1593:(e,t,n)=>{n.d(t,{AUTH_ERROR_ACCESS_TOKEN_EXPIRED:()=>o,AUTH_ERROR_LOCK_ACQUIRE_ERROR:()=>s,AUTH_ERROR_MISSING_AUTH_INFO:()=>r,AUTH_ERROR_MISSING_REFRESH_TOKEN:()=>a,AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR:()=>c});const r="AUTH_ERROR_MISSING_AUTH_INFO",a="AUTH_ERROR_MISSING_REFRESH_TOKEN",o="AUTH_ERROR_ACCESS_TOKEN_EXPIRED",s="AUTH_ERROR_LOCK_ACQUIRE_ERROR",c="AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR"},8576:(e,t,n)=>{n.d(t,{getAccessToken:()=>h});var r=n(6793);n(2691);const a=require("browser-tabs-lock");var o=n.n(a);n(6530),n(3856),n(4341);require("crypto-js/sha256"),require("crypto-js/enc-base64url"),require("crypto-js/enc-hex"),"undefined"!=typeof window&&(window.crypto||window.msCrypto);var s=n(1593);const c=new(o()),i="openstackuicore.lock.getTokenSilently",l="code",d="authInfo",p="nonce",u="pkce",h=async()=>{if(await(0,r.retryPromise)((()=>c.acquireLock(i,5e3)),10))try{let e=_();if(!e)throw Error(s.AUTH_ERROR_MISSING_AUTH_INFO);let{accessToken:t,expiresIn:n,accessTokenUpdatedAt:r,refreshToken:a}=e,o=E(),c=Math.floor(Date.now()/1e3);if(n-=20,c-r>n||null==t){if(console.log("getAccessToken access token expired"),o===l&&y()){if(!a)throw m(),Error(s.AUTH_ERROR_MISSING_REFRESH_TOKEN);let e=await f(a),{access_token:t,expires_in:n,refresh_token:r}=e;return void 0===r&&(r=null),R(t,n,r),t}throw m(),Error(s.AUTH_ERROR_ACCESS_TOKEN_EXPIRED)}return t}finally{await c.releaseLock(i)}throw Error(s.AUTH_ERROR_LOCK_ACQUIRE_ERROR)},f=async e=>{let t=w(),n=g();const a={grant_type:"refresh_token",client_id:encodeURI(n),refresh_token:e};try{const e=await fetch(`${t}/oauth2/token`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(a)}).then((e=>{if(400===e.status){(0,r.getCurrentPathName)();throw(0,r.setSessionClearingState)(!0),Error(`${s.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${e.status} - ${e.statusText}`)}return e})).catch((function(e){throw Error(`${s.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${e.message}`)})),n=await e.json();let{access_token:o,refresh_token:c,expires_in:i}=n;return{access_token:o,refresh_token:c,expires_in:i}}catch(e){throw console.log(e),e}},R=(e,t,n=null,a=null)=>{let o=_(),s={accessToken:e,expiresIn:t,accessTokenUpdatedAt:Math.floor(Date.now()/1e3)};null===n&&o&&(n=o.refreshToken),null===a&&o&&(a=o.idToken),n&&(s.refreshToken=n),a&&(s.idToken=a),(0,r.putOnLocalStorage)(d,JSON.stringify(s))},_=()=>{try{let e=(0,r.getFromLocalStorage)(d,!1);return e?JSON.parse(e):null}catch(e){return null}},m=()=>{if("undefined"!=typeof window)return(0,r.removeFromLocalStorage)(d),(0,r.removeFromLocalStorage)(p),void(0,r.removeFromLocalStorage)(u)},g=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,E=()=>"undefined"!=typeof window&&window.OAUTH2_FLOW||"token id_token",y=()=>"undefined"==typeof window||new Boolean(window.OAUTH2_USE_REFRESH_TOKEN||!0),w=()=>"undefined"!=typeof window?window.IDP_BASE_URL:null},4054:(e,t,n)=>{n.d(t,{escapeFilterValue:()=>d,fetchErrorHandler:()=>i,fetchResponseHandler:()=>l});n(3838),n(2691),n(6530);var r=n(271),a=n.n(r),o=n(4656),s=n.n(o);n(6793),n(4341),n(8576);const c=e=>t=>({type:e,payload:t}),i=(c("RESET_LOADING"),c("START_LOADING"),c("STOP_LOADING"),e=>{let t=e.status,n=e.statusText;switch(t){case 403:a().fire("ERROR",s().translate("errors.user_not_authz"),"warning");break;case 401:a().fire("ERROR",s().translate("errors.session_expired"),"error");break;case 412:a().fire("ERROR",n,"warning");case 500:a().fire("ERROR",s().translate("errors.server_error"),"error")}}),l=e=>{if(e.ok)return e.json();throw e},d=e=>e=(e=e.replace(/,/g,"\\,")).replace(/;/g,"\\;")},6793:(e,t,n)=>{n.d(t,{buildAPIBaseUrl:()=>a,getCurrentPathName:()=>r,getFromLocalStorage:()=>s,putOnLocalStorage:()=>o,removeFromLocalStorage:()=>c,retryPromise:()=>l,setSessionClearingState:()=>i});n(8362),n(6530);const r=()=>"undefined"!=typeof window?window.location.pathname:null,a=e=>"undefined"!=typeof window?`${window.API_BASE_URL}${e}`:null``,o=(e,t)=>{"undefined"!=typeof window&&window.localStorage.setItem(e,t)},s=(e,t)=>{if("undefined"!=typeof window){let n=window.localStorage.getItem(e);return t&&(console.log(`getFromLocalStorage removing key ${e}`),c(e)),n}return null},c=e=>{"undefined"!=typeof window&&window.localStorage.removeItem(e)},i=e=>{"undefined"!=typeof window&&(window.clearing_session_state=e)},l=async(e,t=3)=>{for(let n=0;n<t;n++)if(await e())return!0;return!1}},7525:(e,t,n)=>{n.d(t,{queryTicketTypes:()=>p});var r=n(4054),a=n(8576),o=n(6793);const s=require("lodash");var c=n.n(s),i=n(6530),l=n.n(i);const d=500;c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`full_name=@${e},first_name=@${e},last_name=@${e},email=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/members?filter=${s}&expand=tickets,rsvp,schedule_summit_events,all_affiliations&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/all?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c="/api/v1";e&&(c+=`/summits/${e}`),c+=`/speakers?filter=${encodeURIComponent(`full_name=@${t},first_name=@${t},last_name=@${t},email=@${t}`)}&access_token=${s}&expand=member,registration_request`,fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c="/api/v1",i=encodeURIComponent(`tag=@${t}`);c+=e?`/summits/${e}/track-tag-groups/all/allowed-tags?filter=${i}&expand=tag,track_tag_group`:`/tags?filter=${i}`,c+=`&order=tag&page=1&per_page=50&access_token=${s}`,fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((t=>{let r=[...t.data];e&&(r=r.map((e=>e.tag))),n(r)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/tracks?filter=${c}&order=name&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();let c=(t=(0,r.escapeFilterValue)(t))?encodeURIComponent(`filter=name=@${t}`):"";fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/track-groups?order=name&access_token=${s}&${c}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n=!1,s)=>{const c=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let i=`/api/v1/summits/${e}/events`+(n?"/published":""),l=encodeURIComponent(`title=@${t}`);fetch((0,o.buildAPIBaseUrl)(`${i}?filter=${l}&order=title&access_token=${c}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];s(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n,s=null)=>{let c=`/api/v1/summits/${e}/event-types?order=name&access_token=${await(0,a.getAccessToken)()}`;if(t=(0,r.escapeFilterValue)(t)){c+=`&filter[]=${encodeURIComponent(`name=@${t}`)}`}if(s){c+=`&filter[]=${encodeURIComponent(`class_name==${s}`)}`}fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();let s=encodeURIComponent(`title=@${e},code=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/groups?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/companies?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{let s;try{s=await(0,a.getAccessToken)()}catch(e){return void n(e)}let c=l()(`/api/v1/summits/${e}/registration-companies`);c.addQuery("access_token",s),c.addQuery("order","name"),t&&(t=(0,r.escapeFilterValue)(t),c.addQuery("filter[]",`name@@${t}`)),fetch((0,o.buildAPIBaseUrl)(c.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`company_name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/sponsors?filter=${c}&expand=company,sponsorship&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/access-level-types?filter=${c}&&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/organizations?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d);const p=c().debounce((async(e,t={},n,s="v1")=>{const c=await(0,a.getAccessToken)();let i=l()(`/api/${s}/summits/${e}/ticket-types`);if(i.addQuery("access_token",c),i.addQuery("order","name"),t.hasOwnProperty("name")){const e=(0,r.escapeFilterValue)(t.name);i.addQuery("filter[]",`name@@${e}`)}if(t.hasOwnProperty("audience")){const e=(0,r.escapeFilterValue)(t.audience);i.addQuery("filter[]",`audience==${e}`)}fetch((0,o.buildAPIBaseUrl)(i.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d);c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)(),s=l()("/api/v1/sponsored-projects");s.addQuery("access_token",n),e&&(e=(0,r.escapeFilterValue)(e),s.addQuery("filter[]",`name=@${e}`)),fetch((0,o.buildAPIBaseUrl)(s.toString())).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`code=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/promo-codes?filter=${c}&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d)},8779:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},8213:e=>{e.exports=require("@babel/runtime/helpers/extends")},3838:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},4656:e=>{e.exports=require("i18n-react/dist/i18n-react")},3856:e=>{e.exports=require("idtoken-verifier")},8362:e=>{e.exports=require("moment-timezone")},580:e=>{e.exports=require("prop-types")},6689:e=>{e.exports=require("react")},9953:e=>{e.exports=require("react-select/lib/Async")},2691:e=>{e.exports=require("superagent/lib/client")},271:e=>{e.exports=require("sweetalert2")},6530:e=>{e.exports=require("urijs")}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}(()=>{n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t}})(),(()=>{n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}})(),(()=>{n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var r={};return(()=>{n.r(r),n.d(r,{default:()=>R});var e=n(8213),t=n.n(e),a=n(3838),o=n.n(a),s=n(6689),c=n.n(s),i=n(9953),l=n.n(i),d=n(7525),p=n(580),u=n.n(p);const h=["value","error","onChange","id","multi"];class f extends c().Component{constructor(e){super(e),this.state={value:e.value},this.handleChange=this.handleChange.bind(this),this.getTicketTypes=this.getTicketTypes.bind(this),this.getOptionValue=this.getOptionValue.bind(this),this.getOptionLabel=this.getOptionLabel.bind(this)}getOptionValue(e){return this.props.hasOwnProperty("getOptionValue")?this.props.getOptionValue(e):e.id}getOptionLabel(e){return this.props.hasOwnProperty("getOptionLabel")?this.props.getOptionLabel(e):`${e.name}`}handleChange(e){let t={target:{id:this.props.id,value:e,type:"tickettypeinput"}};this.props.onChange(t)}getTicketTypes(e,t){let{summitId:n,version:r}=this.props;if(!e)return Promise.resolve({options:[]});let a={name:e};this.props.hasOwnProperty("audience")&&(a.audience=this.props.audience),(0,d.queryTicketTypes)(n,a,t,r)}render(){let e=this.props,{value:n,error:r,onChange:a,id:s,multi:i}=e,d=o()(e,h),p=this.props.hasOwnProperty("multi"),u=this.props.hasOwnProperty("error")&&""!=r;return c().createElement("div",null,c().createElement(l(),t()({value:n,onChange:this.handleChange,loadOptions:this.getTicketTypes,getOptionValue:e=>this.getOptionValue(e),getOptionLabel:e=>this.getOptionLabel(e),isMulti:p},d)),u&&c().createElement("p",{className:"error-label"},r))}}f.defaultProps={version:"v1"},f.propTypes={audience:u().string,version:u().string};const R=f})(),r})()));
2
- //# sourceMappingURL=ticket-types-input.js.map
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,(()=>(()=>{"use strict";var e={4341:(e,t,n)=>{n(8779),n(4656),n(4054),n(6793),n(8576)},1593:(e,t,n)=>{n.d(t,{AUTH_ERROR_ACCESS_TOKEN_EXPIRED:()=>o,AUTH_ERROR_LOCK_ACQUIRE_ERROR:()=>s,AUTH_ERROR_MISSING_AUTH_INFO:()=>r,AUTH_ERROR_MISSING_REFRESH_TOKEN:()=>a,AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR:()=>c});const r="AUTH_ERROR_MISSING_AUTH_INFO",a="AUTH_ERROR_MISSING_REFRESH_TOKEN",o="AUTH_ERROR_ACCESS_TOKEN_EXPIRED",s="AUTH_ERROR_LOCK_ACQUIRE_ERROR",c="AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR"},8576:(e,t,n)=>{n.d(t,{getAccessToken:()=>h});var r=n(6793);n(2691);const a=require("browser-tabs-lock");var o=n.n(a);n(6530),n(3856),n(4341);require("crypto-js/sha256"),require("crypto-js/enc-base64url"),require("crypto-js/enc-hex"),"undefined"!=typeof window&&(window.crypto||window.msCrypto);var s=n(1593);const c=new(o()),i="openstackuicore.lock.getTokenSilently",l="code",d="authInfo",p="nonce",u="pkce",h=async()=>{if(await(0,r.retryPromise)((()=>c.acquireLock(i,5e3)),10))try{let e=_();if(!e)throw Error(s.AUTH_ERROR_MISSING_AUTH_INFO);let{accessToken:t,expiresIn:n,accessTokenUpdatedAt:r,refreshToken:a}=e,o=E(),c=Math.floor(Date.now()/1e3);if(n-=20,c-r>n||null==t){if(console.log("getAccessToken access token expired"),o===l&&y()){if(!a)throw m(),Error(s.AUTH_ERROR_MISSING_REFRESH_TOKEN);let e=await f(a),{access_token:t,expires_in:n,refresh_token:r}=e;return void 0===r&&(r=null),R(t,n,r),t}throw m(),Error(s.AUTH_ERROR_ACCESS_TOKEN_EXPIRED)}return t}finally{await c.releaseLock(i)}throw Error(s.AUTH_ERROR_LOCK_ACQUIRE_ERROR)},f=async e=>{let t=w(),n=g();const a={grant_type:"refresh_token",client_id:encodeURI(n),refresh_token:e};try{const e=await fetch(`${t}/oauth2/token`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(a)}).then((e=>{if(400===e.status){(0,r.getCurrentPathName)();throw(0,r.setSessionClearingState)(!0),Error(`${s.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${e.status} - ${e.statusText}`)}return e})).catch((function(e){throw Error(`${s.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${e.message}`)})),n=await e.json();let{access_token:o,refresh_token:c,expires_in:i}=n;return{access_token:o,refresh_token:c,expires_in:i}}catch(e){throw console.log(e),e}},R=(e,t,n=null,a=null)=>{let o=_(),s={accessToken:e,expiresIn:t,accessTokenUpdatedAt:Math.floor(Date.now()/1e3)};null===n&&o&&(n=o.refreshToken),null===a&&o&&(a=o.idToken),n&&(s.refreshToken=n),a&&(s.idToken=a),(0,r.putOnLocalStorage)(d,JSON.stringify(s))},_=()=>{try{let e=(0,r.getFromLocalStorage)(d,!1);return e?JSON.parse(e):null}catch(e){return null}},m=()=>{if("undefined"!=typeof window)return(0,r.removeFromLocalStorage)(d),(0,r.removeFromLocalStorage)(p),void(0,r.removeFromLocalStorage)(u)},g=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,E=()=>"undefined"!=typeof window&&window.OAUTH2_FLOW||"token id_token",y=()=>"undefined"==typeof window||new Boolean(window.OAUTH2_USE_REFRESH_TOKEN||!0),w=()=>"undefined"!=typeof window?window.IDP_BASE_URL:null},4054:(e,t,n)=>{n.d(t,{escapeFilterValue:()=>d,fetchErrorHandler:()=>i,fetchResponseHandler:()=>l});n(3838),n(2691),n(6530);var r=n(271),a=n.n(r),o=n(4656),s=n.n(o);n(6793),n(4341),n(8576);const c=e=>t=>({type:e,payload:t}),i=(c("RESET_LOADING"),c("START_LOADING"),c("STOP_LOADING"),e=>{let t=e.status,n=e.statusText;switch(t){case 403:a().fire("ERROR",s().translate("errors.user_not_authz"),"warning");break;case 401:a().fire("ERROR",s().translate("errors.session_expired"),"error");break;case 412:a().fire("ERROR",n,"warning");case 500:a().fire("ERROR",s().translate("errors.server_error"),"error")}}),l=e=>{if(e.ok)return e.json();throw e},d=e=>e=(e=e.replace(/,/g,"\\,")).replace(/;/g,"\\;")},6793:(e,t,n)=>{n.d(t,{buildAPIBaseUrl:()=>a,getCurrentPathName:()=>r,getFromLocalStorage:()=>s,putOnLocalStorage:()=>o,removeFromLocalStorage:()=>c,retryPromise:()=>l,setSessionClearingState:()=>i});n(8362),n(6530);const r=()=>"undefined"!=typeof window?window.location.pathname:null,a=e=>"undefined"!=typeof window?`${window.API_BASE_URL}${e}`:null``,o=(e,t)=>{"undefined"!=typeof window&&window.localStorage.setItem(e,t)},s=(e,t)=>{if("undefined"!=typeof window){let n=window.localStorage.getItem(e);return t&&(console.log(`getFromLocalStorage removing key ${e}`),c(e)),n}return null},c=e=>{"undefined"!=typeof window&&window.localStorage.removeItem(e)},i=e=>{"undefined"!=typeof window&&(window.clearing_session_state=e)},l=async(e,t=3)=>{for(let n=0;n<t;n++)if(await e())return!0;return!1}},7525:(e,t,n)=>{n.d(t,{queryTicketTypes:()=>p});var r=n(4054),a=n(8576),o=n(6793);const s=require("lodash");var c=n.n(s),i=n(6530),l=n.n(i);const d=500;c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`full_name=@${e},first_name=@${e},last_name=@${e},email=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/members?filter=${s}&expand=tickets,rsvp,schedule_summit_events,all_affiliations&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/all?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c="/api/v1";e&&(c+=`/summits/${e}`),c+=`/speakers?filter=${encodeURIComponent(`full_name=@${t},first_name=@${t},last_name=@${t},email=@${t}`)}&access_token=${s}&expand=member,registration_request`,fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c="/api/v1",i=encodeURIComponent(`tag=@${t}`);c+=e?`/summits/${e}/track-tag-groups/all/allowed-tags?filter=${i}&expand=tag,track_tag_group`:`/tags?filter=${i}`,c+=`&order=tag&page=1&per_page=50&access_token=${s}`,fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((t=>{let r=[...t.data];e&&(r=r.map((e=>e.tag))),n(r)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/tracks?filter=${c}&order=name&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();let c=(t=(0,r.escapeFilterValue)(t))?encodeURIComponent(`filter=name=@${t}`):"";fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/track-groups?order=name&access_token=${s}&${c}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n=!1,s)=>{const c=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let i=`/api/v1/summits/${e}/events`+(n?"/published":""),l=encodeURIComponent(`title=@${t}`);fetch((0,o.buildAPIBaseUrl)(`${i}?filter=${l}&order=title&access_token=${c}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];s(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n,s=null)=>{let c=`/api/v1/summits/${e}/event-types?order=name&access_token=${await(0,a.getAccessToken)()}`;if(t=(0,r.escapeFilterValue)(t)){c+=`&filter[]=${encodeURIComponent(`name=@${t}`)}`}if(s){c+=`&filter[]=${encodeURIComponent(`class_name==${s}`)}`}fetch((0,o.buildAPIBaseUrl)(c)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();let s=encodeURIComponent(`title=@${e},code=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/groups?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/companies?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{let s;try{s=await(0,a.getAccessToken)()}catch(e){return void n(e)}let c=l()(`/api/v1/summits/${e}/registration-companies`);c.addQuery("access_token",s),c.addQuery("order","name"),t&&(t=(0,r.escapeFilterValue)(t),c.addQuery("filter[]",`name@@${t}`)),fetch((0,o.buildAPIBaseUrl)(c.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`company_name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/sponsors?filter=${c}&expand=company,sponsorship&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`name=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/access-level-types?filter=${c}&&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)();e=(0,r.escapeFilterValue)(e);let s=encodeURIComponent(`name=@${e}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/organizations?filter=${s}&access_token=${n}`)).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d);const p=c().debounce((async(e,t={},n,s="v1")=>{const c=await(0,a.getAccessToken)();let i=l()(`/api/${s}/summits/${e}/ticket-types`);if(i.addQuery("access_token",c),i.addQuery("order","name"),t.hasOwnProperty("name")){const e=(0,r.escapeFilterValue)(t.name);i.addQuery("filter[]",`name@@${e}`)}if(t.hasOwnProperty("audience")){const e=(0,r.escapeFilterValue)(t.audience);i.addQuery("filter[]",`audience==${e}`)}fetch((0,o.buildAPIBaseUrl)(i.toString())).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d);c().debounce((async(e,t)=>{const n=await(0,a.getAccessToken)(),s=l()("/api/v1/sponsored-projects");s.addQuery("access_token",n),e&&(e=(0,r.escapeFilterValue)(e),s.addQuery("filter[]",`name=@${e}`)),fetch((0,o.buildAPIBaseUrl)(s.toString())).then(r.fetchResponseHandler).then((e=>{let n=[...e.data];t(n)})).catch(r.fetchErrorHandler)}),d),c().debounce((async(e,t,n)=>{const s=await(0,a.getAccessToken)();t=(0,r.escapeFilterValue)(t);let c=encodeURIComponent(`code=@${t}`);fetch((0,o.buildAPIBaseUrl)(`/api/v1/summits/${e}/promo-codes?filter=${c}&access_token=${s}`)).then(r.fetchResponseHandler).then((e=>{let t=[...e.data];n(t)})).catch(r.fetchErrorHandler)}),d)},8779:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},8213:e=>{e.exports=require("@babel/runtime/helpers/extends")},3838:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},4656:e=>{e.exports=require("i18n-react/dist/i18n-react")},3856:e=>{e.exports=require("idtoken-verifier")},8362:e=>{e.exports=require("moment-timezone")},580:e=>{e.exports=require("prop-types")},6689:e=>{e.exports=require("react")},9953:e=>{e.exports=require("react-select/lib/Async")},2691:e=>{e.exports=require("superagent/lib/client")},271:e=>{e.exports=require("sweetalert2")},6530:e=>{e.exports=require("urijs")}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}(()=>{n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t}})(),(()=>{n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}})(),(()=>{n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var r={};return(()=>{n.r(r),n.d(r,{default:()=>R});var e=n(8213),t=n.n(e),a=n(3838),o=n.n(a),s=n(6689),c=n.n(s),i=n(9953),l=n.n(i),d=n(7525),p=n(580),u=n.n(p);const h=["value","error","onChange","id","multi"];class f extends c().Component{constructor(e){super(e),this.state={value:e.value},this.handleChange=this.handleChange.bind(this),this.getTicketTypes=this.getTicketTypes.bind(this),this.getOptionValue=this.getOptionValue.bind(this),this.getOptionLabel=this.getOptionLabel.bind(this)}getOptionValue(e){return this.props.hasOwnProperty("getOptionValue")?this.props.getOptionValue(e):e.id}getOptionLabel(e){return this.props.hasOwnProperty("getOptionLabel")?this.props.getOptionLabel(e):`${e.name}`}handleChange(e){let t={target:{id:this.props.id,value:e,type:"tickettypeinput"}};this.props.onChange(t)}getTicketTypes(e,t){let{summitId:n,version:r}=this.props;if(!e)return Promise.resolve({options:[]});let a={name:e};this.props.hasOwnProperty("audience")&&(a.audience=this.props.audience),(0,d.queryTicketTypes)(n,a,t,r)}render(){let e=this.props,{value:n,error:r,onChange:a,id:s,multi:i}=e,d=o()(e,h),p=this.props.hasOwnProperty("multi"),u=this.props.hasOwnProperty("error")&&""!=r;return c().createElement("div",null,c().createElement(l(),t()({value:n,onChange:this.handleChange,loadOptions:this.getTicketTypes,getOptionValue:e=>this.getOptionValue(e),getOptionLabel:e=>this.getOptionLabel(e),isMulti:p},d)),u&&c().createElement("p",{className:"error-label"},r))}}f.defaultProps={version:"v1"},f.propTypes={audience:u().string,version:u().string};const R=f})(),r})()));