1"use strict";(self.webpackChunk_termly_web_dashboard=self.webpackChunk_termly_web_dashboard||[]).push([[1995],{38153(e,t,s){s.d(t,{A:()=>w,h:()=>y});var n=s(53241),a=s(26826),l=s.n(a),o=s(14712),r=s.n(o),i=s(71451);function c(e){const{ariaLabel:t,children:s,handleClickOutside:a}=e,{formatMessage:l}=(0,i.A)(),{closedby:o,dialogRef:c,onCancel:p,onClose:m}=function(e){let{handleCancel:t}=e;const s=(0,n.useRef)(null);return(0,n.useLayoutEffect)(()=>{const e=s.current;return e.showModal(),()=>{e.close()}},[]),{closedby:t?"closerequest":"none",dialogRef:s,onCancel:()=>{t&&t()},onClose:()=>{if(t)return;const e=s.current;e&&e.showModal()}}}({handleCancel:a}),f=t?.id&&t?.defaultMessage?l(t,t.values):t,h=(0,n.useCallback)(e=>{a&&(e.stopPropagation(),a())},[a]),g=r()("styles-container-c40d76","t-container");return n.createElement("dialog",{"aria-label":f,className:"styles-root-d5607d",closedby:o,onCancel:p,onClick:h,onClose:m,ref:c},n.createElement("div",{className:"styles-viewport-d423a4"},n.createElement("div",{className:g,onClick:u,onKeyDown:d},s)))}function u(e){e.stopPropagation()}function d(e){e.stopPropagation()}c.propTypes={ariaLabel:l().oneOfType([l().string,l().shape({defaultMessage:l().string.isRequired,id:l().string.isRequired,values:l().shape({})})]),children:l().node,handleClickOutside:l().func};const p=c,m=s.p+"close-icon-b4c3f3.svg",f=(0,s(63510).YK)({ariaLabel:{defaultMessage:"Close modal",id:"modal-content.aria-label"}});function h(e){let{children:t,handleClose:s}=e;const{formatMessage:a}=(0,i.A)();return n.createElement("div",{className:"styles-root-f2cc1c"},function(e){let{formatMessage:t,handleClose:s}=e;if(!s)return null;const a=t(f.ariaLabel);return n.createElement("button",{"aria-label":a,className:"styles-closeButton-ff8bdc",onClick:e=>{e.stopPropagation(),s()},type:"button"},n.createElement("img",{alt:"","aria-hidden":"true",src:m}))}({formatMessage:a,handleClose:s}),t)}h.propTypes={children:l().node.isRequired,handleClose:l().func};const g=h,b=(0,n.createContext)();function y(){return(0,n.useContext)(b)}function C(e){let{children:t}=e;
1const s=(0,n.useRef)(null),[a,l]=(0,n.useState)(!1),[o,r]=(0,n.useState)(!0),[i,c]=(0,n.useState)({ariaLabel:void 0,content:null}),u=(0,n.useCallback)(()=>{l(!1),s.current?.focus(),s.current=null},[]),d=(0,n.useCallback)(()=>{s.current=document.activeElement,l(!0)},[]),m=(0,n.useCallback)(e=>{c(t=>({...t,handleClose:e}))},[]),f=(0,n.useCallback)(function(e){c({ariaLabel:(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).ariaLabel,content:e})},[]),h=(0,n.useMemo)(()=>({close:u,open:d,setDismissible:r,setHandleClose:m,setModalContent:f}),[u,d,m,f]);return n.createElement(b.Provider,{value:h},t,function(e){let{close:t,isDismissible:s,isOpen:a,modalState:l}=e;if(!a)return null;const o=(()=>{if(s)return()=>{l.handleClose?.(),t()}})();return n.createElement(p,{ariaLabel:l.ariaLabel,handleClickOutside:o},n.createElement(g,{handleClose:o},n.createElement(n.Suspense,{fallback:null},l.content)))}({close:u,isDismissible:o,isOpen:a,modalState:i}))}C.propTypes={children:l().node};const w=C},65142(e,t,s){e.exports=s.p+"arrow-back-e81d08.svg"},75424(e,t,s){s.d(t,{A:()=>_});var n=s(22771),a=s(53241),l=s(14712),o=s.n(l),r=s(26826),i=s.n(r),c=s(25152),u=s(9713),d=s(82694);function p(e){let{innerRef:t,...s}=e;return a.createElement(d.A,(0,n.A)({ReactSelectComponent:u.A},s,{ref:t}))}p.propTypes=d.A.propTypes;var m=s(64704),f=s.n(m);const h="styles-highlight-d51170",g="styles-focused-cabb3f";function b(e){const{data:t,innerProps:s,innerRef:l,isFocused:r,selectProps:i}=e,{label:c,website:{name:u}}=t,{inputValue:d}=i,p=o()("styles-root-d31908","t-site",{[g]:r}),m=(0,a.useMemo)(()=>[d],[d]);return a.createElement("div",(0,n.A)({},s,{className:p,ref:l}),a.createElement("div",{className:"styles-name-fe4814"},a.createElement(f(),{highlightClassName:h,searchWords:m,textToHighlight:u})),a.createElement("div",null,a.createElement(f(),{highlightClassName:h,searchWords:m,textToHighlight:c})))}b.propTypes={data:i().shape({label:i().string,website:i().shape({name:i().string})}),innerProps:i().shape({}),innerRef:i().shape({}),isFocused:i().bool,selectProps:i().shape({inputValue:i().string})};const y=b;var C=s(87739);function w(e){const{MenuFooter:t}=e.selectProps.components,s=o()("styles-root-a65f93",e.className);return a.createElement(C.c.Menu,(0,n.A)({},e,{className:s}),e.children,function(e,t){return e?a.createElement(e,t):null}(t,e))}w.propTypes={children:i().node,className:i().string,selectProps:i().shape({components:i().objectOf(i().elementType).isRequired}).isRequired};const v=w,M=(0,s(63510).YK)({errorMessage:{defaultMessage:"Something went wrong when loading the website information",id:"website-select.error"},noMatches:{defaultMessage:"No matches found",id:"website-select.no-matches-found"},search:{defaultMessage:"Search",id:"website-select.search"}});var E=s(20867),O=s(22573),N=s(17749),R=s(41242);const A=function(e){const{defaultValue:t,handlePagination:s,orderBy:n,pageSize:a,throttleRate:l}=e,{error:o,isLoading:r,mutateAsync:i}=function(e,t){let{orderBy:s,pageSize:n}=e;const a=function(e){let{orderBy:t,pageSize:s}=e;return async e=>{const n=N.A.stringifyUrl({query:{order_by:t,page_size:s,q:e},url:"v1/websites/management-summary"}),{data:{pagination:a,websites:l}}=await R.A.get(n);return{pagination:a,websites:l}}}({orderBy:s,pageSize:n});return(0,O.n)(a,t)}({orderBy:n,pageSize:a}),c=function(e){let{defaultValue:t,handlePagination:s,mutateAsync:n}=e;return async(e,a)=>{try{const{pagination:l,websites:o}=await n(e);s(l);const r=function(e){let{addValueToOptions:t,value:s,websites:n}=e;return t&&s?(a=n.some(e=>{let{uuid:t}=e;return s.value===t})?n:[s.website,...n]).length<=5?a:a.slice(0,5):n;var a}({addValueToOptions:!e,value:t,websites:o}),i=function(e){return e.map(e=>({label:e.url,value:e.uuid,website:e}))}(r);a(i)}catch{a()}}}({defaultValue:t,handlePagination:s,mutateAsync:i});return{error:o,isLoading:r,loadOptions:(0,E.r)(c,l)}},T={Option:y,Menu:v,MenuFooter:null},k={dropdownIndicator:(e,t)=>({...e,transition:"all .2s ease",transform:t.selectProps.menuIsOpen?"rotate(180deg)":null}),multiValue:(e,t)=>({...e,backgroundColor:"#f5f6fa",padding:"0.125rem"})},S=()=>a.createElement(c.A,M.noMatches),P=a.createElement(c.A,M.search);function L(e){const{className:t,components:s,defaultValue:l,handleChange:r,innerRef:i,isDisabled:u,isMulti:d,name:m,orderBy:f,placeholder:h=P,styles:g,...b}=e,y=(0,a.useRef)({}),{error:C,isLoading:w,loadOptions:v}=A({defaultValue:l,handlePagination:e=>{y.current={showAllWebsites:Boolean(e.page_token_next),totalWebsites:e.total_size}},orderBy:f,pageSize:5,throttleRate:2}),E=(0,a.useMemo)(()=>({...k,...g}),[g]),O=(0,a.useMemo)(()=>({...T,...s}),[s]),N=(0,a.useCallback)(e=>{r({name:m,value:e})},[r,m]);if(C)return console.debug(C),a.createElement("div",{className:"styles-errorMessage-ee4afb"},a.createElement(c.A,M.errorMessage));const R=o()(t,"t-websiteSelect");return a.createElement(p,(0,n.A)({defaultOptions:!0,className:R,components:O,defaultValue:l,innerRef:i,isClearable:d,isDisabled:u,isLoading:w,isMulti:d,loadOptions:v,menuProps:y.current,noOptionsMessage:S,onChange:N,placeholder:h,styles:E},b))}const V=i().shape({label:i().string,value:i().oneOfType([i().number,i().string]),website:i().shape({})});L.propTypes={handleChange:i().func.isRequired,name:i().string.isRequired,className:i().string,components:i().objectOf(i().elementType),defaultValue:i().oneOfType([
1V,i().arrayOf(V)]),innerRef:i().shape({current:i().oneOfType([i().element,i().instanceOf(Element)])}),isDisabled:i().bool,isMulti:i().bool,orderBy:i().string,placeholder:i().string,styles:i().shape({}),value:i().oneOfType([V,i().arrayOf(V)])};const _=L},82694(e,t,s){s.d(t,{A:()=>h});var n=s(22771),a=s(53241),l=s(26826),o=s.n(l),r=s(31729),i=s(14712),c=s.n(i);const u="styles-isOpen-dd468a",d="styles-isDisabled-cfc06c",p="styles-isFocused-d04f85",m="styles-isSelected-c0f557",f=(0,a.forwardRef)(function(e,t){let{ReactSelectComponent:s=r.Ay,className:l,...o}=e;const i=(0,a.useMemo)(()=>({dropdownIndicator(e){let{selectProps:t}=e;return c()("styles-dropdownIndicator-dac953",{[u]:t.menuIsOpen})},option(e){let{isDisabled:t,isFocused:s,isSelected:n}=e;return c()("styles-option-b29952",{[p]:s,[m]:n,[d]:t})},...o.classNames}),[o.classNames]),f=c()("styles-root-bff568",l);return a.createElement(s,(0,n.A)({},o,{className:f,classNames:i,ref:t}))}),h=f;f.propTypes={ReactSelectComponent:o().elementType,className:o().string,classNames:o().objectOf(o().func)}}}]); 2//# sourceMappingURL=1995-8458ad.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.