@ukpc-lib/react 0.2.27 → 0.2.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.js +61 -55
- package/package.json +1 -1
- package/web-components-bundle/global-topbar/index.cjs +1 -1
- package/web-components-bundle/global-topbar/index.js +1 -1
- package/web-components-bundle/has-permission/index.cjs +1 -1
- package/web-components-bundle/has-permission/index.js +1 -1
- package/web-components-bundle/{index-5b201dc6.js → index-ed2b29bc.js} +61 -55
- package/web-components-bundle/{index-c66f53fe.cjs → index-f93fc96f.cjs} +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("../index.module-160774a9.cjs"),p=require("react/jsx-runtime"),_=require("react"),Ho=require("../Colors-51ce6654.cjs"),se=require("moment"),qt=require("axios");require("@r2wc/react-to-web-component");const Uo=require("react-router-dom"),vc=require("react-dom"),L=require("@mui/material");function bc(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const N=bc(_),xc=`.modal-overlay{z-index:1300;position:fixed;top:0;right:0;bottom:0;left:0;background:hsla(0,0%,0%,.254);--tw-backdrop-blur: blur(4px);justify-content:center;align-items:center;-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.modal-title{font-size:1.25rem;line-height:1.75rem;color:#e01b00;font-weight:500}.modal-footer{display:flex;justify-content:space-between;width:80%}.modal-container{background:#ffffff;-webkit-backdrop-filter:blur(4.5px);backdrop-filter:blur(4.5px);display:flex;padding:32px 24px 40px;flex-direction:column;align-items:center;gap:24px;align-self:stretch;width:500px;height:204px;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);border-radius:.5rem}.modal-button{border-radius:3px;border:1px solid #ddd;background:#ddd;padding:8px 32px;font-size:14px}.confirm-btn{background:#e01b00!important}.text-white{color:#fff}.text-sm{font-size:.875rem;line-height:1.25rem}
|
|
2
|
-
`;function Yo({isOpen:e,onClose:t,onConfirm:n}){if(!e)return null;function r(i){var o;((o=i.target)==null?void 0:o.id)==="modal-wrapper"&&t()}return p.jsxs(p.Fragment,{children:[p.jsx("style",{type:"text/css",children:xc}),p.jsx("div",{onClick:r,className:"modal-overlay",id:"modal-wrapper",children:p.jsxs("div",{className:"modal-container",children:[p.jsx("h3",{className:"modal-title",children:"Log out"}),p.jsx("p",{className:"text-sm",children:"Are you sure want to log out?"}),p.jsxs("div",{className:"modal-footer",children:[p.jsx("button",{className:"modal-button",onClick:t,children:"Cancel"}),p.jsx("button",{onClick:n,className:"text-white confirm-btn modal-button",children:"Confirm"})]})]})})]})}function wc({primaryColor:e="#009d4f"}){return p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",children:[p.jsx("path",{d:"M8.5 19.5H8C4 19.5 2 18.5 2 13.5V8.5C2 4.5 4 2.5 8 2.5H16C20 2.5 22 4.5 22 8.5V13.5C22 17.5 20 19.5 16 19.5H15.5C15.19 19.5 14.89 19.65 14.7 19.9L13.2 21.9C12.54 22.78 11.46 22.78 10.8 21.9L9.3 19.9C9.14 19.68 8.77 19.5 8.5 19.5Z",stroke:e,"stroke-width":"1.5","stroke-miterlimit":"10","stroke-linecap":"round","stroke-linejoin":"round"}),p.jsx("path",{d:"M15.9965 11.5H16.0054",stroke:e,"stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),p.jsx("path",{d:"M11.9955 11.5H12.0045",stroke:e,"stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),p.jsx("path",{d:"M7.99451 11.5H8.00349",stroke:e,"stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})]})}const Sc=e=>{const{tabs:t}=e,n=r=>{e.setCurrentTab(r.target.id)};return p.jsxs("div",{className:"tab-container",children:[p.jsx("div",{style:{display:"flex",width:"100%",height:"50px",borderBottom:`1px solid ${Ho.color.grey200}`},className:"tab-container__title",children:t.map((r,i)=>p.jsx("button",{id:r.id,disabled:e.currentTab===`${r.id}`,onClick:n,className:`tab-title ${e.currentTab===`${r.id}`?"is-active":""}`,children:r.tabTitle},i))}),p.jsx("div",{className:"tab-content",children:t.map((r,i)=>p.jsx("div",{children:e.currentTab===`${r.id}`&&p.jsx("div",{children:r.children})},i))})]})},Ec=({notification:e,handleUpdateRead:t})=>{const n=r=>{const i=se(),o=se(r),s=i.diff(o,"days"),a=i.diff(o,"minutes"),l=i.diff(o,"months"),c=i.diff(o,"years");if(a<1)return"Just now";if(s===0){if(a<=60)return`${a} minutes ago`;const u=Math.floor(a/60);return`${u} hour${u>1?"s":""} ago`}if(s===1)return"Yesterday";if(s>=2&&s<=7)return`${s} days ago`;if(l===0||l===1){const u=Math.ceil(s/7);return`${u} week${u>1?"s":""} ago`}return l<12?`${Math.floor(l/4)} months ago`:c===1?"1 year ago":"Over 1 year ago"};return p.jsxs("div",{className:"notitification-item__container",onClick:()=>t(e.id,!e.isRead),children:[p.jsx("div",{className:"notification-item__image-container",children:p.jsx("img",{src:e==null?void 0:e.userAvatarUrl,onError:({currentTarget:r})=>{r.onerror=null,r.src="https://ukpcsaprod.blob.core.windows.net/account/logo.png"},alt:e.userName})}),p.jsxs("div",{className:"notification-item__content",children:[p.jsx("p",{className:"notification-item__user-name",children:e.userName}),p.jsxs("p",{children:[`${e.message} `,p.jsx("span",{children:e==null?void 0:e.context})]})]}),p.jsx("div",{className:"notification-item__time",children:p.jsx("p",{children:n(e.createdAt)})}),p.jsx("button",{className:`${(e==null?void 0:e.isRead)===!1?"unread":"read"} notification-item__read-at`,onClick:()=>t(e.id,!e.isRead),"aria-label":"Mark as read"})]})},Bi=({notidata:e,handleUpdateRead:t,handleUpdateReadAll:n})=>p.jsxs("div",{children:[p.jsx("div",{className:"mark-all-read",children:p.jsx("button",{onClick:n,children:"Mark all as read"})}),p.jsx("div",{className:"notification-items__wrapper",children:p.jsx("div",{className:"notification-items__content",children:Object.values(e).map((r,i)=>p.jsx(Ec,{notification:r,handleUpdateRead:t},i))})})]}),Go=({baseUrl:e,notiPath:t,setNotiData:n})=>async()=>{const o=e+(t||"/notification-management/api/v1/notifications"),s=await qt.get(o,{params:{filter:{notificationFilterType:"all"}},withCredentials:!0}),a=await qt.get(o,{params:{filter:{notificationFilterType:"unread"}},withCredentials:!0});Promise.all([s,a]).then(l=>{var c,u,d,h;console.log("result: "+l),n({all:{rows:(c=l[0].data)==null?void 0:c.rows,total:(u=l[0].data)==null?void 0:u.total},unread:{rows:(d=l[1].data)==null?void 0:d.rows,total:(h=l[1].data)==null?void 0:h.total}})})},Cc=({baseUrl:e,notiPath:t})=>{var d,h,m,y;const{setShowModalFalse:n}=_.useContext(S.CustomOpenList),{notidata:r,setNotiData:i}=_.useContext(S.CustomOpenList);console.log(r);const[o,s]=_.useState("all"),a=Go({baseUrl:e,notiPath:t,setNotiData:i}),l=async()=>{var f,g;try{const w=e+(t||"/notification-management/api/v1/notifications");await qt.put(w,{withCredentials:!0})}catch(b){console.log(b),S.pushError(((g=(f=b.response)==null?void 0:f.data)==null?void 0:g.errorMessage)||"Have error when get notification list")}await a()},c=async(f,g)=>{var b,w;try{const x=t||`/notification-management/api/v1/notifications/${f}`,E=e+x;await qt.put(E,{isRead:g},{withCredentials:!0})}catch(x){S.pushError(((w=(b=x.response)==null?void 0:b.data)==null?void 0:w.errorMessage)||"Have error when get notification list")}await a()},u=[{id:"all",tabTitle:`All (${((d=r==null?void 0:r.all)==null?void 0:d.total)||0})`,children:p.jsx(Bi,{notidata:((h=r==null?void 0:r.all)==null?void 0:h.rows)||[],handleUpdateRead:c,handleUpdateReadAll:l})},{id:"unread",tabTitle:`Unread (${((m=r==null?void 0:r.unread)==null?void 0:m.total)||0})`,children:p.jsx(Bi,{notidata:((y=r==null?void 0:r.unread)==null?void 0:y.rows)||[],handleUpdateRead:c,handleUpdateReadAll:l})}];return p.jsx(p.Fragment,{children:p.jsx("div",{style:{position:"absolute",backgroundColor:"#fff",width:"550px",height:"90vh",right:"100px",top:"100%",padding:"32px",boxShadow:"10px 0px 20px #999",borderRadius:"0 0 8px 8px",overflow:"hidden"},children:p.jsxs("div",{className:"list-content",children:[p.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[p.jsx("h3",{style:{fontSize:"24px",fontWeight:"500"},className:"list-title",children:"Notifications"}),p.jsx("button",{onClick:n,children:p.jsx("svg",{width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p.jsx("path",{d:"M7.05086 6.13616C6.66033 5.74563 6.02717 5.74563 5.63664 6.13616C5.24612 6.52668 5.24612 7.15984 5.63664 7.55037L10.5864 12.5001L5.63664 17.4499C5.24612 17.8404 5.24612 18.4736 5.63664 18.8641C6.02717 19.2546 6.66033 19.2546 7.05086 18.8641L12.0006 13.9143L16.9504 18.8641C17.3409 19.2546 17.974 19.2546 18.3646 18.8641C18.7551 18.4736 18.7551 17.8404 18.3646 17.4499L13.4148 12.5001L18.3646 7.55037C18.7551 7.15984 18.7551 6.52668 18.3646 6.13616C17.974 5.74563 17.3409 5.74563 16.9504 6.13616L12.0006 11.0859L7.05086 6.13616Z",fill:"#85858A"})})})]}),p.jsx(Sc,{tabs:u,setCurrentTab:s,currentTab:o})]})})})};function Tc({primaryColor:e="#009d4f",baseUrl:t,notiPath:n}){var c,u;const{isOpen:r,toggleOpen:i}=_.useContext(S.CustomOpenList),{notidata:o,setNotiData:s}=_.useContext(S.CustomOpenList),a=Go({baseUrl:t,notiPath:n,setNotiData:s}),l=async()=>{var d,h;try{await a()}catch(m){S.pushError(((h=(d=m.response)==null?void 0:d.data)==null?void 0:h.errorMessage)||"Have error when get notification list")}};return _.useEffect(()=>{l()},[o]),p.jsxs("div",{children:[p.jsxs("svg",{width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:i,style:{cursor:"pointer"},children:[p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.7968 17.4705C16.5901 17.4705 18.8076 16.8556 19.0218 14.3874C19.0218 11.921 17.4757 12.0796 17.4757 9.05334C17.4757 6.68952 15.2352 4 11.7968 4C8.35833 4 6.1178 6.68952 6.1178 9.05334C6.1178 12.0796 4.57178 11.921 4.57178 14.3874C4.78679 16.8649 7.00428 17.4705 11.7968 17.4705Z",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M13.8274 20.0286C12.6679 21.3161 10.8591 21.3313 9.68848 20.0286",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),(o==null?void 0:o.unread)&&(o==null?void 0:o.unread.total)!=0&&p.jsx("span",{style:{position:"absolute",top:"14px",background:`${Ho.color.dangerDark}`,width:"18px",height:"18px",border:"1px solid #fff",borderRadius:"50%",color:"#fff",fontSize:"12px"},className:"notification-badge",children:((c=o==null?void 0:o.unread)==null?void 0:c.total)>9?"9+":`${(u=o==null?void 0:o.unread)==null?void 0:u.total}`}),!r&&p.jsx(Cc,{baseUrl:t,notiPath:n})]})}const _c=`*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}
|
|
2
|
+
`;function Yo({isOpen:e,onClose:t,onConfirm:n}){if(!e)return null;function r(i){var o;((o=i.target)==null?void 0:o.id)==="modal-wrapper"&&t()}return p.jsxs(p.Fragment,{children:[p.jsx("style",{type:"text/css",children:xc}),p.jsx("div",{onClick:r,className:"modal-overlay",id:"modal-wrapper",children:p.jsxs("div",{className:"modal-container",children:[p.jsx("h3",{className:"modal-title",children:"Log out"}),p.jsx("p",{className:"text-sm",children:"Are you sure want to log out?"}),p.jsxs("div",{className:"modal-footer",children:[p.jsx("button",{className:"modal-button",onClick:t,children:"Cancel"}),p.jsx("button",{onClick:n,className:"text-white confirm-btn modal-button",children:"Confirm"})]})]})})]})}function wc({primaryColor:e="#009d4f"}){return p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",children:[p.jsx("path",{d:"M8.5 19.5H8C4 19.5 2 18.5 2 13.5V8.5C2 4.5 4 2.5 8 2.5H16C20 2.5 22 4.5 22 8.5V13.5C22 17.5 20 19.5 16 19.5H15.5C15.19 19.5 14.89 19.65 14.7 19.9L13.2 21.9C12.54 22.78 11.46 22.78 10.8 21.9L9.3 19.9C9.14 19.68 8.77 19.5 8.5 19.5Z",stroke:e,"stroke-width":"1.5","stroke-miterlimit":"10","stroke-linecap":"round","stroke-linejoin":"round"}),p.jsx("path",{d:"M15.9965 11.5H16.0054",stroke:e,"stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),p.jsx("path",{d:"M11.9955 11.5H12.0045",stroke:e,"stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),p.jsx("path",{d:"M7.99451 11.5H8.00349",stroke:e,"stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})]})}const Sc=e=>{const{tabs:t}=e,n=r=>{e.setCurrentTab(r.target.id)};return p.jsxs("div",{className:"tab-container",children:[p.jsx("div",{style:{display:"flex",width:"100%",height:"50px",borderBottom:`1px solid ${Ho.color.grey200}`},className:"tab-container__title",children:t.map((r,i)=>p.jsx("button",{id:r.id,disabled:e.currentTab===`${r.id}`,onClick:n,className:`tab-title ${e.currentTab===`${r.id}`?"is-active":""}`,children:r.tabTitle},i))}),p.jsx("div",{className:"tab-content",children:t.map((r,i)=>p.jsx("div",{children:e.currentTab===`${r.id}`&&p.jsx("div",{children:r.children})},i))})]})},Ec=({notification:e,handleUpdateRead:t})=>{const n=r=>{const i=se(),o=se(r),s=i.diff(o,"days"),a=i.diff(o,"minutes"),l=i.diff(o,"months"),c=i.diff(o,"years");if(a<1)return"Just now";if(s===0){if(a<=60)return`${a} minutes ago`;const u=Math.floor(a/60);return`${u} hour${u>1?"s":""} ago`}if(s===1)return"Yesterday";if(s>=2&&s<=7)return`${s} days ago`;if(l===0||l===1){const u=Math.ceil(s/7);return`${u} week${u>1?"s":""} ago`}return l<12?`${Math.floor(l/4)} months ago`:c===1?"1 year ago":"Over 1 year ago"};return p.jsxs("div",{className:"notitification-item__container",onClick:()=>t(e.id,!e.isRead),children:[p.jsx("div",{className:"notification-item__image-container",children:p.jsx("img",{src:e==null?void 0:e.userAvatarUrl,onError:({currentTarget:r})=>{r.onerror=null,r.src="https://ukpcsaprod.blob.core.windows.net/account/logo.png"},alt:e.userName})}),p.jsxs("div",{className:"notification-item__content",children:[p.jsx("p",{className:"notification-item__user-name",children:e.userName}),p.jsxs("p",{children:[`${e.message} `,p.jsx("span",{children:e==null?void 0:e.context})]})]}),p.jsx("div",{className:"notification-item__time",children:p.jsx("p",{children:n(e.createdAt)})}),p.jsx("button",{className:`${(e==null?void 0:e.isRead)===!1?"unread":"read"} notification-item__read-at`,onClick:()=>t(e.id,!e.isRead),"aria-label":"Mark as read"})]})},Bi=({notidata:e,handleUpdateRead:t,handleUpdateReadAll:n})=>p.jsxs("div",{children:[p.jsx("div",{className:"mark-all-read",children:p.jsx("button",{onClick:n,children:"Mark all as read"})}),p.jsx("div",{className:"notification-items__wrapper",children:p.jsx("div",{className:"notification-items__content",children:Object.values(e).map((r,i)=>p.jsx(Ec,{notification:r,handleUpdateRead:t},i))})})]}),Go=({baseUrl:e,notiPath:t,setNotiData:n})=>async()=>{const o=e+(t||"/notification-management/api/v1/notifications"),s=await qt.get(o,{params:{filter:{notificationFilterType:"all"}},withCredentials:!0}),a=await qt.get(o,{params:{filter:{notificationFilterType:"unread"}},withCredentials:!0});Promise.all([s,a]).then(l=>{var c,u,d,h;console.log("result: "+l),n({all:{rows:(c=l[0].data)==null?void 0:c.rows,total:(u=l[0].data)==null?void 0:u.total},unread:{rows:(d=l[1].data)==null?void 0:d.rows,total:(h=l[1].data)==null?void 0:h.total}})})},Cc=({baseUrl:e,notiPath:t})=>{var d,h,m,y;const{setShowModalFalse:n}=_.useContext(S.CustomOpenList),{notidata:r,setNotiData:i}=_.useContext(S.CustomOpenList);console.log(r);const[o,s]=_.useState("all"),a=Go({baseUrl:e,notiPath:t,setNotiData:i}),l=async()=>{var f,g;try{const w=e+(t||"/notification-management/api/v1/notifications");await qt.put(w,{withCredentials:!0})}catch(b){console.log(b),S.pushError(((g=(f=b.response)==null?void 0:f.data)==null?void 0:g.errorMessage)||"Have error when get notification list")}await a()},c=async(f,g)=>{var b,w;try{const x=t||`/notification-management/api/v1/notifications/${f}`,E=e+x;await qt.put(E,{isRead:g},{withCredentials:!0})}catch(x){S.pushError(((w=(b=x.response)==null?void 0:b.data)==null?void 0:w.errorMessage)||"Have error when get notification list")}await a()},u=[{id:"all",tabTitle:`All (${((d=r==null?void 0:r.all)==null?void 0:d.total)||0})`,children:p.jsx(Bi,{notidata:((h=r==null?void 0:r.all)==null?void 0:h.rows)||[],handleUpdateRead:c,handleUpdateReadAll:l})},{id:"unread",tabTitle:`Unread (${((m=r==null?void 0:r.unread)==null?void 0:m.total)||0})`,children:p.jsx(Bi,{notidata:((y=r==null?void 0:r.unread)==null?void 0:y.rows)||[],handleUpdateRead:c,handleUpdateReadAll:l})}];return p.jsx(p.Fragment,{children:p.jsx("div",{style:{position:"absolute",backgroundColor:"#fff",width:"550px",height:"90vh",right:"100px",top:"100%",padding:"32px",boxShadow:"10px 0px 20px #999",borderRadius:"0 0 8px 8px",overflow:"hidden"},children:p.jsxs("div",{className:"list-content",children:[p.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[p.jsx("h3",{style:{fontSize:"24px",fontWeight:"500"},className:"list-title",children:"Notifications"}),p.jsx("button",{onClick:n,children:p.jsx("svg",{width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p.jsx("path",{d:"M7.05086 6.13616C6.66033 5.74563 6.02717 5.74563 5.63664 6.13616C5.24612 6.52668 5.24612 7.15984 5.63664 7.55037L10.5864 12.5001L5.63664 17.4499C5.24612 17.8404 5.24612 18.4736 5.63664 18.8641C6.02717 19.2546 6.66033 19.2546 7.05086 18.8641L12.0006 13.9143L16.9504 18.8641C17.3409 19.2546 17.974 19.2546 18.3646 18.8641C18.7551 18.4736 18.7551 17.8404 18.3646 17.4499L13.4148 12.5001L18.3646 7.55037C18.7551 7.15984 18.7551 6.52668 18.3646 6.13616C17.974 5.74563 17.3409 5.74563 16.9504 6.13616L12.0006 11.0859L7.05086 6.13616Z",fill:"#85858A"})})})]}),p.jsx(Sc,{tabs:u,setCurrentTab:s,currentTab:o})]})})})};function Tc({primaryColor:e="#009d4f",baseUrl:t,notiPath:n}){var c,u;const{isOpen:r,toggleOpen:i}=_.useContext(S.CustomOpenList),{notidata:o,setNotiData:s}=_.useContext(S.CustomOpenList),a=Go({baseUrl:t,notiPath:n,setNotiData:s}),l=async()=>{var d,h;try{await a()}catch(m){S.pushError(((h=(d=m.response)==null?void 0:d.data)==null?void 0:h.errorMessage)||"Have error when get notification list")}};return _.useEffect(()=>{l()},[r]),p.jsxs("div",{children:[p.jsxs("div",{style:{position:"relative"},children:[p.jsxs("svg",{width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:i,style:{cursor:"pointer"},children:[p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.7968 17.4705C16.5901 17.4705 18.8076 16.8556 19.0218 14.3874C19.0218 11.921 17.4757 12.0796 17.4757 9.05334C17.4757 6.68952 15.2352 4 11.7968 4C8.35833 4 6.1178 6.68952 6.1178 9.05334C6.1178 12.0796 4.57178 11.921 4.57178 14.3874C4.78679 16.8649 7.00428 17.4705 11.7968 17.4705Z",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M13.8274 20.0286C12.6679 21.3161 10.8591 21.3313 9.68848 20.0286",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),(o==null?void 0:o.unread)&&(o==null?void 0:o.unread.total)!=0&&p.jsx("span",{style:{position:"absolute",top:"-9px",right:"-6px",background:`${Ho.color.dangerDark}`,width:"20px",height:"20px",border:"1px solid #fff",borderRadius:"50%",color:"#fff",fontSize:"12px",display:"flex",alignItems:"center",justifyContent:"center"},className:"notification-badge",children:((c=o==null?void 0:o.unread)==null?void 0:c.total)>9?"9+":`${(u=o==null?void 0:o.unread)==null?void 0:u.total}`})]}),!r&&p.jsx(Cc,{baseUrl:t,notiPath:n})]})}const _c=`*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}
|
|
3
3
|
`;function qo({children:e,styles:t=[],...n}){return p.jsxs(S.C.div,{...n,children:[[_c,...t].map((r,i)=>p.jsx("style",{type:"text/css",children:r},i)),e]})}const Pc=`.avatar-dropdown-item{padding:.5rem;font-size:.875rem;line-height:1.25rem;cursor:pointer;border-radius:.25rem}.avartarDropdownMenu{background-color:#fff;padding:.5rem;width:13rem;--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);position:absolute;left:-10rem;top:3.2rem}.avartarDropdownMenu ul{list-style:none;padding-inline-start:0;margin-block-end:0}.navbar{position:fixed;display:flex;z-index:30;background:#292929;top:0;width:100%;padding-left:2.5rem;height:64px}.navbar-container{display:flex;flex-direction:row;align-items:center;width:100%;justify-content:space-between}.logo-container{padding:16px 0;height:100%}.right-side-container{display:flex;flex-direction:row;align-items:center;text-align:center;margin-right:2.5rem;gap:1rem}.userContainer{display:flex;align-items:center;gap:.5rem}.languageDropdown{height:100%;padding:0 8px;display:flex;flex-direction:row;gap:8px;border-radius:3px;align-items:center;justify-content:center;height:41px;background-color:#ffffff1a;cursor:pointer;transition:background-color .2s ease-in-out}.languageDropdown:hover{background-color:#fff3}.userFullName{color:#fff;font-weight:400;font-size:.875rem;line-height:1.25rem}.userAvatar{width:2.5rem;height:2.5rem;cursor:pointer;-o-object-fit:cover;object-fit:cover;border-radius:9999px;border:2px solid #FFFFFF}.userAvatarNull{width:2.5rem;height:2.5rem;background:#DDDDDD;border-radius:100%;color:#fff;font-size:20px;font-weight:400;display:flex;align-items:center;justify-content:center}.relative{position:relative}.cursor-pointer{cursor:pointer}
|
|
4
4
|
`,Ac=`.tab-title{min-width:90px;padding:5px 16px;font-size:14px;font-weight:500;color:#c5c5c5;transition:all .3s ease-in-out;position:relative}.tab-title.is-active{color:#2e7d32}.tab-title.is-active:before{transition:all .3s ease-in-out;position:absolute;content:"";width:100%;height:100%;top:0;left:0;border-bottom:2px solid #2E7D32}.tab-content{padding:16px 0}
|
|
5
5
|
`,kc=`:root{--textPrimary: #292929;--textWhite: #fff;--primary500: #2E7D32;--grey100: #FAFAFA;--gray200: #EEEEEE;--gray600: #85858A;--link: #007BFF }.list-content{overflow-y:auto;overflow-x:hidden}.mark-all-read{text-align:right;color:#007bff;margin-bottom:12px;font-size:12px}.notification-items__wrapper{overflow:hidden}.notification-items__content{height:calc(100vh - 275px);overflow-x:hidden;overflow-y:auto}.notitification-item__container{display:flex;align-items:center;justify-content:space-between;padding:16px;border-bottom:#FAFAFA 1px solid;text-align:left;font-size:12px;position:relative;z-index:10;cursor:pointer;border-radius:4px;margin-bottom:8px}.notitification-item__container:hover{background-color:#fafafa}.notitification-item__container:not(:last-child):before{position:absolute;content:"";width:100%;bottom:-5px;left:0;border:1px solid #FAFAFA}.notitification-item__container:hover:before{opacity:1}.notification-item__image-container{width:40px;height:40px;display:flex;justify-content:center;align-items:center;border-radius:50%;overflow:hidden;margin-right:16px}.notification-item__image-container img{width:100%;height:100%;text-align:center;-o-object-fit:cover;object-fit:cover;color:transparent;text-indent:10000px}.notification-item__context-link{color:#007bff}.notification-item__content{width:62%;padding-right:16px}.notification-item__user-name{margin-bottom:2px;font-size:14px}.notification-item__time{margin-right:15px;text-align:right}.notification-item__read-at{border-width:2px;border-style:solid;border-radius:50%;width:10px;height:10px;display:block;position:relative}.notification-item__read-at:before{position:absolute;top:-30px;right:0;width:91px;background-color:#85858a;color:#fff;border-radius:4px;font-size:10px;text-align:center;padding:4px;opacity:0;visibility:hidden;transition:all .3s cubic-bezier(.39,.575,.565,1)}.notification-item__read-at:hover:before{opacity:1;visibility:visible}.notification-item__read-at.read:before{content:"Mark as unread"}.notification-item__read-at.unread:before{content:"Mark as read"}.notification-item__read-at.read{border-color:#eee}.notification-item__read-at.unread{border-color:#2e7d32;background-color:#2e7d32}
|
package/dist/components/index.js
CHANGED
|
@@ -376,61 +376,67 @@ function Au({
|
|
|
376
376
|
};
|
|
377
377
|
return be(() => {
|
|
378
378
|
l();
|
|
379
|
-
}, [
|
|
380
|
-
/* @__PURE__ */ k(
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
379
|
+
}, [r]), /* @__PURE__ */ k("div", { children: [
|
|
380
|
+
/* @__PURE__ */ k("div", { style: { position: "relative" }, children: [
|
|
381
|
+
/* @__PURE__ */ k(
|
|
382
|
+
"svg",
|
|
383
|
+
{
|
|
384
|
+
width: "24",
|
|
385
|
+
height: "25",
|
|
386
|
+
viewBox: "0 0 24 25",
|
|
387
|
+
fill: "none",
|
|
388
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
389
|
+
onClick: i,
|
|
390
|
+
style: { cursor: "pointer" },
|
|
391
|
+
children: [
|
|
392
|
+
/* @__PURE__ */ g(
|
|
393
|
+
"path",
|
|
394
|
+
{
|
|
395
|
+
fillRule: "evenodd",
|
|
396
|
+
clipRule: "evenodd",
|
|
397
|
+
d: "M11.7968 17.4705C16.5901 17.4705 18.8076 16.8556 19.0218 14.3874C19.0218 11.921 17.4757 12.0796 17.4757 9.05334C17.4757 6.68952 15.2352 4 11.7968 4C8.35833 4 6.1178 6.68952 6.1178 9.05334C6.1178 12.0796 4.57178 11.921 4.57178 14.3874C4.78679 16.8649 7.00428 17.4705 11.7968 17.4705Z",
|
|
398
|
+
stroke: e,
|
|
399
|
+
strokeWidth: "1.5",
|
|
400
|
+
strokeLinecap: "round",
|
|
401
|
+
strokeLinejoin: "round"
|
|
402
|
+
}
|
|
403
|
+
),
|
|
404
|
+
/* @__PURE__ */ g(
|
|
405
|
+
"path",
|
|
406
|
+
{
|
|
407
|
+
d: "M13.8274 20.0286C12.6679 21.3161 10.8591 21.3313 9.68848 20.0286",
|
|
408
|
+
stroke: e,
|
|
409
|
+
strokeWidth: "1.5",
|
|
410
|
+
strokeLinecap: "round",
|
|
411
|
+
strokeLinejoin: "round"
|
|
412
|
+
}
|
|
413
|
+
)
|
|
414
|
+
]
|
|
415
|
+
}
|
|
416
|
+
),
|
|
417
|
+
(s == null ? void 0 : s.unread) && (s == null ? void 0 : s.unread.total) != 0 && /* @__PURE__ */ g(
|
|
418
|
+
"span",
|
|
419
|
+
{
|
|
420
|
+
style: {
|
|
421
|
+
position: "absolute",
|
|
422
|
+
top: "-9px",
|
|
423
|
+
right: "-6px",
|
|
424
|
+
background: `${va.dangerDark}`,
|
|
425
|
+
width: "20px",
|
|
426
|
+
height: "20px",
|
|
427
|
+
border: "1px solid #fff",
|
|
428
|
+
borderRadius: "50%",
|
|
429
|
+
color: "#fff",
|
|
430
|
+
fontSize: "12px",
|
|
431
|
+
display: "flex",
|
|
432
|
+
alignItems: "center",
|
|
433
|
+
justifyContent: "center"
|
|
434
|
+
},
|
|
435
|
+
className: "notification-badge",
|
|
436
|
+
children: ((c = s == null ? void 0 : s.unread) == null ? void 0 : c.total) > 9 ? "9+" : `${(u = s == null ? void 0 : s.unread) == null ? void 0 : u.total}`
|
|
437
|
+
}
|
|
438
|
+
)
|
|
439
|
+
] }),
|
|
434
440
|
!r && /* @__PURE__ */ g(Pu, { baseUrl: t, notiPath: n })
|
|
435
441
|
] });
|
|
436
442
|
}
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../index-ea3fddce.cjs");const e=require("../index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../index-ea3fddce.cjs");const e=require("../index-f93fc96f.cjs");exports.TopBar=e.TopBar;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../index-ea3fddce.cjs");const e=require("../index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../index-ea3fddce.cjs");const e=require("../index-f93fc96f.cjs");exports.HasPermission=e.HasPermission;exports.getUseHasPermission=e.getUseHasPermission;
|
|
@@ -20987,61 +20987,67 @@ function wN({
|
|
|
20987
20987
|
};
|
|
20988
20988
|
return se.useEffect(() => {
|
|
20989
20989
|
y();
|
|
20990
|
-
}, [
|
|
20991
|
-
/* @__PURE__ */ G.jsxs(
|
|
20992
|
-
|
|
20993
|
-
|
|
20994
|
-
|
|
20995
|
-
|
|
20996
|
-
|
|
20997
|
-
|
|
20998
|
-
|
|
20999
|
-
|
|
21000
|
-
|
|
21001
|
-
|
|
21002
|
-
|
|
21003
|
-
|
|
21004
|
-
|
|
21005
|
-
|
|
21006
|
-
|
|
21007
|
-
|
|
21008
|
-
|
|
21009
|
-
|
|
21010
|
-
|
|
21011
|
-
|
|
21012
|
-
|
|
21013
|
-
|
|
21014
|
-
|
|
21015
|
-
|
|
21016
|
-
|
|
21017
|
-
|
|
21018
|
-
|
|
21019
|
-
|
|
21020
|
-
|
|
21021
|
-
|
|
21022
|
-
|
|
21023
|
-
|
|
21024
|
-
|
|
21025
|
-
|
|
21026
|
-
|
|
21027
|
-
|
|
21028
|
-
|
|
21029
|
-
|
|
21030
|
-
|
|
21031
|
-
|
|
21032
|
-
|
|
21033
|
-
|
|
21034
|
-
|
|
21035
|
-
|
|
21036
|
-
|
|
21037
|
-
|
|
21038
|
-
|
|
21039
|
-
|
|
21040
|
-
|
|
21041
|
-
|
|
21042
|
-
|
|
21043
|
-
|
|
21044
|
-
|
|
20990
|
+
}, [i]), /* @__PURE__ */ G.jsxs("div", { children: [
|
|
20991
|
+
/* @__PURE__ */ G.jsxs("div", { style: { position: "relative" }, children: [
|
|
20992
|
+
/* @__PURE__ */ G.jsxs(
|
|
20993
|
+
"svg",
|
|
20994
|
+
{
|
|
20995
|
+
width: "24",
|
|
20996
|
+
height: "25",
|
|
20997
|
+
viewBox: "0 0 24 25",
|
|
20998
|
+
fill: "none",
|
|
20999
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
21000
|
+
onClick: a,
|
|
21001
|
+
style: { cursor: "pointer" },
|
|
21002
|
+
children: [
|
|
21003
|
+
/* @__PURE__ */ G.jsx(
|
|
21004
|
+
"path",
|
|
21005
|
+
{
|
|
21006
|
+
fillRule: "evenodd",
|
|
21007
|
+
clipRule: "evenodd",
|
|
21008
|
+
d: "M11.7968 17.4705C16.5901 17.4705 18.8076 16.8556 19.0218 14.3874C19.0218 11.921 17.4757 12.0796 17.4757 9.05334C17.4757 6.68952 15.2352 4 11.7968 4C8.35833 4 6.1178 6.68952 6.1178 9.05334C6.1178 12.0796 4.57178 11.921 4.57178 14.3874C4.78679 16.8649 7.00428 17.4705 11.7968 17.4705Z",
|
|
21009
|
+
stroke: e,
|
|
21010
|
+
strokeWidth: "1.5",
|
|
21011
|
+
strokeLinecap: "round",
|
|
21012
|
+
strokeLinejoin: "round"
|
|
21013
|
+
}
|
|
21014
|
+
),
|
|
21015
|
+
/* @__PURE__ */ G.jsx(
|
|
21016
|
+
"path",
|
|
21017
|
+
{
|
|
21018
|
+
d: "M13.8274 20.0286C12.6679 21.3161 10.8591 21.3313 9.68848 20.0286",
|
|
21019
|
+
stroke: e,
|
|
21020
|
+
strokeWidth: "1.5",
|
|
21021
|
+
strokeLinecap: "round",
|
|
21022
|
+
strokeLinejoin: "round"
|
|
21023
|
+
}
|
|
21024
|
+
)
|
|
21025
|
+
]
|
|
21026
|
+
}
|
|
21027
|
+
),
|
|
21028
|
+
(u == null ? void 0 : u.unread) && (u == null ? void 0 : u.unread.total) != 0 && /* @__PURE__ */ G.jsx(
|
|
21029
|
+
"span",
|
|
21030
|
+
{
|
|
21031
|
+
style: {
|
|
21032
|
+
position: "absolute",
|
|
21033
|
+
top: "-9px",
|
|
21034
|
+
right: "-6px",
|
|
21035
|
+
background: `${Pd.dangerDark}`,
|
|
21036
|
+
width: "20px",
|
|
21037
|
+
height: "20px",
|
|
21038
|
+
border: "1px solid #fff",
|
|
21039
|
+
borderRadius: "50%",
|
|
21040
|
+
color: "#fff",
|
|
21041
|
+
fontSize: "12px",
|
|
21042
|
+
display: "flex",
|
|
21043
|
+
alignItems: "center",
|
|
21044
|
+
justifyContent: "center"
|
|
21045
|
+
},
|
|
21046
|
+
className: "notification-badge",
|
|
21047
|
+
children: ((x = u == null ? void 0 : u.unread) == null ? void 0 : x.total) > 9 ? "9+" : `${(S = u == null ? void 0 : u.unread) == null ? void 0 : S.total}`
|
|
21048
|
+
}
|
|
21049
|
+
)
|
|
21050
|
+
] }),
|
|
21045
21051
|
!i && /* @__PURE__ */ G.jsx(bN, { baseUrl: t, notiPath: n })
|
|
21046
21052
|
] });
|
|
21047
21053
|
}
|
|
@@ -1059,7 +1059,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
1059
1059
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1060
1060
|
* See the License for the specific language governing permissions and
|
|
1061
1061
|
* limitations under the License.
|
|
1062
|
-
*/function Sv(e=dI()){return zL().then(t=>{if(!t)throw rn.create("unsupported-browser")},t=>{throw rn.create("indexed-db-unsupported")}),yh(gh(e),"messaging").getImmediate()}async function GL(e,t){return e=gh(e),_v(e,t)}function KL(e,t){return e=gh(e),VL(e,t)}qL();const XL=e=>{"serviceWorker"in navigator&&navigator.serviceWorker.register(e.path).then(function(t){console.log("Registration successful, scope is:",t.scope),console.log("initialize service worker props ",e);const n=Sv(vh({apiKey:e.apiKey,authDomain:e.authDomain,projectId:e.projectId,storageBucket:e.storageBucket,messagingSenderId:e.messagingSenderId,appId:e.appId,measurementId:e.measurementId}));GL(n,{serviceWorkerRegistration:t,vapidKey:e.vapidKey}).then(async i=>{var a,u;if(i){console.log("current token for client: ",i);try{const f="/notification-management/api/v1/notifications/registrations",m=e.baseUrl+f;await C.axios.post(m,{deviceToken:i},{withCredentials:!0})}catch(f){console.log(f),C.pushError(((u=(a=f.response)==null?void 0:a.data)==null?void 0:u.errorMessage)||"Have error when get notification list")}}else console.log("No registration token available. Request permission to generate one.")}).catch(i=>{console.log("An error occurred while retrieving token. ",i)})}).catch(function(t){console.log("Service worker registration failed, error:",t)})},ZL=new BroadcastChannel("my-channel");ZL.onmessage=e=>{console.log("Broadcast chanel message",e)};const JL=e=>new Promise(t=>{const n=Sv(vh({apiKey:e.apiKey,authDomain:e.authDomain,projectId:e.projectId,storageBucket:e.storageBucket,messagingSenderId:e.messagingSenderId,appId:e.appId,measurementId:e.measurementId}));KL(n,i=>{console.log("payload",i),t(i)})}),ls={"subscription-diaglog":"_subscription-diaglog_12x9u_2","subscription-container":"_subscription-container_12x9u_15","subscription-title":"_subscription-title_12x9u_24","subscription-text":"_subscription-text_12x9u_33","subscription-btn__container":"_subscription-btn__container_12x9u_37","btn-success":"_btn-success_12x9u_43","btn-cancel":"_btn-cancel_12x9u_44"},QL=["granted","denied"],eN=e=>{const[t,n]=C.reactExports.useState(!1),i=()=>{Notification.requestPermission(function(u){u==="granted"&&XL(e),QL.includes(u)&&n(!0)})},a=()=>{n(!0)};return C.jsxRuntimeExports.jsx(C.jsxRuntimeExports.Fragment,{children:t?"":C.jsxRuntimeExports.jsx("div",{className:ls["subscription-diaglog"],children:C.jsxRuntimeExports.jsxs("div",{className:ls["subscription-container"],children:[C.jsxRuntimeExports.jsx("h4",{className:ls["subscription-title"],children:"Notification"}),C.jsxRuntimeExports.jsx("p",{className:ls["subscription-text"],children:"Option to receive notifications about the latest information. You can turn them off at any time."}),C.jsxRuntimeExports.jsxs("div",{className:ls["subscription-btn__container"],children:[C.jsxRuntimeExports.jsx("button",{className:ls["btn-cancel"],onClick:a,children:"Not now"}),C.jsxRuntimeExports.jsx("button",{className:ls["btn-success"],onClick:i,children:"Turn on"})]})]})})})},zu={"notification-massage_container":"_notification-massage_container_ql4az_1","notification-name":"_notification-name_ql4az_18","notification-message_service":"_notification-message_service_ql4az_23","notification-message_button-close":"_notification-message_button-close_ql4az_27"},tN=e=>{const[t,n]=C.reactExports.useState({userName:"",message:"",context:""}),{setNotiData:i}=C.reactExports.useContext(na);function a(){return C.jsxRuntimeExports.jsx("div",{className:zu["notification-massage_container"],children:C.jsxRuntimeExports.jsxs("div",{className:zu["notification-massage_content"],children:[C.jsxRuntimeExports.jsx("h6",{className:zu["notification-name"],children:t==null?void 0:t.userName}),C.jsxRuntimeExports.jsxs("div",{className:zu["notification-message_service"],children:[C.jsxRuntimeExports.jsxs("span",{children:[`${t==null?void 0:t.message} `," "]}),C.jsxRuntimeExports.jsx("span",{children:t==null?void 0:t.context})]})]})})}return C.reactExports.useEffect(()=>{t&&Notification.permission==="granted"&&t.userName&&t.message&&t.context&&C.notify(C.jsxRuntimeExports.jsx(a,{}))},[t]),JL(e).then(u=>{var f,m,y;console.log(u),n({userName:(f=u==null?void 0:u.data)==null?void 0:f.userName,message:(m=u==null?void 0:u.data)==null?void 0:m.message,context:(y=u==null?void 0:u.data)==null?void 0:y.context}),i(w=>{var S;return{...w,unread:{...w.unread,total:((S=w.unread)==null?void 0:S.total)+1}}})}).catch(u=>console.log("failed: ",u)),C.jsxRuntimeExports.jsx("div",{children:"Notification"in window&&Notification.permission==="default"?C.jsxRuntimeExports.jsx(eN,{...e}):""})},kv=({baseUrl:e,notiPath:t,setNotiData:n})=>async()=>{const u=e+(t||"/notification-management/api/v1/notifications"),f=await C.axios.get(u,{params:{filter:{notificationFilterType:"all"}},withCredentials:!0}),m=await C.axios.get(u,{params:{filter:{notificationFilterType:"unread"}},withCredentials:!0});Promise.all([f,m]).then(y=>{var w,S,R,T;console.log("result: "+y),n({all:{rows:(w=y[0].data)==null?void 0:w.rows,total:(S=y[0].data)==null?void 0:S.total},unread:{rows:(R=y[1].data)==null?void 0:R.rows,total:(T=y[1].data)==null?void 0:T.total}})})},nN=({baseUrl:e,notiPath:t})=>{var R,T,H,F;const{setShowModalFalse:n}=C.reactExports.useContext(na),{notidata:i,setNotiData:a}=C.reactExports.useContext(na);console.log(i);const[u,f]=C.reactExports.useState("all"),m=kv({baseUrl:e,notiPath:t,setNotiData:a}),y=async()=>{var I,Z;try{const oe=e+(t||"/notification-management/api/v1/notifications");await C.axios.put(oe,{withCredentials:!0})}catch(Y){console.log(Y),C.pushError(((Z=(I=Y.response)==null?void 0:I.data)==null?void 0:Z.errorMessage)||"Have error when get notification list")}await m()},w=async(I,Z)=>{var Y,oe;try{const fe=t||`/notification-management/api/v1/notifications/${I}`,ue=e+fe;await C.axios.put(ue,{isRead:Z},{withCredentials:!0})}catch(fe){C.pushError(((oe=(Y=fe.response)==null?void 0:Y.data)==null?void 0:oe.errorMessage)||"Have error when get notification list")}await m()},S=[{id:"all",tabTitle:`All (${((R=i==null?void 0:i.all)==null?void 0:R.total)||0})`,children:C.jsxRuntimeExports.jsx(Sg,{notidata:((T=i==null?void 0:i.all)==null?void 0:T.rows)||[],handleUpdateRead:w,handleUpdateReadAll:y})},{id:"unread",tabTitle:`Unread (${((H=i==null?void 0:i.unread)==null?void 0:H.total)||0})`,children:C.jsxRuntimeExports.jsx(Sg,{notidata:((F=i==null?void 0:i.unread)==null?void 0:F.rows)||[],handleUpdateRead:w,handleUpdateReadAll:y})}];return C.jsxRuntimeExports.jsx(C.jsxRuntimeExports.Fragment,{children:C.jsxRuntimeExports.jsx("div",{style:{position:"absolute",backgroundColor:"#fff",width:"550px",height:"90vh",right:"100px",top:"100%",padding:"32px",boxShadow:"10px 0px 20px #999",borderRadius:"0 0 8px 8px",overflow:"hidden"},children:C.jsxRuntimeExports.jsxs("div",{className:"list-content",children:[C.jsxRuntimeExports.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[C.jsxRuntimeExports.jsx("h3",{style:{fontSize:"24px",fontWeight:"500"},className:"list-title",children:"Notifications"}),C.jsxRuntimeExports.jsx("button",{onClick:n,children:C.jsxRuntimeExports.jsx("svg",{width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:C.jsxRuntimeExports.jsx("path",{d:"M7.05086 6.13616C6.66033 5.74563 6.02717 5.74563 5.63664 6.13616C5.24612 6.52668 5.24612 7.15984 5.63664 7.55037L10.5864 12.5001L5.63664 17.4499C5.24612 17.8404 5.24612 18.4736 5.63664 18.8641C6.02717 19.2546 6.66033 19.2546 7.05086 18.8641L12.0006 13.9143L16.9504 18.8641C17.3409 19.2546 17.974 19.2546 18.3646 18.8641C18.7551 18.4736 18.7551 17.8404 18.3646 17.4499L13.4148 12.5001L18.3646 7.55037C18.7551 7.15984 18.7551 6.52668 18.3646 6.13616C17.974 5.74563 17.3409 5.74563 16.9504 6.13616L12.0006 11.0859L7.05086 6.13616Z",fill:"#85858A"})})})]}),C.jsxRuntimeExports.jsx(PS,{tabs:S,setCurrentTab:f,currentTab:u})]})})})};function rN({primaryColor:e="#009d4f",baseUrl:t,notiPath:n}){var w,S;const{isOpen:i,toggleOpen:a}=C.reactExports.useContext(na),{notidata:u,setNotiData:f}=C.reactExports.useContext(na),m=kv({baseUrl:t,notiPath:n,setNotiData:f}),y=async()=>{var R,T;try{await m()}catch(H){C.pushError(((T=(R=H.response)==null?void 0:R.data)==null?void 0:T.errorMessage)||"Have error when get notification list")}};return C.reactExports.useEffect(()=>{y()},[u]),C.jsxRuntimeExports.jsxs("div",{children:[C.jsxRuntimeExports.jsxs("svg",{width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:a,style:{cursor:"pointer"},children:[C.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.7968 17.4705C16.5901 17.4705 18.8076 16.8556 19.0218 14.3874C19.0218 11.921 17.4757 12.0796 17.4757 9.05334C17.4757 6.68952 15.2352 4 11.7968 4C8.35833 4 6.1178 6.68952 6.1178 9.05334C6.1178 12.0796 4.57178 11.921 4.57178 14.3874C4.78679 16.8649 7.00428 17.4705 11.7968 17.4705Z",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),C.jsxRuntimeExports.jsx("path",{d:"M13.8274 20.0286C12.6679 21.3161 10.8591 21.3313 9.68848 20.0286",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),(u==null?void 0:u.unread)&&(u==null?void 0:u.unread.total)!=0&&C.jsxRuntimeExports.jsx("span",{style:{position:"absolute",top:"14px",background:`${C.color.dangerDark}`,width:"18px",height:"18px",border:"1px solid #fff",borderRadius:"50%",color:"#fff",fontSize:"12px"},className:"notification-badge",children:((w=u==null?void 0:u.unread)==null?void 0:w.total)>9?"9+":`${(S=u==null?void 0:u.unread)==null?void 0:S.total}`}),!i&&C.jsxRuntimeExports.jsx(nN,{baseUrl:t,notiPath:n})]})}const iN=`.avatar-dropdown-item{padding:.5rem;font-size:.875rem;line-height:1.25rem;cursor:pointer;border-radius:.25rem}.avartarDropdownMenu{background-color:#fff;padding:.5rem;width:13rem;--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);position:absolute;left:-10rem;top:3.2rem}.avartarDropdownMenu ul{list-style:none;padding-inline-start:0;margin-block-end:0}.navbar{position:fixed;display:flex;z-index:30;background:#292929;top:0;width:100%;padding-left:2.5rem;height:64px}.navbar-container{display:flex;flex-direction:row;align-items:center;width:100%;justify-content:space-between}.logo-container{padding:16px 0;height:100%}.right-side-container{display:flex;flex-direction:row;align-items:center;text-align:center;margin-right:2.5rem;gap:1rem}.userContainer{display:flex;align-items:center;gap:.5rem}.languageDropdown{height:100%;padding:0 8px;display:flex;flex-direction:row;gap:8px;border-radius:3px;align-items:center;justify-content:center;height:41px;background-color:#ffffff1a;cursor:pointer;transition:background-color .2s ease-in-out}.languageDropdown:hover{background-color:#fff3}.userFullName{color:#fff;font-weight:400;font-size:.875rem;line-height:1.25rem}.userAvatar{width:2.5rem;height:2.5rem;cursor:pointer;-o-object-fit:cover;object-fit:cover;border-radius:9999px;border:2px solid #FFFFFF}.userAvatarNull{width:2.5rem;height:2.5rem;background:#DDDDDD;border-radius:100%;color:#fff;font-size:20px;font-weight:400;display:flex;align-items:center;justify-content:center}.relative{position:relative}.cursor-pointer{cursor:pointer}
|
|
1062
|
+
*/function Sv(e=dI()){return zL().then(t=>{if(!t)throw rn.create("unsupported-browser")},t=>{throw rn.create("indexed-db-unsupported")}),yh(gh(e),"messaging").getImmediate()}async function GL(e,t){return e=gh(e),_v(e,t)}function KL(e,t){return e=gh(e),VL(e,t)}qL();const XL=e=>{"serviceWorker"in navigator&&navigator.serviceWorker.register(e.path).then(function(t){console.log("Registration successful, scope is:",t.scope),console.log("initialize service worker props ",e);const n=Sv(vh({apiKey:e.apiKey,authDomain:e.authDomain,projectId:e.projectId,storageBucket:e.storageBucket,messagingSenderId:e.messagingSenderId,appId:e.appId,measurementId:e.measurementId}));GL(n,{serviceWorkerRegistration:t,vapidKey:e.vapidKey}).then(async i=>{var a,u;if(i){console.log("current token for client: ",i);try{const f="/notification-management/api/v1/notifications/registrations",m=e.baseUrl+f;await C.axios.post(m,{deviceToken:i},{withCredentials:!0})}catch(f){console.log(f),C.pushError(((u=(a=f.response)==null?void 0:a.data)==null?void 0:u.errorMessage)||"Have error when get notification list")}}else console.log("No registration token available. Request permission to generate one.")}).catch(i=>{console.log("An error occurred while retrieving token. ",i)})}).catch(function(t){console.log("Service worker registration failed, error:",t)})},ZL=new BroadcastChannel("my-channel");ZL.onmessage=e=>{console.log("Broadcast chanel message",e)};const JL=e=>new Promise(t=>{const n=Sv(vh({apiKey:e.apiKey,authDomain:e.authDomain,projectId:e.projectId,storageBucket:e.storageBucket,messagingSenderId:e.messagingSenderId,appId:e.appId,measurementId:e.measurementId}));KL(n,i=>{console.log("payload",i),t(i)})}),ls={"subscription-diaglog":"_subscription-diaglog_12x9u_2","subscription-container":"_subscription-container_12x9u_15","subscription-title":"_subscription-title_12x9u_24","subscription-text":"_subscription-text_12x9u_33","subscription-btn__container":"_subscription-btn__container_12x9u_37","btn-success":"_btn-success_12x9u_43","btn-cancel":"_btn-cancel_12x9u_44"},QL=["granted","denied"],eN=e=>{const[t,n]=C.reactExports.useState(!1),i=()=>{Notification.requestPermission(function(u){u==="granted"&&XL(e),QL.includes(u)&&n(!0)})},a=()=>{n(!0)};return C.jsxRuntimeExports.jsx(C.jsxRuntimeExports.Fragment,{children:t?"":C.jsxRuntimeExports.jsx("div",{className:ls["subscription-diaglog"],children:C.jsxRuntimeExports.jsxs("div",{className:ls["subscription-container"],children:[C.jsxRuntimeExports.jsx("h4",{className:ls["subscription-title"],children:"Notification"}),C.jsxRuntimeExports.jsx("p",{className:ls["subscription-text"],children:"Option to receive notifications about the latest information. You can turn them off at any time."}),C.jsxRuntimeExports.jsxs("div",{className:ls["subscription-btn__container"],children:[C.jsxRuntimeExports.jsx("button",{className:ls["btn-cancel"],onClick:a,children:"Not now"}),C.jsxRuntimeExports.jsx("button",{className:ls["btn-success"],onClick:i,children:"Turn on"})]})]})})})},zu={"notification-massage_container":"_notification-massage_container_ql4az_1","notification-name":"_notification-name_ql4az_18","notification-message_service":"_notification-message_service_ql4az_23","notification-message_button-close":"_notification-message_button-close_ql4az_27"},tN=e=>{const[t,n]=C.reactExports.useState({userName:"",message:"",context:""}),{setNotiData:i}=C.reactExports.useContext(na);function a(){return C.jsxRuntimeExports.jsx("div",{className:zu["notification-massage_container"],children:C.jsxRuntimeExports.jsxs("div",{className:zu["notification-massage_content"],children:[C.jsxRuntimeExports.jsx("h6",{className:zu["notification-name"],children:t==null?void 0:t.userName}),C.jsxRuntimeExports.jsxs("div",{className:zu["notification-message_service"],children:[C.jsxRuntimeExports.jsxs("span",{children:[`${t==null?void 0:t.message} `," "]}),C.jsxRuntimeExports.jsx("span",{children:t==null?void 0:t.context})]})]})})}return C.reactExports.useEffect(()=>{t&&Notification.permission==="granted"&&t.userName&&t.message&&t.context&&C.notify(C.jsxRuntimeExports.jsx(a,{}))},[t]),JL(e).then(u=>{var f,m,y;console.log(u),n({userName:(f=u==null?void 0:u.data)==null?void 0:f.userName,message:(m=u==null?void 0:u.data)==null?void 0:m.message,context:(y=u==null?void 0:u.data)==null?void 0:y.context}),i(w=>{var S;return{...w,unread:{...w.unread,total:((S=w.unread)==null?void 0:S.total)+1}}})}).catch(u=>console.log("failed: ",u)),C.jsxRuntimeExports.jsx("div",{children:"Notification"in window&&Notification.permission==="default"?C.jsxRuntimeExports.jsx(eN,{...e}):""})},kv=({baseUrl:e,notiPath:t,setNotiData:n})=>async()=>{const u=e+(t||"/notification-management/api/v1/notifications"),f=await C.axios.get(u,{params:{filter:{notificationFilterType:"all"}},withCredentials:!0}),m=await C.axios.get(u,{params:{filter:{notificationFilterType:"unread"}},withCredentials:!0});Promise.all([f,m]).then(y=>{var w,S,R,T;console.log("result: "+y),n({all:{rows:(w=y[0].data)==null?void 0:w.rows,total:(S=y[0].data)==null?void 0:S.total},unread:{rows:(R=y[1].data)==null?void 0:R.rows,total:(T=y[1].data)==null?void 0:T.total}})})},nN=({baseUrl:e,notiPath:t})=>{var R,T,H,F;const{setShowModalFalse:n}=C.reactExports.useContext(na),{notidata:i,setNotiData:a}=C.reactExports.useContext(na);console.log(i);const[u,f]=C.reactExports.useState("all"),m=kv({baseUrl:e,notiPath:t,setNotiData:a}),y=async()=>{var I,Z;try{const oe=e+(t||"/notification-management/api/v1/notifications");await C.axios.put(oe,{withCredentials:!0})}catch(Y){console.log(Y),C.pushError(((Z=(I=Y.response)==null?void 0:I.data)==null?void 0:Z.errorMessage)||"Have error when get notification list")}await m()},w=async(I,Z)=>{var Y,oe;try{const fe=t||`/notification-management/api/v1/notifications/${I}`,ue=e+fe;await C.axios.put(ue,{isRead:Z},{withCredentials:!0})}catch(fe){C.pushError(((oe=(Y=fe.response)==null?void 0:Y.data)==null?void 0:oe.errorMessage)||"Have error when get notification list")}await m()},S=[{id:"all",tabTitle:`All (${((R=i==null?void 0:i.all)==null?void 0:R.total)||0})`,children:C.jsxRuntimeExports.jsx(Sg,{notidata:((T=i==null?void 0:i.all)==null?void 0:T.rows)||[],handleUpdateRead:w,handleUpdateReadAll:y})},{id:"unread",tabTitle:`Unread (${((H=i==null?void 0:i.unread)==null?void 0:H.total)||0})`,children:C.jsxRuntimeExports.jsx(Sg,{notidata:((F=i==null?void 0:i.unread)==null?void 0:F.rows)||[],handleUpdateRead:w,handleUpdateReadAll:y})}];return C.jsxRuntimeExports.jsx(C.jsxRuntimeExports.Fragment,{children:C.jsxRuntimeExports.jsx("div",{style:{position:"absolute",backgroundColor:"#fff",width:"550px",height:"90vh",right:"100px",top:"100%",padding:"32px",boxShadow:"10px 0px 20px #999",borderRadius:"0 0 8px 8px",overflow:"hidden"},children:C.jsxRuntimeExports.jsxs("div",{className:"list-content",children:[C.jsxRuntimeExports.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[C.jsxRuntimeExports.jsx("h3",{style:{fontSize:"24px",fontWeight:"500"},className:"list-title",children:"Notifications"}),C.jsxRuntimeExports.jsx("button",{onClick:n,children:C.jsxRuntimeExports.jsx("svg",{width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:C.jsxRuntimeExports.jsx("path",{d:"M7.05086 6.13616C6.66033 5.74563 6.02717 5.74563 5.63664 6.13616C5.24612 6.52668 5.24612 7.15984 5.63664 7.55037L10.5864 12.5001L5.63664 17.4499C5.24612 17.8404 5.24612 18.4736 5.63664 18.8641C6.02717 19.2546 6.66033 19.2546 7.05086 18.8641L12.0006 13.9143L16.9504 18.8641C17.3409 19.2546 17.974 19.2546 18.3646 18.8641C18.7551 18.4736 18.7551 17.8404 18.3646 17.4499L13.4148 12.5001L18.3646 7.55037C18.7551 7.15984 18.7551 6.52668 18.3646 6.13616C17.974 5.74563 17.3409 5.74563 16.9504 6.13616L12.0006 11.0859L7.05086 6.13616Z",fill:"#85858A"})})})]}),C.jsxRuntimeExports.jsx(PS,{tabs:S,setCurrentTab:f,currentTab:u})]})})})};function rN({primaryColor:e="#009d4f",baseUrl:t,notiPath:n}){var w,S;const{isOpen:i,toggleOpen:a}=C.reactExports.useContext(na),{notidata:u,setNotiData:f}=C.reactExports.useContext(na),m=kv({baseUrl:t,notiPath:n,setNotiData:f}),y=async()=>{var R,T;try{await m()}catch(H){C.pushError(((T=(R=H.response)==null?void 0:R.data)==null?void 0:T.errorMessage)||"Have error when get notification list")}};return C.reactExports.useEffect(()=>{y()},[i]),C.jsxRuntimeExports.jsxs("div",{children:[C.jsxRuntimeExports.jsxs("div",{style:{position:"relative"},children:[C.jsxRuntimeExports.jsxs("svg",{width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:a,style:{cursor:"pointer"},children:[C.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.7968 17.4705C16.5901 17.4705 18.8076 16.8556 19.0218 14.3874C19.0218 11.921 17.4757 12.0796 17.4757 9.05334C17.4757 6.68952 15.2352 4 11.7968 4C8.35833 4 6.1178 6.68952 6.1178 9.05334C6.1178 12.0796 4.57178 11.921 4.57178 14.3874C4.78679 16.8649 7.00428 17.4705 11.7968 17.4705Z",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),C.jsxRuntimeExports.jsx("path",{d:"M13.8274 20.0286C12.6679 21.3161 10.8591 21.3313 9.68848 20.0286",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),(u==null?void 0:u.unread)&&(u==null?void 0:u.unread.total)!=0&&C.jsxRuntimeExports.jsx("span",{style:{position:"absolute",top:"-9px",right:"-6px",background:`${C.color.dangerDark}`,width:"20px",height:"20px",border:"1px solid #fff",borderRadius:"50%",color:"#fff",fontSize:"12px",display:"flex",alignItems:"center",justifyContent:"center"},className:"notification-badge",children:((w=u==null?void 0:u.unread)==null?void 0:w.total)>9?"9+":`${(S=u==null?void 0:u.unread)==null?void 0:S.total}`})]}),!i&&C.jsxRuntimeExports.jsx(nN,{baseUrl:t,notiPath:n})]})}const iN=`.avatar-dropdown-item{padding:.5rem;font-size:.875rem;line-height:1.25rem;cursor:pointer;border-radius:.25rem}.avartarDropdownMenu{background-color:#fff;padding:.5rem;width:13rem;--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);position:absolute;left:-10rem;top:3.2rem}.avartarDropdownMenu ul{list-style:none;padding-inline-start:0;margin-block-end:0}.navbar{position:fixed;display:flex;z-index:30;background:#292929;top:0;width:100%;padding-left:2.5rem;height:64px}.navbar-container{display:flex;flex-direction:row;align-items:center;width:100%;justify-content:space-between}.logo-container{padding:16px 0;height:100%}.right-side-container{display:flex;flex-direction:row;align-items:center;text-align:center;margin-right:2.5rem;gap:1rem}.userContainer{display:flex;align-items:center;gap:.5rem}.languageDropdown{height:100%;padding:0 8px;display:flex;flex-direction:row;gap:8px;border-radius:3px;align-items:center;justify-content:center;height:41px;background-color:#ffffff1a;cursor:pointer;transition:background-color .2s ease-in-out}.languageDropdown:hover{background-color:#fff3}.userFullName{color:#fff;font-weight:400;font-size:.875rem;line-height:1.25rem}.userAvatar{width:2.5rem;height:2.5rem;cursor:pointer;-o-object-fit:cover;object-fit:cover;border-radius:9999px;border:2px solid #FFFFFF}.userAvatarNull{width:2.5rem;height:2.5rem;background:#DDDDDD;border-radius:100%;color:#fff;font-size:20px;font-weight:400;display:flex;align-items:center;justify-content:center}.relative{position:relative}.cursor-pointer{cursor:pointer}
|
|
1063
1063
|
`,sN=`.tab-title{min-width:90px;padding:5px 16px;font-size:14px;font-weight:500;color:#c5c5c5;transition:all .3s ease-in-out;position:relative}.tab-title.is-active{color:#2e7d32}.tab-title.is-active:before{transition:all .3s ease-in-out;position:absolute;content:"";width:100%;height:100%;top:0;left:0;border-bottom:2px solid #2E7D32}.tab-content{padding:16px 0}
|
|
1064
1064
|
`,aN=`:root{--textPrimary: #292929;--textWhite: #fff;--primary500: #2E7D32;--grey100: #FAFAFA;--gray200: #EEEEEE;--gray600: #85858A;--link: #007BFF }.list-content{overflow-y:auto;overflow-x:hidden}.mark-all-read{text-align:right;color:#007bff;margin-bottom:12px;font-size:12px}.notification-items__wrapper{overflow:hidden}.notification-items__content{height:calc(100vh - 275px);overflow-x:hidden;overflow-y:auto}.notitification-item__container{display:flex;align-items:center;justify-content:space-between;padding:16px;border-bottom:#FAFAFA 1px solid;text-align:left;font-size:12px;position:relative;z-index:10;cursor:pointer;border-radius:4px;margin-bottom:8px}.notitification-item__container:hover{background-color:#fafafa}.notitification-item__container:not(:last-child):before{position:absolute;content:"";width:100%;bottom:-5px;left:0;border:1px solid #FAFAFA}.notitification-item__container:hover:before{opacity:1}.notification-item__image-container{width:40px;height:40px;display:flex;justify-content:center;align-items:center;border-radius:50%;overflow:hidden;margin-right:16px}.notification-item__image-container img{width:100%;height:100%;text-align:center;-o-object-fit:cover;object-fit:cover;color:transparent;text-indent:10000px}.notification-item__context-link{color:#007bff}.notification-item__content{width:62%;padding-right:16px}.notification-item__user-name{margin-bottom:2px;font-size:14px}.notification-item__time{margin-right:15px;text-align:right}.notification-item__read-at{border-width:2px;border-style:solid;border-radius:50%;width:10px;height:10px;display:block;position:relative}.notification-item__read-at:before{position:absolute;top:-30px;right:0;width:91px;background-color:#85858a;color:#fff;border-radius:4px;font-size:10px;text-align:center;padding:4px;opacity:0;visibility:hidden;transition:all .3s cubic-bezier(.39,.575,.565,1)}.notification-item__read-at:hover:before{opacity:1;visibility:visible}.notification-item__read-at.read:before{content:"Mark as unread"}.notification-item__read-at.unread:before{content:"Mark as read"}.notification-item__read-at.read{border-color:#eee}.notification-item__read-at.unread{border-color:#2e7d32;background-color:#2e7d32}
|
|
1065
1065
|
`,oN=`._notification-massage_container_ql4az_1{background:#fff;padding:0 64px 0 84px;border-radius:8px;font-family:TT Firs Neue Trl,sans-serif}._notification-massage_container_ql4az_1:before{position:absolute;content:"";width:48px;height:48px;background:url(https://ukpcsaprod.blob.core.windows.net/saas/notification-icon.svg) no-repeat center/100%;top:12px;left:24px}._notification-name_ql4az_18{font-weight:500;font-size:14px}._notification-message_service_ql4az_23{font-size:12px}._notification-message_button-close_ql4az_27{position:absolute;top:12px;right:24px;width:24px;height:24px}
|