@i.un/libs 1.0.3 → 1.0.4

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/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- var e=Symbol("undefined");function t(e){return"function"==typeof(null==e?void 0:e.clone)}function n(e){var t=typeof e;return null===e||"string"===t||"number"===t||"boolean"===t||"undefined"===t}function r(e){return n(e)?String(e):JSON.stringify(e,function(e,t){return"object"!=typeof t||null===t||Array.isArray(t)?t:Object.keys(t).sort().reduce(function(e,n){return e[n]=t[n],e},{})})}function o(e){if(null===e||"object"!=typeof e)return e;if(t(e))return e.clone();if(Array.isArray(e))return e.map(function(e){return o(e)});var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=o(e[r]));return n}function i(e){return new Proxy({},{get:function(t,n){return t.hasOwnProperty(n)?t[n]:e}})}var a=i(e),s=i(!1);function c(e){return a[e]}function l(t){return a[t]!==e}var u={timeout:6e4,timeoutResult:{code:408,msg:"请求超时"},identifier:""};function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function h(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return d(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},p.apply(null,arguments)}var m=/*#__PURE__*/function(){function e(e){this.storageKey=void 0,this.data={},this.changeCallbacks=[],this.storageKey=e}e.getInstanceKey=function(e){return"memory:"+e},e.getInstance=function(t){var n=this.getInstanceKey(t);return this.instances.has(n)||this.instances.set(n,new e(t)),this.instances.get(n)},e.create=function(e){return this.getInstance(e)},e.clearInstance=function(e){var t=this.getInstanceKey(e),n=this.instances.get(t);n&&n.clearChangeCallbacks(),this.instances.delete(t)},e.clearAllInstances=function(){this.instances.forEach(function(e){e.clearChangeCallbacks()}),this.instances.clear()};var t=e.prototype;return t.set=function(e,t){try{var n,r=this.data[e];this.data=p({},this.data,((n={})[e]=t,n)),this.triggerChange(r,t)}catch(e){throw console.error("MemoryStore.set 失败:",e),e}},t.get=function(e){try{return this.data[e]}catch(e){throw console.error("MemoryStore.get 失败:",e),e}},t.getAll=function(){return p({},this.data)},t.remove=function(e){try{if(e in this.data){var t=this.data[e],n=p({},this.data);delete n[e],this.data=n,this.triggerChange(t,void 0)}}catch(e){throw console.error("MemoryStore.remove 失败:",e),e}},t.clear=function(){try{var e=p({},this.data);this.data={},this.triggerChange(e,{})}catch(e){throw console.error("MemoryStore.clear 失败:",e),e}},t.setMultiple=function(e){try{var t=p({},this.data);this.data=p({},this.data,e),this.triggerChange(t,this.data)}catch(e){throw console.error("MemoryStore.setMultiple 失败:",e),e}},t.onChanged=function(e){this.changeCallbacks.push(e)},t.triggerChange=function(e,t){if(this.changeCallbacks.length>0){var n,r=((n={})[this.storageKey]={oldValue:e,newValue:t},n);this.changeCallbacks.forEach(function(e){try{e(r)}catch(e){console.error("MemoryStore 变化回调执行失败:",e)}})}},t.clearChangeCallbacks=function(){this.changeCallbacks=[]},t.has=function(e){try{return e in this.data}catch(e){return console.error("MemoryStore.has 失败:",e),!1}},t.getSize=function(){try{var e=JSON.stringify(this.data);return new Blob([e]).size}catch(e){return console.error("MemoryStore.getSize 失败:",e),0}},t.getStoreKey=function(){return this.storageKey},t.getStoreType=function(){return"memory"},e}();function f(e,t,n,r){if(void 0===r&&(r=!1),t in e.style)e.style[t]=n;else{var o=r?"important":"";e.style.setProperty(t,String(n),o)}}function v(e){var t=document.createElementNS("http://www.w3.org/2000/svg",e.type);if(e.props)for(var n=0,r=Object.entries(e.props);n<r.length;n++){var o=r[n];t.setAttribute(o[0],o[1])}if("string"==typeof e.children){var i=document.createTextNode(e.children);t.appendChild(i)}else Array.isArray(e.children)&&e.children.forEach(function(e){var n=v(e);t.appendChild(n)});return t}function g(e){var t=(new DOMParser).parseFromString(e,"image/svg+xml").documentElement;if(!(t instanceof SVGElement))throw new Error("解析失败,结果不是有效的 SVG 元素");return t}function y(e){e&&setTimeout(function(){e.scrollTop=e.scrollHeight},0)}m.instances=new Map;var w=/*#__PURE__*/function(){function e(e,t){void 0===t&&(t={}),this.element=void 0,this.options=void 0,this.isDragging=!1,this.startX=0,this.startY=0,this.initialX=0,this.initialY=0,this.threshold=5,this.onMouseMoveHandler=void 0,this.onMouseUpHandler=void 0,this.element=e,this.options=p({coordinate:"tl"},t);var n=getComputedStyle(this.element).position;n&&"static"!==n||(this.element.style.position="absolute"),this.options.position&&(this.element.style.position=this.options.position),this.onMouseMoveHandler=this.onMouseMove.bind(this),this.onMouseUpHandler=this.onMouseUp.bind(this),this.element.addEventListener("mousedown",this.onMouseDown.bind(this))}var t=e.prototype;return t.onMouseDown=function(e){e.preventDefault(),this.startX=e.clientX,this.startY=e.clientY,this.initialX=parseInt(window.getComputedStyle(this.element).left,10)||0,this.initialY=parseInt(window.getComputedStyle(this.element).top,10)||0,document.addEventListener("mousemove",this.onMouseMoveHandler),document.addEventListener("mouseup",this.onMouseUpHandler)},t.getBoundedPosition=function(e,t){var n,r,o=this.element.getBoundingClientRect();if("fixed"===getComputedStyle(this.element).position)n=window.innerWidth-o.width,r=window.innerHeight-o.height;else{var i=(this.element.offsetParent||document.documentElement).getBoundingClientRect();n=i.width-o.width,r=i.height-o.height}return{x:Math.min(Math.max(0,e),n),y:Math.min(Math.max(0,t),r)}},t.onMouseMove=function(e){if(!this.isDragging){var t=e.clientY-this.startY;(Math.abs(e.clientX-this.startX)>this.threshold||Math.abs(t)>this.threshold)&&(this.isDragging=!0,this.options.onDragStart&&this.options.onDragStart(e))}if(this.isDragging){var n=this.getBoundedPosition(this.initialX+(e.clientX-this.startX),this.initialY+(e.clientY-this.startY));this.element.style.right="auto",this.element.style.bottom="auto",this.element.style.left=n.x+"px",this.element.style.top=n.y+"px",this.options.onDrag&&this.options.onDrag(e)}},t.convertCoordinate=function(){var e=this.element.getBoundingClientRect(),t=getComputedStyle(this.element).position,n=null,r=null;if("fixed"===t?(n=null,r=new DOMRect(0,0,window.innerWidth,window.innerHeight)):((n=this.element.offsetParent)||(n=document.documentElement),"static"===getComputedStyle(n).position?(n=null,r=new DOMRect(0,0,window.innerWidth,window.innerHeight)):r=n.getBoundingClientRect()),r){var o,i;if("fixed"===t)o=e.left,i=e.top;else if(o=e.left-r.left,i=e.top-r.top,n instanceof HTMLElement){var a=getComputedStyle(n);o-=parseFloat(a.borderLeftWidth)||0,i-=parseFloat(a.borderTopWidth)||0}else o+=window.scrollX,i+=window.scrollY;switch(this.options.coordinate){case"tr":var s=r.width-o-e.width;this.element.style.left="auto",this.element.style.right=s+"px",this.element.style.top=i+"px",this.element.style.bottom="auto";break;case"bl":var c=r.height-i-e.height;this.element.style.left=o+"px",this.element.style.right="auto",this.element.style.top="auto",this.element.style.bottom=c+"px";break;case"br":var l=r.width-o-e.width,u=r.height-i-e.height;this.element.style.left="auto",this.element.style.right=l+"px",this.element.style.top="auto",this.element.style.bottom=u+"px";break;default:this.element.style.left=o+"px",this.element.style.right="auto",this.element.style.top=i+"px",this.element.style.bottom="auto"}}},t.onMouseUp=function(e){this.isDragging&&(this.options.coordinate&&"tl"!==this.options.coordinate&&this.convertCoordinate(),this.options.onDragEnd&&this.options.onDragEnd(e)),this.isDragging=!1,document.removeEventListener("mousemove",this.onMouseMoveHandler),document.removeEventListener("mouseup",this.onMouseUpHandler)},e}(),b=/*#__PURE__*/function(){function e(e,t){void 0===t&&(t="local"),this.storageKey=void 0,this.storeType=void 0,this.store=void 0,this.storageKey=e,this.storeType=t}e.getInstanceKey=function(e,t){return void 0===t&&(t="local"),t+":"+e},e.getInstance=function(t,n){void 0===n&&(n="local");var r=this.getInstanceKey(t,n);return this.instances.has(r)||this.instances.set(r,new e(t,n)),this.instances.get(r)},e.local=function(e){return this.getInstance(e,"local")},e.session=function(e){return this.getInstance(e,"session")},e.clearInstance=function(e,t){void 0===t&&(t="local");var n=this.getInstanceKey(e,t);this.instances.delete(n)},e.clearAllInstances=function(){this.instances.clear()};var t=e.prototype;return t.getStore=function(){return this.store||(this.store="local"===this.storeType?localStorage:sessionStorage),this.store},t.set=function(e,t){try{var n,r=p({},this.getAll(),((n={})[e]=t,n));this.getStore().setItem(this.storageKey,JSON.stringify(r))}catch(e){throw console.error("WebStore.set 失败:",e),e}},t.get=function(e){try{var t=this.getAll();return null==t?void 0:t[e]}catch(e){throw console.error("WebStore.get 失败:",e),e}},t.getAll=function(){try{var e=this.getStore().getItem(this.storageKey);return e?JSON.parse(e):{}}catch(e){return console.error("WebStore.getAll 失败:",e),{}}},t.remove=function(e){try{var t=this.getAll();t&&e in t&&(delete t[e],this.getStore().setItem(this.storageKey,JSON.stringify(t)))}catch(e){throw console.error("WebStore.remove 失败:",e),e}},t.clear=function(){try{this.getStore().removeItem(this.storageKey)}catch(e){throw console.error("WebStore.clear 失败:",e),e}},t.setMultiple=function(e){try{var t=p({},this.getAll(),e);this.getStore().setItem(this.storageKey,JSON.stringify(t))}catch(e){throw console.error("WebStore.setMultiple 失败:",e),e}},t.onChanged=function(e){var t=this;window.addEventListener("storage",function(n){if(n.key===t.storageKey&&n.storageArea===t.getStore()){var r,o=((r={})[t.storageKey]={oldValue:n.oldValue?JSON.parse(n.oldValue):void 0,newValue:n.newValue?JSON.parse(n.newValue):void 0},r);e(o)}})},t.has=function(e){try{return void 0!==this.get(e)}catch(e){return console.error("WebStore.has 失败:",e),!1}},t.getSize=function(){try{var e=this.getStore().getItem(this.storageKey)||"";return new Blob([e]).size}catch(e){return console.error("WebStore.getSize 失败:",e),0}},t.getStoreKey=function(){return this.storageKey},e}();function x(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}b.instances=new Map;var P=/*#__PURE__*/function(){function e(e,t){void 0===t&&(t="local"),this.storageKey=void 0,this.storeType=void 0,this.store=void 0,this.storageKey=e,this.storeType=t}e.getInstanceKey=function(e,t){return void 0===t&&(t="local"),t+":"+e},e.getInstance=function(t,n){void 0===n&&(n="local");var r=this.getInstanceKey(t,n);return this.instances.has(r)||this.instances.set(r,new e(t,n)),this.instances.get(r)},e.local=function(e){return this.getInstance(e,"local")},e.sync=function(e){return this.getInstance(e,"sync")},e.clearInstance=function(e,t){void 0===t&&(t="local");var n=this.getInstanceKey(e,t);this.instances.delete(n)},e.clearAllInstances=function(){this.instances.clear()};var t=e.prototype;return t.getStore=function(){return this.store||(this.store=chrome.storage[this.storeType]),this.store},t.set=function(e,t){try{var n=this;return Promise.resolve(x(function(){return Promise.resolve(n.getAll()).then(function(r){var o,i,a=p({},r,((o={})[e]=t,o));return Promise.resolve(n.getStore().set((i={},i[n.storageKey]=a,i))).then(function(){})})},function(e){throw console.error("ChromeStore.set 失败:",e),e}))}catch(e){return Promise.reject(e)}},t.get=function(e){try{var t=this;return Promise.resolve(x(function(){return Promise.resolve(t.getAll()).then(function(t){return null==t?void 0:t[e]})},function(e){throw console.error("ChromeStore.get 失败:",e),e}))}catch(e){return Promise.reject(e)}},t.getAll=function(){try{var e=this;return Promise.resolve(x(function(){return Promise.resolve(e.getStore().get(e.storageKey)).then(function(t){return t[e.storageKey]||{}})},function(e){throw console.error("ChromeStore.getAll 失败:",e),e}))}catch(e){return Promise.reject(e)}},t.remove=function(e){try{var t=this;return Promise.resolve(x(function(){return Promise.resolve(t.getAll()).then(function(n){var r=function(){var r;if(n&&e in n)return delete n[e],Promise.resolve(t.getStore().set((r={},r[t.storageKey]=n,r))).then(function(){})}();if(r&&r.then)return r.then(function(){})})},function(e){throw console.error("ChromeStore.remove 失败:",e),e}))}catch(e){return Promise.reject(e)}},t.clear=function(){try{var e=this;return Promise.resolve(x(function(){return Promise.resolve(e.getStore().remove(e.storageKey)).then(function(){})},function(e){throw console.error("ChromeStore.clear 失败:",e),e}))}catch(e){return Promise.reject(e)}},t.setMultiple=function(e){try{var t=this;return Promise.resolve(x(function(){return Promise.resolve(t.getAll()).then(function(n){var r,o=p({},n,e);return Promise.resolve(t.getStore().set((r={},r[t.storageKey]=o,r))).then(function(){})})},function(e){throw console.error("ChromeStore.setMultiple 失败:",e),e}))}catch(e){return Promise.reject(e)}},t.onChanged=function(e){var t=this;chrome.storage.onChanged.addListener(function(n,r){r===t.storeType&&n[t.storageKey]&&e(n)})},t.has=function(e){try{var t=this;return Promise.resolve(x(function(){return Promise.resolve(t.get(e)).then(function(e){return void 0!==e})},function(e){return console.error("ChromeStore.has 失败:",e),!1}))}catch(e){return Promise.reject(e)}},t.getSize=function(){try{var e=this;return Promise.resolve(x(function(){return Promise.resolve(e.getAll()).then(function(e){var t=JSON.stringify(e);return new Blob([t]).size})},function(e){return console.error("ChromeStore.getSize 失败:",e),0}))}catch(e){return Promise.reject(e)}},t.getStoreKey=function(){return this.storageKey},e}();P.instances=new Map;var S="https://www.linkedin.com/voyager/api";function k(e,t){var n,r={"csrf-token":e};return t&&(n="string"==typeof t?t:Object.entries(t).map(function(e){return e[0]+"="+e[1]}).join("; "))&&(r.Cookie=n),r}var C={profilePage:{userPicture:[".pv-top-card__non-self-photo-wrapper img","#recent-activity-top-card img",".pv-top-card__photo-wrapper img",'div[componentkey^="com.linkedin.sdui.profile.card"] div[data-view-name="profile-top-card-member-photo"] img'],userName:['a[href^="/in"] h1',"#recent-activity-top-card h3",'div[data-view-name="profile-top-card-verified-badge"] div[role="button"]'],userOccupation:[".artdeco-entity-lockup .artdeco-entity-lockup__subtitle","#recent-activity-top-card h4"],linkedinProfileCard:[".scaffold-layout__main .artdeco-card:first-child",'div[componentkey^="com.linkedin.sdui.profile.card"]'],privateProfileInfoSection:[".pv-profile-info-section"],howToContainer:["#profile-content, header#global-nav"],companyName:[".top-card-background-hero-image+div .mt2 ul>li span",'div[componentkey^="com.linkedin.sdui.profile.card"] div:has(div[data-view-name="profile-top-card-verified-badge"]) + div div[role="button"] p'],companyLogo:[".top-card-background-hero-image+div .mt2 ul>li img"],campaignsListContainer:[".ui-row.sm.campaigns-list-container"],contactListContainer:[".ui-row.sm.contact-list-container"],location:["#profile-content .artdeco-card .top-card-background-hero-image+div .text-body-small.inline.t-black--light"],campaignsListContainerDisplay:[".ui-col.sm.campaigns-list-container-display"],contactListContainerDisplay:[".ui-col.sm.contact-list-container-display"],mainExperienceContainer:[".artdeco-card:has(#experience) li:first-child",'div[componentkey^="com.linkedin.sdui.profile.card"][componentkey$="ExperienceTopLevelSection"] div:has(h2) + div > div'],experienceCompanyLogo:['[data-field="experience_company_logo"] img','div[componentkey^="com.linkedin.sdui.profile.card"][componentkey$="ExperienceTopLevelSection"] div:has(h2) + div figure[data-view-name="image"] img'],experienceCompanyName:['div:has([data-field="experience_company_logo"])+div .t-normal span:not(.visually-hidden)'],experienceOccupation:['div:has([data-field="experience_company_logo"])+div .t-bold span:not(.visually-hidden)'],experienceMultipleCompany:["li:has([data-view-name=profile-component-entity] .pvs-entity__sub-components .pvs-entity__sub-components) .t-bold span:not(.visually-hidden)"],experienceMultipleOccupation:['[data-view-name="profile-component-entity"] li:first-child .t-bold span:not(.visually-hidden)']},salesNavProfilePage:{profileCardSection:["#profile-card-section"],userName:['#profile-card-section [data-anonymize="person-name"]'],userPicture:['#profile-card-section img[data-anonymize="headshot-photo"]'],userOccupation:['#profile-card-section [data-anonymize="headline"]'],profileUrl:['#profile-card-section a[href^="/sales/lead"]'],linkedinProfileCard:["#profile-card-section"],campaignsListContainer:[".ui-row.sm.campaigns-list-container"],contactListContainer:[".ui-row.sm.contact-list-container"],campaignsListContainerDisplay:[".ui-col.sm.campaigns-list-container-display"],contactListContainerDisplay:[".ui-col.sm.contact-list-container-display"],location:["#profile-card-section>section>div>div:last-child div:has(svg)"],companyName:['#profile-card-section a[data-anonymize="company-name"]'],companyLogo:['#profile-card-section img[data-anonymize="company-logo"]'],moreInfoButton:["#profile-card-section section[data-x--lead-actions-bar] button[data-x--lead-actions-bar-overflow-menu]",'#profile-card-section button[aria-label="Open actions overflow menu"]'],linkedinProfileLinkButton:['#hue-web-menu-outlet a[href^="https://www.linkedin.com/in/"]'],mainExperienceContainer:['[data-sn-view-name="feature-lead-experience"]'],experienceCompanyLogo:['li:first-child img[data-anonymize="company-logo"]'],experienceCompanyName:['li:first-child [data-anonymize="company-name"]'],experienceOccupation:['li:first-child [data-anonymize="job-title"]'],experienceMultipleOccupation:['ul li ul li:first-child [data-anonymize="job-title"]','ul li [data-anonymize="job-title"]'],experienceMultipleCompany:['li:first-child [data-anonymize="company-name"]']},searchPeoplePage:{searchEntityResult:['[data-view-name="search-entity-result-universal-template"]'],linkedinUrl:['a[data-test-app-aware-link][href^="https://www.linkedin.com/in/"]','a[data-view-name="search-result-lockup-title"]'],image:[".presence-entity img","a>div>div>figure>img"],userOccupation:['p:has(a[data-view-name="search-result-lockup-title"]) + p',".entity-result__primary-subtitle",".entity-result__divider > div div:nth-child(2)","div>div>div:nth-child(2)>div>div:nth-child(2)","figure + div p:nth-child(2)"],fullName:[".entity-result__title-text a span>span",".entity-result__title-line a span>span",".entity-result__title-line span>a>span>span","a:has(+.entity-result__badge)>span>span",".linked-area div:nth-child(2) > div:first-child > div.t-roman.t-sans a",'a[data-view-name="search-result-lockup-title"]'],resultList:[".search-results-container>div:has(.reusable-search__result-container)"],actionsDiv:[".entity-result__actions",".linked-area > div > div:last-child","div:has(figure) > div:last-child"],validResult:["[data-chameleon-result-urn] , .reusable-search__result-container"],searchResult:[".search-results-container li:has(>[data-chameleon-result-urn])",'[data-view-name="people-search-result"]'],searchResultsContainer:[".search-results-container",'[role="main"] div:has(>hr[role="presentation"])'],mainLayoutLeft:[".search-marvel-srp",'[role="main"] div:has(hr)>div>div'],howToContainer:[".hasLegacyFeedLineHeight div:has(main)",".authentication-outlet"]},searchAllPage:{peopleButton:["nav ul.search-reusables__filter-list>li>button"],toolbar:[".scaffold-layout-toolbar"]}};function M(e,t,n){switch(n){case"all":var r=e.querySelectorAll(t);return r.length>0?Array.from(r):null;case"closest":return e instanceof HTMLElement?e.closest(t):null;default:return e.querySelector(t)}}function I(e){var t=e.page,n=e.key,r=e.container,o=e.mode;null!=r||(r=document);for(var i,a,s=h(t&&n?C[(i={page:t,key:n}).page][i.key]:[e.selector]);!(a=s()).done;){var c=M(r,a.value,o);if(c)return c}return null}function L(e){if(!e)return"";var t=document.createElement("textarea");return t.innerHTML=e,t.value.trim()}var E={"":0,chrome:1,"chrome-extension":2,"view-source":3,ftp:4,file:5,data:6,blob:7,about:8};function _(e){void 0===e&&(e="");var t="",n=e.split("#")[0].toLocaleLowerCase();return/^https\:\/\/(www|.{2})\.linkedin\.com\/in\/[^/?]+(\/recent-activity\/|\/details\/|\/overlay\/|\/?\?[^/]*|\/?$)/.test(n)||/^https\:\/\/(www|.{2})\.linkedin\.com\/sales\/people\/(.+?),/.test(n)||/^https\:\/\/(www|.{2})\.linkedin\.com\/sales\/(profile|lead)\/([^,]{39}),/.test(n)?t="profile":n.includes("linkedin.com/feed")?t="feed":n.includes("linkedin.com/posts/")?t="post":n.includes("linkedin.com/login")||n.includes("linkedin.com/checkpoint")||n.includes("linkedin.com/authwall")?t="login":n.includes("linkedin.com/company/")?t="company":n.includes("linkedin.com/messaging/thread/")?t="messages":n.includes("linkedin.com/search/results/people/?")||n.includes("linkedin.com/sales/search/people")?t="search-people":n.includes("linkedin.com/search/results/all")?t="search-all":n.includes("linkedin.com/mynetwork/")&&(t="connections"),t}function T(e){var t;void 0===e&&(e="");var n=((e=e||(null==(t=window.top)?void 0:t.location.href)||document.URL).match(/linkedin\.com\/in\/([^?/]+)/)||[])[1]||(e.match(/linkedin\.com\/sales\/people\/(.+?),/)||[])[1]||(e.match(/linkedin\.com\/sales\/(?:profile|lead)\/([^,]{39}),/)||[])[1]||"";return decodeURIComponent(n)}function j(e){var t;void 0===e&&(e="");var n=((e=e||(null==(t=window.top)?void 0:t.location.href)||document.URL).match(/linkedin\.com\/company\/([^?/]+)/)||[])[1]||"";return decodeURIComponent(n)}exports.ChromeStore=P,exports.Draggable=w,exports.MemoryStore=m,exports.RealUndefined=e,exports.WebStore=b,exports.cacheWrapper=function(e,t){void 0===t&&(t=u);var n=function(){var n=[].slice.call(arguments),i=r(n)+e.name+(t.identifier||"");if(l(i))return Promise.resolve(o(c(i)));if(s[i]){var d=Object.assign({},u,t);return new Promise(function(e){var t=Date.now(),n=setInterval(function(){l(i)?(clearInterval(n),e(o(c(i)))):Date.now()-t>d.timeout&&(s[i]=!1,clearInterval(n),e(o(d.timeoutResult)))},100)})}return s[i]=!0,e.apply(this,n).then(function(e){return a[i]=e,o(a[i])}).catch(function(e){throw e}).finally(function(){s[i]=!1})};return Object.defineProperty(n,"name",{value:"cacheWrapper_"+e.name,configurable:!0}),n},exports.cloneDeep=o,exports.createDefaultObject=i,exports.createElement=function e(t){var n=void 0===t?{}:t,r=n.tag,o=n.children,i=void 0===o?[]:o,a=n.props,s=void 0===a?{}:a,c=n.attrs,l=void 0===c?{}:c,u=n.styles,d=void 0===u?{}:u,p=document.createElement(void 0===r?"div":r);Object.assign(p,s);for(var m=0,v=Object.entries(l);m<v.length;m++){var g=v[m],y=g[1];!1!==y&&p.setAttribute(g[0],y)}for(var w=0,b=Object.entries(d);w<b.length;w++){var x=b[w];f(p,x[0],x[1])}for(var P,S=h(Array.isArray(i)?i:[i]);!(P=S()).done;){var k=P.value;k&&("object"==typeof k?k instanceof Element?p.appendChild(k):p.appendChild(e(k)):p.appendChild(document.createTextNode(k)))}return p},exports.createMessageBus=function(e){void 0===e&&(e={});var t=e.debug,n=void 0!==t&&t,r=e.logPrefix,o=void 0===r?"[MessageBus]":r,i=new Map,a=!1;function s(e){var t;n&&(t=console).error.apply(t,[o+" "+e].concat([].slice.call(arguments,1)))}function c(){a||(chrome.runtime.onMessage.addListener(function(e,t,n){if(e&&"string"==typeof e.type){var r=i.get(e.type);if(r)try{var o=r(e.payload,t);return o instanceof Promise?(o.then(n).catch(function(t){s('Error handling "'+String(e.type)+'":',t),n({__error:!0,message:t instanceof Error?t.message:String(t)})}),!0):(n(o),!1)}catch(t){return s('Error handling "'+String(e.type)+'":',t),n({__error:!0,message:t instanceof Error?t.message:String(t)}),!1}}}),a=!0)}return{send:function(e){return chrome.runtime.sendMessage({type:e,payload:[].slice.call(arguments,1)[0]})},sendToTab:function(e,t){return chrome.tabs.sendMessage(e,{type:t,payload:[].slice.call(arguments,2)[0]})},on:function(e,t){return c(),i.set(e,t),function(){i.delete(e)}},onMany:function(e){c();for(var t=[],n=0,r=Object.entries(e);n<r.length;n++){var o=r[n],a=o[0],s=o[1];s&&(i.set(a,s),t.push(a))}return function(){for(var e=0,n=t;e<n.length;e++)i.delete(n[e])}},hasHandler:function(e){return i.has(e)},getRegisteredTypes:function(){return Array.from(i.keys())},clearAllHandlers:function(){i.clear()}}},exports.createSvg=function(e){return"string"==typeof e?g(e):v(e)},exports.createSvgFromUrl=function(e){try{return Promise.resolve(function(t,n){try{var r=Promise.resolve(fetch(e)).then(function(e){if(!e.ok)throw new Error("网络请求失败: "+e.status+" "+e.statusText);return Promise.resolve(e.text()).then(g)})}catch(e){return n(e)}return r&&r.then?r.then(void 0,n):r}(0,function(e){var t=e instanceof Error?e.message:"未知错误";throw new Error("无法创建 SVG 元素: "+t)}))}catch(e){return Promise.reject(e)}},exports.debounce=function(e,t){var n=null;return function(){var r=arguments,o=this;null!==n&&clearTimeout(n),n=setTimeout(function(){e.apply(o,[].slice.call(r)),n=null},t)}},exports.decodeJWT=function(e){var t=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=decodeURIComponent(atob(t).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(n)},exports.delayExecution=function(e,t){void 0===t&&(t=0);var n=[].slice.call(arguments,2);return new Promise(function(r){0===t?r(e.apply(void 0,n)):setTimeout(function(){r(e.apply(void 0,n))},t)})},exports.generateStableUniqueKey=r,exports.getCompanyPublicId=j,exports.getContactInfo=function(){var e,t,n,r,o,i,a,s=window.location.href.includes("linkedin.com/sales")?"salesNavProfilePage":"profilePage";function c(e){return I({page:s,key:e,container:document})}var l=null==(e=c("userName"))?void 0:e.innerText;if(!l)return console.error("extractUserInfos: no userName found"),{};var u,d=null==(t=c("userPicture"))?void 0:t.src,h=null==(n=c("userOccupation"))?void 0:n.innerHTML,p=null==(r=c("companyName"))?void 0:r.innerText,m=null==(o=c("companyLogo"))?void 0:o.src,f=null==(i=c("location"))?void 0:i.innerText;return"salesNavProfilePage"===s&&(u=/linkedin\.com\/sales\/lead/i.test(window.location.href)?window.location.href:null==(a=c("profileUrl"))?void 0:a.href),{name:L(l),profileUrl:u,picture:d,occupation:L(h),companyName:p,companyPicture:m,location:f}},exports.getCookie=function(e,t,n){return void 0===n&&(n=!1),chrome.cookies.get({url:e,name:t}).then(function(e){var t;return n?(null==e||null==(t=e.value)?void 0:t.replace(/"/g,""))||"":null!=e?e:void 0})},exports.getCookies=function(e,t){return void 0===t&&(t=!1),chrome.cookies.getAll({url:e}).then(function(e){return t?function(e){return e.map(function(e){return e.name+"="+e.value}).join("; ")}(e):e})},exports.getElement=I,exports.getExtensionInfo=function(){var e,t,n;return{locale:null==(e=chrome.i18n)?void 0:e.getUILanguage(),extId:null==(t=chrome.runtime)?void 0:t.id,version:null==(n=chrome.runtime)?void 0:n.getManifest().version}},exports.getGlobal=function(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:this},exports.getLinkedinCompany=function(e,t){var n=t.csrfToken,r=t.cookies;try{var o="string"==typeof e?{universalName:e}:e,i="universalName"in o,a=S+"/organization/companies"+(i?"?q=universalName&universalName="+o.universalName:"/"+o.urn),s=k(n,r);return Promise.resolve(fetch(a,{method:"GET",headers:s}).then(function(e){try{var t,n=function(){if(e.ok)return Promise.resolve(e.json()).then(function(e){if(i){var n,r=(null==(n=e.elements)?void 0:n[0])||null;return t=1,r}return t=1,e})}();return Promise.resolve(n&&n.then?n.then(function(e){return t?e:null}):t?n:null)}catch(e){return Promise.reject(e)}}).catch(function(e){return console.error(e),null}))}catch(e){return Promise.reject(e)}},exports.getLinkedinMe=function(e){var t=e.csrfToken,n=e.cookies;try{var r=S+"/me",o=k(t,n);return Promise.resolve(fetch(r,{method:"GET",headers:o}).then(function(e){try{return Promise.resolve(e.ok?e.json():null)}catch(e){return Promise.reject(e)}}).catch(function(e){return console.error(e),null}))}catch(e){return Promise.reject(e)}},exports.getLinkedinPageType=_,exports.getLinkedinProfile=function(e,t){var n=t.csrfToken,r=t.cookies;try{var o=S+"/identity/dash/profiles?q=memberIdentity&memberIdentity="+e+"&decorationId=com.linkedin.voyager.dash.deco.identity.profile.FullProfileWithEntities-26",i=k(n,r);return Promise.resolve(fetch(o,{method:"GET",headers:i}).then(function(e){try{var t,n=function(){if(e.ok)return Promise.resolve(e.json()).then(function(e){var n,r=(null==(n=e.elements)?void 0:n[0])||null;return t=1,r})}();return Promise.resolve(n&&n.then?n.then(function(e){return t?e:null}):t?n:null)}catch(e){return Promise.reject(e)}}).catch(function(e){return console.error(e),null}))}catch(e){return Promise.reject(e)}},exports.getLinkedinPublicId=function(e){var t;return void 0===e&&(e=""),T(e=e||(null==(t=window.top)?void 0:t.location.href)||document.URL)||j(e)||""},exports.getPageType=function(e){if(void 0===e&&(e=""),!e)return"";var t=Object.keys(E),n=new URL(e).protocol.replace(":","");return t.includes(n)?n:_(e)},exports.getPostPublicId=function(e){var t;void 0===e&&(e="");var n=((e=e||(null==(t=window.top)?void 0:t.location.href)||document.URL).match(/linkedin\.com\/posts\/([^\/]+)\//)||[])[1]||"";return decodeURIComponent(n)},exports.getProfilePublicId=T,exports.isCloneable=t,exports.isErrorResponse=function(e){return"object"==typeof e&&null!==e&&"__error"in e&&!0===e.__error},exports.isLinkedInUrl=function(e){return/^https?:\/\/(www|.{2})\.linkedin\.com/.test(e)},exports.isPrimitive=n,exports.launchWebAuthFlow=function(e){var t=e.clientId,n=e.responseType,r=void 0===n?"code":n,o=e.state,i=e.nonce,a=e.interactive,s=void 0===a||a;try{var c=chrome.identity.getRedirectURL(),l=Array.isArray(r)?r:[r],u=new URL("https://accounts.google.com/o/oauth2/v2/auth");return u.searchParams.set("client_id",t),u.searchParams.set("redirect_uri",c),u.searchParams.set("response_type",l.join(" ")),u.searchParams.set("scope","openid email profile"),i&&u.searchParams.set("nonce",i),o&&u.searchParams.set("state",o),Promise.resolve(chrome.identity.launchWebAuthFlow({url:u.toString(),interactive:s}).then(function(e){if(!e)return Promise.reject(new Error("redirectUrl is null"));var t=e.includes("?")?"?":"#",n=new URLSearchParams(e.split(t)[1]),r={};return n.forEach(function(e,t){r[t]=e}),r}).catch(function(e){return console.log("error",e),Promise.reject(e)}))}catch(e){return Promise.reject(e)}},exports.pageTypeMap=E,exports.scrollToBottom=y,exports.scrollToBottomIfNeeded=function(e){e&&("true"!==e.dataset.isListeningForUserScroll&&(function(e){e&&e.addEventListener("scroll",function(){!function(e,t){e.dataset.userInteracted=t?"true":"false"}(e,e.scrollTop+e.clientHeight<e.scrollHeight-5)})}(e),e.dataset.isListeningForUserScroll="true"),"true"!==e.dataset.userInteracted&&y(e))},exports.singleExecutionWrapper=function(t,n){void 0===n&&(n=0);var r=function(){if(r.isExecuting)return Promise.resolve(e);r.isExecuting=!0;var o=performance.now(),i=t.apply(this,[].slice.call(arguments));return i.finally(function(){var e=performance.now()-o;n&&n>e?setTimeout(function(){r.isExecuting=!1},n-e):r.isExecuting=!1}),i};return r.isExecuting=!1,r};
1
+ var e=Symbol("undefined");function t(e){return"function"==typeof(null==e?void 0:e.clone)}function n(e){var t=typeof e;return null===e||"string"===t||"number"===t||"boolean"===t||"undefined"===t}function r(e){return n(e)?String(e):JSON.stringify(e,function(e,t){return"object"!=typeof t||null===t||Array.isArray(t)?t:Object.keys(t).sort().reduce(function(e,n){return e[n]=t[n],e},{})})}function o(e){if(null===e||"object"!=typeof e)return e;if(t(e))return e.clone();if(Array.isArray(e))return e.map(function(e){return o(e)});var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=o(e[r]));return n}function i(e){return new Proxy({},{get:function(t,n){return t.hasOwnProperty(n)?t[n]:e}})}var a=i(e),s=i(!1);function l(e){return a[e]}function c(t){return a[t]!==e}var u={timeout:6e4,timeoutResult:{code:408,msg:"请求超时"},identifier:""};function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function h(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return d(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function m(){return m=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},m.apply(null,arguments)}var p=/*#__PURE__*/function(){function e(e){this.storageKey=void 0,this.data={},this.changeCallbacks=[],this.storageKey=e}e.getInstanceKey=function(e){return"memory:"+e},e.getInstance=function(t){var n=this.getInstanceKey(t);return this.instances.has(n)||this.instances.set(n,new e(t)),this.instances.get(n)},e.create=function(e){return this.getInstance(e)},e.clearInstance=function(e){var t=this.getInstanceKey(e),n=this.instances.get(t);n&&n.clearChangeCallbacks(),this.instances.delete(t)},e.clearAllInstances=function(){this.instances.forEach(function(e){e.clearChangeCallbacks()}),this.instances.clear()};var t=e.prototype;return t.set=function(e,t){try{var n,r=this.data[e];this.data=m({},this.data,((n={})[e]=t,n)),this.triggerChange(r,t)}catch(e){throw console.error("MemoryStore.set 失败:",e),e}},t.get=function(e){try{return this.data[e]}catch(e){throw console.error("MemoryStore.get 失败:",e),e}},t.getAll=function(){return m({},this.data)},t.remove=function(e){try{if(e in this.data){var t=this.data[e],n=m({},this.data);delete n[e],this.data=n,this.triggerChange(t,void 0)}}catch(e){throw console.error("MemoryStore.remove 失败:",e),e}},t.clear=function(){try{var e=m({},this.data);this.data={},this.triggerChange(e,{})}catch(e){throw console.error("MemoryStore.clear 失败:",e),e}},t.setMultiple=function(e){try{var t=m({},this.data);this.data=m({},this.data,e),this.triggerChange(t,this.data)}catch(e){throw console.error("MemoryStore.setMultiple 失败:",e),e}},t.onChanged=function(e){this.changeCallbacks.push(e)},t.triggerChange=function(e,t){if(this.changeCallbacks.length>0){var n,r=((n={})[this.storageKey]={oldValue:e,newValue:t},n);this.changeCallbacks.forEach(function(e){try{e(r)}catch(e){console.error("MemoryStore 变化回调执行失败:",e)}})}},t.clearChangeCallbacks=function(){this.changeCallbacks=[]},t.has=function(e){try{return e in this.data}catch(e){return console.error("MemoryStore.has 失败:",e),!1}},t.getSize=function(){try{var e=JSON.stringify(this.data);return new Blob([e]).size}catch(e){return console.error("MemoryStore.getSize 失败:",e),0}},t.getStoreKey=function(){return this.storageKey},t.getStoreType=function(){return"memory"},e}();function f(e,t,n,r){if(void 0===r&&(r=!1),t in e.style)e.style[t]=n;else{var o=r?"important":"";e.style.setProperty(t,String(n),o)}}function v(e){var t=document.createElementNS("http://www.w3.org/2000/svg",e.type);if(e.props)for(var n=0,r=Object.entries(e.props);n<r.length;n++){var o=r[n];t.setAttribute(o[0],o[1])}if("string"==typeof e.children){var i=document.createTextNode(e.children);t.appendChild(i)}else Array.isArray(e.children)&&e.children.forEach(function(e){var n=v(e);t.appendChild(n)});return t}function g(e){var t=(new DOMParser).parseFromString(e,"image/svg+xml").documentElement;if(!(t instanceof SVGElement))throw new Error("解析失败,结果不是有效的 SVG 元素");return t}function y(e){e&&setTimeout(function(){e.scrollTop=e.scrollHeight},0)}p.instances=new Map;var w=/*#__PURE__*/function(){function e(e,t){void 0===t&&(t={}),this.element=void 0,this.options=void 0,this.isDragging=!1,this.startX=0,this.startY=0,this.initialX=0,this.initialY=0,this.threshold=5,this.onMouseMoveHandler=void 0,this.onMouseUpHandler=void 0,this.element=e,this.options=m({coordinate:"tl"},t);var n=getComputedStyle(this.element).position;n&&"static"!==n||(this.element.style.position="absolute"),this.options.position&&(this.element.style.position=this.options.position),this.onMouseMoveHandler=this.onMouseMove.bind(this),this.onMouseUpHandler=this.onMouseUp.bind(this),this.element.addEventListener("mousedown",this.onMouseDown.bind(this))}var t=e.prototype;return t.onMouseDown=function(e){e.preventDefault(),this.startX=e.clientX,this.startY=e.clientY,this.initialX=parseInt(window.getComputedStyle(this.element).left,10)||0,this.initialY=parseInt(window.getComputedStyle(this.element).top,10)||0,document.addEventListener("mousemove",this.onMouseMoveHandler),document.addEventListener("mouseup",this.onMouseUpHandler)},t.getBoundedPosition=function(e,t){var n,r,o=this.element.getBoundingClientRect();if("fixed"===getComputedStyle(this.element).position)n=window.innerWidth-o.width,r=window.innerHeight-o.height;else{var i=(this.element.offsetParent||document.documentElement).getBoundingClientRect();n=i.width-o.width,r=i.height-o.height}return{x:Math.min(Math.max(0,e),n),y:Math.min(Math.max(0,t),r)}},t.onMouseMove=function(e){if(!this.isDragging){var t=e.clientY-this.startY;(Math.abs(e.clientX-this.startX)>this.threshold||Math.abs(t)>this.threshold)&&(this.isDragging=!0,this.options.onDragStart&&this.options.onDragStart(e))}if(this.isDragging){var n=this.getBoundedPosition(this.initialX+(e.clientX-this.startX),this.initialY+(e.clientY-this.startY));this.element.style.right="auto",this.element.style.bottom="auto",this.element.style.left=n.x+"px",this.element.style.top=n.y+"px",this.options.onDrag&&this.options.onDrag(e)}},t.convertCoordinate=function(){var e=this.element.getBoundingClientRect(),t=getComputedStyle(this.element).position,n=null,r=null;if("fixed"===t?(n=null,r=new DOMRect(0,0,window.innerWidth,window.innerHeight)):((n=this.element.offsetParent)||(n=document.documentElement),"static"===getComputedStyle(n).position?(n=null,r=new DOMRect(0,0,window.innerWidth,window.innerHeight)):r=n.getBoundingClientRect()),r){var o,i;if("fixed"===t)o=e.left,i=e.top;else if(o=e.left-r.left,i=e.top-r.top,n instanceof HTMLElement){var a=getComputedStyle(n);o-=parseFloat(a.borderLeftWidth)||0,i-=parseFloat(a.borderTopWidth)||0}else o+=window.scrollX,i+=window.scrollY;switch(this.options.coordinate){case"tr":var s=r.width-o-e.width;this.element.style.left="auto",this.element.style.right=s+"px",this.element.style.top=i+"px",this.element.style.bottom="auto";break;case"bl":var l=r.height-i-e.height;this.element.style.left=o+"px",this.element.style.right="auto",this.element.style.top="auto",this.element.style.bottom=l+"px";break;case"br":var c=r.width-o-e.width,u=r.height-i-e.height;this.element.style.left="auto",this.element.style.right=c+"px",this.element.style.top="auto",this.element.style.bottom=u+"px";break;default:this.element.style.left=o+"px",this.element.style.right="auto",this.element.style.top=i+"px",this.element.style.bottom="auto"}}},t.onMouseUp=function(e){this.isDragging&&(this.options.coordinate&&"tl"!==this.options.coordinate&&this.convertCoordinate(),this.options.onDragEnd&&this.options.onDragEnd(e)),this.isDragging=!1,document.removeEventListener("mousemove",this.onMouseMoveHandler),document.removeEventListener("mouseup",this.onMouseUpHandler)},e}(),b=/*#__PURE__*/function(){function e(e,t){void 0===t&&(t="local"),this.storageKey=void 0,this.storeType=void 0,this.store=void 0,this.storageKey=e,this.storeType=t}e.getInstanceKey=function(e,t){return void 0===t&&(t="local"),t+":"+e},e.getInstance=function(t,n){void 0===n&&(n="local");var r=this.getInstanceKey(t,n);return this.instances.has(r)||this.instances.set(r,new e(t,n)),this.instances.get(r)},e.local=function(e){return this.getInstance(e,"local")},e.session=function(e){return this.getInstance(e,"session")},e.clearInstance=function(e,t){void 0===t&&(t="local");var n=this.getInstanceKey(e,t);this.instances.delete(n)},e.clearAllInstances=function(){this.instances.clear()};var t=e.prototype;return t.getStore=function(){return this.store||(this.store="local"===this.storeType?localStorage:sessionStorage),this.store},t.set=function(e,t){try{var n,r=m({},this.getAll(),((n={})[e]=t,n));this.getStore().setItem(this.storageKey,JSON.stringify(r))}catch(e){throw console.error("WebStore.set 失败:",e),e}},t.get=function(e){try{var t=this.getAll();return null==t?void 0:t[e]}catch(e){throw console.error("WebStore.get 失败:",e),e}},t.getAll=function(){try{var e=this.getStore().getItem(this.storageKey);return e?JSON.parse(e):{}}catch(e){return console.error("WebStore.getAll 失败:",e),{}}},t.remove=function(e){try{var t=this.getAll();t&&e in t&&(delete t[e],this.getStore().setItem(this.storageKey,JSON.stringify(t)))}catch(e){throw console.error("WebStore.remove 失败:",e),e}},t.clear=function(){try{this.getStore().removeItem(this.storageKey)}catch(e){throw console.error("WebStore.clear 失败:",e),e}},t.setMultiple=function(e){try{var t=m({},this.getAll(),e);this.getStore().setItem(this.storageKey,JSON.stringify(t))}catch(e){throw console.error("WebStore.setMultiple 失败:",e),e}},t.onChanged=function(e){var t=this;window.addEventListener("storage",function(n){if(n.key===t.storageKey&&n.storageArea===t.getStore()){var r,o=((r={})[t.storageKey]={oldValue:n.oldValue?JSON.parse(n.oldValue):void 0,newValue:n.newValue?JSON.parse(n.newValue):void 0},r);e(o)}})},t.has=function(e){try{return void 0!==this.get(e)}catch(e){return console.error("WebStore.has 失败:",e),!1}},t.getSize=function(){try{var e=this.getStore().getItem(this.storageKey)||"";return new Blob([e]).size}catch(e){return console.error("WebStore.getSize 失败:",e),0}},t.getStoreKey=function(){return this.storageKey},e}();function P(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}b.instances=new Map;var k=/*#__PURE__*/function(){function e(e,t){void 0===t&&(t="local"),this.storageKey=void 0,this.storeType=void 0,this.store=void 0,this.storageKey=e,this.storeType=t}e.getInstanceKey=function(e,t){return void 0===t&&(t="local"),t+":"+e},e.getInstance=function(t,n){void 0===n&&(n="local");var r=this.getInstanceKey(t,n);return this.instances.has(r)||this.instances.set(r,new e(t,n)),this.instances.get(r)},e.local=function(e){return this.getInstance(e,"local")},e.sync=function(e){return this.getInstance(e,"sync")},e.clearInstance=function(e,t){void 0===t&&(t="local");var n=this.getInstanceKey(e,t);this.instances.delete(n)},e.clearAllInstances=function(){this.instances.clear()};var t=e.prototype;return t.getStore=function(){return this.store||(this.store=chrome.storage[this.storeType]),this.store},t.set=function(e,t){try{var n=this;return Promise.resolve(P(function(){return Promise.resolve(n.getAll()).then(function(r){var o,i,a=m({},r,((o={})[e]=t,o));return Promise.resolve(n.getStore().set((i={},i[n.storageKey]=a,i))).then(function(){})})},function(e){throw console.error("ChromeStore.set 失败:",e),e}))}catch(e){return Promise.reject(e)}},t.get=function(e){try{var t=this;return Promise.resolve(P(function(){return Promise.resolve(t.getAll()).then(function(t){return null==t?void 0:t[e]})},function(e){throw console.error("ChromeStore.get 失败:",e),e}))}catch(e){return Promise.reject(e)}},t.getAll=function(){try{var e=this;return Promise.resolve(P(function(){return Promise.resolve(e.getStore().get(e.storageKey)).then(function(t){return t[e.storageKey]||{}})},function(e){throw console.error("ChromeStore.getAll 失败:",e),e}))}catch(e){return Promise.reject(e)}},t.remove=function(e){try{var t=this;return Promise.resolve(P(function(){return Promise.resolve(t.getAll()).then(function(n){var r=function(){var r;if(n&&e in n)return delete n[e],Promise.resolve(t.getStore().set((r={},r[t.storageKey]=n,r))).then(function(){})}();if(r&&r.then)return r.then(function(){})})},function(e){throw console.error("ChromeStore.remove 失败:",e),e}))}catch(e){return Promise.reject(e)}},t.clear=function(){try{var e=this;return Promise.resolve(P(function(){return Promise.resolve(e.getStore().remove(e.storageKey)).then(function(){})},function(e){throw console.error("ChromeStore.clear 失败:",e),e}))}catch(e){return Promise.reject(e)}},t.setMultiple=function(e){try{var t=this;return Promise.resolve(P(function(){return Promise.resolve(t.getAll()).then(function(n){var r,o=m({},n,e);return Promise.resolve(t.getStore().set((r={},r[t.storageKey]=o,r))).then(function(){})})},function(e){throw console.error("ChromeStore.setMultiple 失败:",e),e}))}catch(e){return Promise.reject(e)}},t.onChanged=function(e){var t=this;chrome.storage.onChanged.addListener(function(n,r){r===t.storeType&&n[t.storageKey]&&e(n)})},t.has=function(e){try{var t=this;return Promise.resolve(P(function(){return Promise.resolve(t.get(e)).then(function(e){return void 0!==e})},function(e){return console.error("ChromeStore.has 失败:",e),!1}))}catch(e){return Promise.reject(e)}},t.getSize=function(){try{var e=this;return Promise.resolve(P(function(){return Promise.resolve(e.getAll()).then(function(e){var t=JSON.stringify(e);return new Blob([t]).size})},function(e){return console.error("ChromeStore.getSize 失败:",e),0}))}catch(e){return Promise.reject(e)}},t.getStoreKey=function(){return this.storageKey},e}();k.instances=new Map;var S="https://www.linkedin.com/voyager/api";function C(e,t){var n,r={"csrf-token":e};return t&&(n="string"==typeof t?t:Object.entries(t).map(function(e){return e[0]+"="+e[1]}).join("; "))&&(r.Cookie=n),r}var x={profilePage:{userPicture:[".pv-top-card__non-self-photo-wrapper img","#recent-activity-top-card img",".pv-top-card__photo-wrapper img",'div[componentkey^="com.linkedin.sdui.profile.card"] div[data-view-name="profile-top-card-member-photo"] img'],userName:['a[href^="/in"] h1',"#recent-activity-top-card h3",'div[data-view-name="profile-top-card-verified-badge"] div[role="button"]'],userOccupation:[".artdeco-entity-lockup .artdeco-entity-lockup__subtitle","#recent-activity-top-card h4"],linkedinProfileCard:[".scaffold-layout__main .artdeco-card:first-child",'div[componentkey^="com.linkedin.sdui.profile.card"]'],privateProfileInfoSection:[".pv-profile-info-section"],howToContainer:["#profile-content, header#global-nav"],companyName:[".top-card-background-hero-image+div .mt2 ul>li span",'div[componentkey^="com.linkedin.sdui.profile.card"] div:has(div[data-view-name="profile-top-card-verified-badge"]) + div div[role="button"] p'],companyLogo:[".top-card-background-hero-image+div .mt2 ul>li img"],campaignsListContainer:[".ui-row.sm.campaigns-list-container"],contactListContainer:[".ui-row.sm.contact-list-container"],location:["#profile-content .artdeco-card .top-card-background-hero-image+div .text-body-small.inline.t-black--light"],campaignsListContainerDisplay:[".ui-col.sm.campaigns-list-container-display"],contactListContainerDisplay:[".ui-col.sm.contact-list-container-display"],mainExperienceContainer:[".artdeco-card:has(#experience) li:first-child",'div[componentkey^="com.linkedin.sdui.profile.card"][componentkey$="ExperienceTopLevelSection"] div:has(h2) + div > div'],experienceCompanyLogo:['[data-field="experience_company_logo"] img','div[componentkey^="com.linkedin.sdui.profile.card"][componentkey$="ExperienceTopLevelSection"] div:has(h2) + div figure[data-view-name="image"] img'],experienceCompanyName:['div:has([data-field="experience_company_logo"])+div .t-normal span:not(.visually-hidden)'],experienceOccupation:['div:has([data-field="experience_company_logo"])+div .t-bold span:not(.visually-hidden)'],experienceMultipleCompany:["li:has([data-view-name=profile-component-entity] .pvs-entity__sub-components .pvs-entity__sub-components) .t-bold span:not(.visually-hidden)"],experienceMultipleOccupation:['[data-view-name="profile-component-entity"] li:first-child .t-bold span:not(.visually-hidden)']},salesNavProfilePage:{profileCardSection:["#profile-card-section"],userName:['#profile-card-section [data-anonymize="person-name"]'],userPicture:['#profile-card-section img[data-anonymize="headshot-photo"]'],userOccupation:['#profile-card-section [data-anonymize="headline"]'],profileUrl:['#profile-card-section a[href^="/sales/lead"]'],linkedinProfileCard:["#profile-card-section"],campaignsListContainer:[".ui-row.sm.campaigns-list-container"],contactListContainer:[".ui-row.sm.contact-list-container"],campaignsListContainerDisplay:[".ui-col.sm.campaigns-list-container-display"],contactListContainerDisplay:[".ui-col.sm.contact-list-container-display"],location:["#profile-card-section>section>div>div:last-child div:has(svg)"],companyName:['#profile-card-section a[data-anonymize="company-name"]'],companyLogo:['#profile-card-section img[data-anonymize="company-logo"]'],moreInfoButton:["#profile-card-section section[data-x--lead-actions-bar] button[data-x--lead-actions-bar-overflow-menu]",'#profile-card-section button[aria-label="Open actions overflow menu"]'],linkedinProfileLinkButton:['#hue-web-menu-outlet a[href^="https://www.linkedin.com/in/"]'],mainExperienceContainer:['[data-sn-view-name="feature-lead-experience"]'],experienceCompanyLogo:['li:first-child img[data-anonymize="company-logo"]'],experienceCompanyName:['li:first-child [data-anonymize="company-name"]'],experienceOccupation:['li:first-child [data-anonymize="job-title"]'],experienceMultipleOccupation:['ul li ul li:first-child [data-anonymize="job-title"]','ul li [data-anonymize="job-title"]'],experienceMultipleCompany:['li:first-child [data-anonymize="company-name"]']},searchPeoplePage:{searchEntityResult:['[data-view-name="search-entity-result-universal-template"]'],linkedinUrl:['a[data-test-app-aware-link][href^="https://www.linkedin.com/in/"]','a[data-view-name="search-result-lockup-title"]'],image:[".presence-entity img","a>div>div>figure>img"],userOccupation:['p:has(a[data-view-name="search-result-lockup-title"]) + p',".entity-result__primary-subtitle",".entity-result__divider > div div:nth-child(2)","div>div>div:nth-child(2)>div>div:nth-child(2)","figure + div p:nth-child(2)"],fullName:[".entity-result__title-text a span>span",".entity-result__title-line a span>span",".entity-result__title-line span>a>span>span","a:has(+.entity-result__badge)>span>span",".linked-area div:nth-child(2) > div:first-child > div.t-roman.t-sans a",'a[data-view-name="search-result-lockup-title"]'],resultList:[".search-results-container>div:has(.reusable-search__result-container)"],actionsDiv:[".entity-result__actions",".linked-area > div > div:last-child","div:has(figure) > div:last-child"],validResult:["[data-chameleon-result-urn] , .reusable-search__result-container"],searchResult:[".search-results-container li:has(>[data-chameleon-result-urn])",'[data-view-name="people-search-result"]'],searchResultsContainer:[".search-results-container",'[role="main"] div:has(>hr[role="presentation"])'],mainLayoutLeft:[".search-marvel-srp",'[role="main"] div:has(hr)>div>div'],howToContainer:[".hasLegacyFeedLineHeight div:has(main)",".authentication-outlet"]},searchAllPage:{peopleButton:["nav ul.search-reusables__filter-list>li>button"],toolbar:[".scaffold-layout-toolbar"]}};function L(e,t,n){switch(n){case"all":var r=e.querySelectorAll(t);return r.length>0?Array.from(r):null;case"closest":return e instanceof HTMLElement?e.closest(t):null;default:return e.querySelector(t)}}function I(e){var t=e.page,n=e.key,r=e.container,o=e.mode;null!=r||(r=document);for(var i,a,s=h(t&&n?x[(i={page:t,key:n}).page][i.key]:[e.selector]);!(a=s()).done;){var l=L(r,a.value,o);if(l)return l}return null}function N(e){if(!e)return"";var t=document.createElement("textarea");return t.innerHTML=e,t.value.trim()}var M,E,O={"":0,chrome:1,"chrome-extension":2,"view-source":3,ftp:4,file:5,data:6,blob:7,about:8};function j(e){void 0===e&&(e="");var t="",n=e.split("#")[0].toLocaleLowerCase();return/^https\:\/\/(www|.{2})\.linkedin\.com\/in\/[^/?]+(\/recent-activity\/|\/details\/|\/overlay\/|\/?\?[^/]*|\/?$)/.test(n)||/^https\:\/\/(www|.{2})\.linkedin\.com\/sales\/people\/(.+?),/.test(n)||/^https\:\/\/(www|.{2})\.linkedin\.com\/sales\/(profile|lead)\/([^,]{39}),/.test(n)?t="profile":n.includes("linkedin.com/feed")?t="feed":n.includes("linkedin.com/posts/")?t="post":n.includes("linkedin.com/login")||n.includes("linkedin.com/checkpoint")||n.includes("linkedin.com/authwall")?t="login":n.includes("linkedin.com/company/")?t="company":n.includes("linkedin.com/messaging/thread/")?t="messages":n.includes("linkedin.com/search/results/people/?")||n.includes("linkedin.com/sales/search/people")?t="search-people":n.includes("linkedin.com/search/results/all")?t="search-all":n.includes("linkedin.com/mynetwork/")&&(t="connections"),t}function U(e){var t;void 0===e&&(e="");var n=((e=e||(null==(t=window.top)?void 0:t.location.href)||document.URL).match(/linkedin\.com\/in\/([^?/]+)/)||[])[1]||(e.match(/linkedin\.com\/sales\/people\/(.+?),/)||[])[1]||(e.match(/linkedin\.com\/sales\/(?:profile|lead)\/([^,]{39}),/)||[])[1]||"";return decodeURIComponent(n)}function T(e){var t;void 0===e&&(e="");var n=((e=e||(null==(t=window.top)?void 0:t.location.href)||document.URL).match(/linkedin\.com\/company\/([^?/]+)/)||[])[1]||"";return decodeURIComponent(n)}function A(e){if(e){var t=e.match(/:(\d+)$/);return t?t[1]:void 0}}function R(e){if(e){var t=e.match(/,(\d+)\)$/);return t?t[1]:void 0}}function _(e){if(null!=e&&e.year)return{year:e.year,month:e.month}}function K(e,t,n){if(!e||0===Object.keys(e).length)return n||"";if(t&&e[t])return e[t];var r=Object.keys(e),o=r.find(function(e){return e.startsWith("en")});return o?e[o]:e[r[0]]||n||""}function D(e,t){if(!e||!t)return{};for(var n={},r=0,o=Object.entries(e);r<o.length;r++){var i=o[r],a=i[0],s=i[1];a!==t&&s&&(n[a]=s)}return n}function H(e){return z(e)}function z(e){var t,n,r;if(e){var o=(e.rootUrl&&e.artifacts?e:null)||e.vectorImage||(null==(t=e.image)?void 0:t["com.linkedin.common.VectorImage"])||e["com.linkedin.common.VectorImage"]||(null==(n=e.displayImageReference)?void 0:n.vectorImage);if(null!=o&&o.rootUrl&&null!=o&&null!=(r=o.artifacts)&&r.length){var i=o.artifacts,a=i.reduce(function(e,t){return((null==t?void 0:t.width)||0)>((null==e?void 0:e.width)||0)?t:e},i[0]);if(null!=a&&a.fileIdentifyingUrlPathSegment)return o.rootUrl+a.fileIdentifyingUrlPathSegment}}}exports.ContactInfoSource=void 0,(M=exports.ContactInfoSource||(exports.ContactInfoSource={})).PUBLIC="public",M.MANUAL="manual",M.APOLLO="apollo",M.LUSHA="lusha",M.HUNTER="hunter",M.ROCKETREACH="rocketreach",M.SNOV="snov",M.CLEARBIT="clearbit",exports.QueryType=void 0,(E=exports.QueryType||(exports.QueryType={})).EMAIL="email",E.PHONE="phone",E.BOTH="both",exports.ChromeStore=k,exports.Draggable=w,exports.MemoryStore=p,exports.RealUndefined=e,exports.WebStore=b,exports.cacheWrapper=function(e,t){void 0===t&&(t=u);var n=function(){var n=[].slice.call(arguments),i=r(n)+e.name+(t.identifier||"");if(c(i))return Promise.resolve(o(l(i)));if(s[i]){var d=Object.assign({},u,t);return new Promise(function(e){var t=Date.now(),n=setInterval(function(){c(i)?(clearInterval(n),e(o(l(i)))):Date.now()-t>d.timeout&&(s[i]=!1,clearInterval(n),e(o(d.timeoutResult)))},100)})}return s[i]=!0,e.apply(this,n).then(function(e){return a[i]=e,o(a[i])}).catch(function(e){throw e}).finally(function(){s[i]=!1})};return Object.defineProperty(n,"name",{value:"cacheWrapper_"+e.name,configurable:!0}),n},exports.cloneDeep=o,exports.createDefaultObject=i,exports.createElement=function e(t){var n=void 0===t?{}:t,r=n.tag,o=n.children,i=void 0===o?[]:o,a=n.props,s=void 0===a?{}:a,l=n.attrs,c=void 0===l?{}:l,u=n.styles,d=void 0===u?{}:u,m=document.createElement(void 0===r?"div":r);Object.assign(m,s);for(var p=0,v=Object.entries(c);p<v.length;p++){var g=v[p],y=g[1];!1!==y&&m.setAttribute(g[0],y)}for(var w=0,b=Object.entries(d);w<b.length;w++){var P=b[w];f(m,P[0],P[1])}for(var k,S=h(Array.isArray(i)?i:[i]);!(k=S()).done;){var C=k.value;C&&("object"==typeof C?C instanceof Element?m.appendChild(C):m.appendChild(e(C)):m.appendChild(document.createTextNode(C)))}return m},exports.createMessageBus=function(e){void 0===e&&(e={});var t=e.debug,n=void 0!==t&&t,r=e.logPrefix,o=void 0===r?"[MessageBus]":r,i=new Map,a=!1;function s(e){var t;n&&(t=console).error.apply(t,[o+" "+e].concat([].slice.call(arguments,1)))}function l(){a||(chrome.runtime.onMessage.addListener(function(e,t,n){if(e&&"string"==typeof e.type){var r=i.get(e.type);if(r)try{var o=r(e.payload,t);return o instanceof Promise?(o.then(n).catch(function(t){s('Error handling "'+String(e.type)+'":',t),n({__error:!0,message:t instanceof Error?t.message:String(t)})}),!0):(n(o),!1)}catch(t){return s('Error handling "'+String(e.type)+'":',t),n({__error:!0,message:t instanceof Error?t.message:String(t)}),!1}}}),a=!0)}return{send:function(e){return chrome.runtime.sendMessage({type:e,payload:[].slice.call(arguments,1)[0]})},sendToTab:function(e,t){return chrome.tabs.sendMessage(e,{type:t,payload:[].slice.call(arguments,2)[0]})},on:function(e,t){return l(),i.set(e,t),function(){i.delete(e)}},onMany:function(e){l();for(var t=[],n=0,r=Object.entries(e);n<r.length;n++){var o=r[n],a=o[0],s=o[1];s&&(i.set(a,s),t.push(a))}return function(){for(var e=0,n=t;e<n.length;e++)i.delete(n[e])}},hasHandler:function(e){return i.has(e)},getRegisteredTypes:function(){return Array.from(i.keys())},clearAllHandlers:function(){i.clear()}}},exports.createSvg=function(e){return"string"==typeof e?g(e):v(e)},exports.createSvgFromUrl=function(e){try{return Promise.resolve(function(t,n){try{var r=Promise.resolve(fetch(e)).then(function(e){if(!e.ok)throw new Error("网络请求失败: "+e.status+" "+e.statusText);return Promise.resolve(e.text()).then(g)})}catch(e){return n(e)}return r&&r.then?r.then(void 0,n):r}(0,function(e){var t=e instanceof Error?e.message:"未知错误";throw new Error("无法创建 SVG 元素: "+t)}))}catch(e){return Promise.reject(e)}},exports.debounce=function(e,t){var n=null;return function(){var r=arguments,o=this;null!==n&&clearTimeout(n),n=setTimeout(function(){e.apply(o,[].slice.call(r)),n=null},t)}},exports.decodeJWT=function(e){var t=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=decodeURIComponent(atob(t).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(n)},exports.delayExecution=function(e,t){void 0===t&&(t=0);var n=[].slice.call(arguments,2);return new Promise(function(r){0===t?r(e.apply(void 0,n)):setTimeout(function(){r(e.apply(void 0,n))},t)})},exports.extractCompaniesFromRawProfile=function(e){var t,n=new Map;return null==(t=e.profilePositionGroups)||null==(t=t.elements)||t.forEach(function(e){var t;[e.company].concat((null==(t=e.profilePositionInPositionGroup)||null==(t=t.elements)?void 0:t.map(function(e){return e.company}))||[]).filter(Boolean).forEach(function(e){var t,r=A(e.entityUrn);if(r&&!n.has(r)){var o;if(e.industry&&null!=(t=e.industryUrns)&&t.length){var i=e.industry[e.industryUrns[0]];o=null==i?void 0:i.name}n.set(r,{linkedinId:r,universalName:e.universalName,name:e.name||"",industry:o,employeeCountRange:e.employeeCountRange?{start:e.employeeCountRange.start,end:e.employeeCountRange.end}:void 0,logoUrl:H(e.logo)})}})}),Array.from(n.values())},exports.generateStableUniqueKey=r,exports.getCompanyPublicId=T,exports.getContactInfo=function(){var e,t,n,r,o,i,a,s=window.location.href.includes("linkedin.com/sales")?"salesNavProfilePage":"profilePage";function l(e){return I({page:s,key:e,container:document})}var c=null==(e=l("userName"))?void 0:e.innerText;if(!c)return console.error("extractUserInfos: no userName found"),{};var u,d=null==(t=l("userPicture"))?void 0:t.src,h=null==(n=l("userOccupation"))?void 0:n.innerHTML,m=null==(r=l("companyName"))?void 0:r.innerText,p=null==(o=l("companyLogo"))?void 0:o.src,f=null==(i=l("location"))?void 0:i.innerText;return"salesNavProfilePage"===s&&(u=/linkedin\.com\/sales\/lead/i.test(window.location.href)?window.location.href:null==(a=l("profileUrl"))?void 0:a.href),{name:N(c),profileUrl:u,picture:d,occupation:N(h),companyName:m,companyPicture:p,location:f}},exports.getCookie=function(e,t,n){return void 0===n&&(n=!1),chrome.cookies.get({url:e,name:t}).then(function(e){var t;return n?(null==e||null==(t=e.value)?void 0:t.replace(/"/g,""))||"":null!=e?e:void 0})},exports.getCookies=function(e,t){return void 0===t&&(t=!1),chrome.cookies.getAll({url:e}).then(function(e){return t?function(e){return e.map(function(e){return e.name+"="+e.value}).join("; ")}(e):e})},exports.getElement=I,exports.getExtensionInfo=function(){var e,t,n;return{locale:null==(e=chrome.i18n)?void 0:e.getUILanguage(),extId:null==(t=chrome.runtime)?void 0:t.id,version:null==(n=chrome.runtime)?void 0:n.getManifest().version}},exports.getGlobal=function(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:this},exports.getLinkedinCompany=function(e,t){var n=t.csrfToken,r=t.cookies;try{var o="string"==typeof e?{universalName:e}:e,i="universalName"in o,a=S+"/organization/companies"+(i?"?q=universalName&universalName="+o.universalName:"/"+o.urn),s=C(n,r);return Promise.resolve(fetch(a,{method:"GET",headers:s}).then(function(e){try{var t,n=function(){if(e.ok)return Promise.resolve(e.json()).then(function(e){if(i){var n,r=(null==(n=e.elements)?void 0:n[0])||null;return t=1,r}return t=1,e})}();return Promise.resolve(n&&n.then?n.then(function(e){return t?e:null}):t?n:null)}catch(e){return Promise.reject(e)}}).catch(function(e){return console.error(e),null}))}catch(e){return Promise.reject(e)}},exports.getLinkedinMe=function(e){var t=e.csrfToken,n=e.cookies;try{var r=S+"/me",o=C(t,n);return Promise.resolve(fetch(r,{method:"GET",headers:o}).then(function(e){try{return Promise.resolve(e.ok?e.json():null)}catch(e){return Promise.reject(e)}}).catch(function(e){return console.error(e),null}))}catch(e){return Promise.reject(e)}},exports.getLinkedinPageType=j,exports.getLinkedinProfile=function(e,t){var n=t.csrfToken,r=t.cookies;try{var o=S+"/identity/dash/profiles?q=memberIdentity&memberIdentity="+e+"&decorationId=com.linkedin.voyager.dash.deco.identity.profile.FullProfileWithEntities-26",i=C(n,r);return Promise.resolve(fetch(o,{method:"GET",headers:i}).then(function(e){try{var t,n=function(){if(e.ok)return Promise.resolve(e.json()).then(function(e){var n,r=(null==(n=e.elements)?void 0:n[0])||null;return t=1,r})}();return Promise.resolve(n&&n.then?n.then(function(e){return t?e:null}):t?n:null)}catch(e){return Promise.reject(e)}}).catch(function(e){return console.error(e),null}))}catch(e){return Promise.reject(e)}},exports.getLinkedinPublicId=function(e){var t;return void 0===e&&(e=""),U(e=e||(null==(t=window.top)?void 0:t.location.href)||document.URL)||T(e)||""},exports.getPageType=function(e){if(void 0===e&&(e=""),!e)return"";var t=Object.keys(O),n=new URL(e).protocol.replace(":","");return t.includes(n)?n:j(e)},exports.getPostPublicId=function(e){var t;void 0===e&&(e="");var n=((e=e||(null==(t=window.top)?void 0:t.location.href)||document.URL).match(/linkedin\.com\/posts\/([^\/]+)\//)||[])[1]||"";return decodeURIComponent(n)},exports.getProfilePublicId=U,exports.isCloneable=t,exports.isErrorResponse=function(e){return"object"==typeof e&&null!==e&&"__error"in e&&!0===e.__error},exports.isLinkedInUrl=function(e){return/^https?:\/\/(www|.{2})\.linkedin\.com/.test(e)},exports.isPrimitive=n,exports.launchWebAuthFlow=function(e){var t=e.clientId,n=e.responseType,r=void 0===n?"code":n,o=e.state,i=e.nonce,a=e.interactive,s=void 0===a||a;try{var l=chrome.identity.getRedirectURL(),c=Array.isArray(r)?r:[r],u=new URL("https://accounts.google.com/o/oauth2/v2/auth");return u.searchParams.set("client_id",t),u.searchParams.set("redirect_uri",l),u.searchParams.set("response_type",c.join(" ")),u.searchParams.set("scope","openid email profile"),i&&u.searchParams.set("nonce",i),o&&u.searchParams.set("state",o),Promise.resolve(chrome.identity.launchWebAuthFlow({url:u.toString(),interactive:s}).then(function(e){if(!e)return Promise.reject(new Error("redirectUrl is null"));var t=e.includes("?")?"?":"#",n=new URLSearchParams(e.split(t)[1]),r={};return n.forEach(function(e,t){r[t]=e}),r}).catch(function(e){return console.log("error",e),Promise.reject(e)}))}catch(e){return Promise.reject(e)}},exports.pageTypeMap=O,exports.scrollToBottom=y,exports.scrollToBottomIfNeeded=function(e){e&&("true"!==e.dataset.isListeningForUserScroll&&(function(e){e&&e.addEventListener("scroll",function(){!function(e,t){e.dataset.userInteracted=t?"true":"false"}(e,e.scrollTop+e.clientHeight<e.scrollHeight-5)})}(e),e.dataset.isListeningForUserScroll="true"),"true"!==e.dataset.userInteracted&&y(e))},exports.singleExecutionWrapper=function(t,n){void 0===n&&(n=0);var r=function(){if(r.isExecuting)return Promise.resolve(e);r.isExecuting=!0;var o=performance.now(),i=t.apply(this,[].slice.call(arguments));return i.finally(function(){var e=performance.now()-o;n&&n>e?setTimeout(function(){r.isExecuting=!1},n-e):r.isExecuting=!1}),i};return r.isExecuting=!1,r},exports.transformRawCompany=function(e){var t,n,r,o,i,a,s,l,c,u,d=(null==(t=e.elements)?void 0:t[0])||e,m=A(d.entityUrn);if(!m)throw new Error("Cannot extract linkedinId from company data");for(var p,f=(null!=(n=d.defaultLocale)&&n.language&&null!=(r=d.defaultLocale)&&r.country?d.defaultLocale.language+"_"+d.defaultLocale.country:null)||(null!=(o=d.multiLocaleNames)&&o.localized?Object.keys(d.multiLocaleNames.localized)[0]:null)||"en_US",v=null==(i=d.multiLocaleNames)?void 0:i.localized,g=K(v,f,d.name),y=null==(a=d.multiLocaleDescriptions)?void 0:a.localized,w=K(y,f,"string"==typeof d.description?d.description:void 0)||void 0,b={},P=D(v,f),k=D(y,f),S=new Set([].concat(Object.keys(P),Object.keys(k))),C=h(S);!(p=C()).done;){var x=p.value,L={};P[x]&&(L.name=P[x]),k[x]&&(L.description=k[x]),Object.keys(L).length>0&&(b[x]=L)}var I=d.headquarter||(null==(s=d.confirmedLocations)?void 0:s.find(function(e){return e.headquarter})),N=z(d.logo)||z(null==(l=d.logos)?void 0:l.logo),M=z(d.backgroundCoverImage),E=d.jobSearchPageUrl||void 0,O=null==(c=d.companyIndustries)||null==(c=c[0])?void 0:c.localizedName,j=S.size>0?[f].concat(Array.from(S)):void 0;return{linkedinId:m,universalName:d.universalName,name:g,description:w,industry:O,employeeCountRange:d.staffCount?{start:d.staffCount,end:d.staffCount}:d.staffCountRange?{start:d.staffCountRange.start,end:d.staffCountRange.end}:void 0,headquarters:I?{country:I.country,city:I.city,geographicArea:I.geographicArea,postalCode:I.postalCode,line1:I.line1}:void 0,logoUrl:N,backgroundCoverUrl:M,specialities:d.specialities,companyType:d.type,foundedYear:null==(u=d.foundedOn)?void 0:u.year,websiteUrl:d.companyPageUrl,jobSearchPageUrl:E,primaryLocale:f,supportedLocales:j,translations:Object.keys(b).length>0?b:void 0}},exports.transformRawProfile=function(e){var t,n,r,o,i,a,s,l,c=A(e.objectUrn);if(!c)throw new Error("Cannot extract memberId from rawProfile");for(var u,d=function(e){if(e)return e.language+"_"+e.country}(e.primaryLocale),m=function(e){if(null!=e&&e.length)return e.map(function(e){return e.language+"_"+e.country})}(e.supportedLocales),p=K(e.multiLocaleFirstName,d,e.firstName),f=K(e.multiLocaleLastName,d,e.lastName),v=K(e.multiLocaleHeadline,d,e.headline),g=K(e.multiLocaleSummary,d,e.summary),y={},w=(null==m?void 0:m.filter(function(e){return e!==d}))||[],b=h(w);!(u=b()).done;){var P,k,S,C,x=u.value,L={},I=null==(P=e.multiLocaleFirstName)?void 0:P[x],N=null==(k=e.multiLocaleLastName)?void 0:k[x],M=null==(S=e.multiLocaleHeadline)?void 0:S[x],E=null==(C=e.multiLocaleSummary)?void 0:C[x];I&&(L.firstName=I),N&&(L.lastName=N),M&&(L.headline=M),E&&(L.summary=E),Object.keys(L).length>0&&(y[x]=L)}var O=(null==(t=e.profileSkills)||null==(t=t.elements)?void 0:t.map(function(e){return e.name}))||[],j=(null==(n=e.profileLanguages)||null==(n=n.elements)?void 0:n.map(function(e){return{name:e.name,proficiency:e.proficiency}}))||[],U=(null==(r=e.profileHonors)||null==(r=r.elements)?void 0:r.map(function(e){return{title:e.title,issuer:e.issuer,issuedOn:_(e.issuedOn)}}))||[],T=(null==(o=e.profileEducations)||null==(o=o.elements)?void 0:o.map(function(e){var t,n,r;return{school:K(e.multiLocaleSchoolName,d,e.schoolName||(null==(t=e.school)?void 0:t.name)),degree:K(e.multiLocaleDegreeName,d,e.degreeName)||void 0,fieldOfStudy:K(e.multiLocaleFieldOfStudy,d,e.fieldOfStudy)||void 0,startDate:_(null==(n=e.dateRange)?void 0:n.start),endDate:_(null==(r=e.dateRange)?void 0:r.end)}}))||[],D=(null==(i=e.profileCertifications)||null==(i=i.elements)?void 0:i.map(function(e){var t,n;return{name:K(e.multiLocaleName,d,e.name),authority:K(e.multiLocaleAuthority,d,e.authority)||void 0,startDate:_(null==(t=e.dateRange)?void 0:t.start),endDate:_(null==(n=e.dateRange)?void 0:n.end),licenseNumber:e.licenseNumber,url:e.url}}))||[],W=[];null==(a=e.profilePositionGroups)||null==(a=a.elements)||a.forEach(function(e){var t;((null==(t=e.profilePositionInPositionGroup)?void 0:t.elements)||[]).forEach(function(t){for(var n,r,o,i,a,s,l=t.company||e.company,c=A(t.companyUrn||(null==l?void 0:l.entityUrn)),u=K(t.multiLocaleTitle,d,t.title),m=K(t.multiLocaleCompanyName,d,t.companyName||(null==l?void 0:l.name)),p=K(t.multiLocaleDescription,d,t.description)||void 0,f={},v=h(w);!(a=v()).done;){var g,y,b,P=a.value,k={},S=null==(g=t.multiLocaleTitle)?void 0:g[P],C=null==(y=t.multiLocaleDescription)?void 0:y[P],x=null==(b=t.multiLocaleCompanyName)?void 0:b[P];S&&(k.title=S),C&&(k.description=C),x&&(k.companyName=x),Object.keys(k).length>0&&(f[P]=k)}if(null!=l&&l.industry&&null!=l&&null!=(n=l.industryUrns)&&n.length){var L=l.industry[l.industryUrns[0]];s=null==L?void 0:L.name}W.push({linkedinPositionId:R(t.entityUrn),companyName:m,companyLinkedinId:c,companyUniversalName:null==l?void 0:l.universalName,title:u,description:p,startDate:_(null==(r=t.dateRange)?void 0:r.start),endDate:_(null==(o=t.dateRange)?void 0:o.end),isCurrent:!(null!=(i=t.dateRange)&&i.end),companyLogoUrl:H(null==l?void 0:l.logo),companyIndustry:s,companyEmployeeCountRange:null!=l&&l.employeeCountRange?{start:l.employeeCountRange.start,end:l.employeeCountRange.end}:void 0,translations:Object.keys(f).length>0?f:void 0})})});var B,F,V=(null==(s=e.geoLocation)||null==(s=s.geo)?void 0:s.defaultLocalizedName)||void 0,Y=null==(l=e.industry)?void 0:l.name;return{memberId:c,publicIdentifier:e.publicIdentifier,firstName:p,lastName:f,headline:v||void 0,summary:g||void 0,location:V,pictureUrl:(F=e.profilePicture,z(F)),backgroundPictureUrl:(B=e.backgroundPicture,z(B)),isPremium:!0===e.premium,industry:Y,primaryLocale:d,supportedLocales:m,skills:O,languages:j.length>0?j:void 0,honors:U.length>0?U:void 0,educations:T.length>0?T:void 0,certifications:D.length>0?D:void 0,positions:W.length>0?W:void 0,translations:Object.keys(y).length>0?y:void 0}};
2
2
  //# sourceMappingURL=index.cjs.map