"use strict";(self.webpackChunk_client_app_store=self.webpackChunk_client_app_store||[]).push([[8064],{83629:function(t,e,n){n.r(e),n.d(e,{default:function(){return te}});var i=function(){var t=this,e=t._self._c;return t.isCommonCase&&t.showBatchSelect?e("AppBatchSelect",{attrs:{"app-list":t.caseApps,"batch-select-apps":t.batchSelectApps,title:t.promotionCaseInfo.title,"batch-pre-check":t.batchPreCheck,"batch-price-info":t.batchPriceInfo},on:{submit:t.batchSelectSubmit}}):t.isCommonCase&&t.showBatchFail?e("AuthBatchFail",{attrs:{"app-list":t.batchSelectApps,"batch-err-info":t.batchErrInfo,tel:t.telephone},on:{submit:t.navCaseDetail}}):e("AuthLayout",{},["SUCCESS"===t.stage?[e("AuthInfoTip",{attrs:{title:t.authSucConfig.title,content:t.authSucConfig.desc}})]:"INFO"===t.stage?[e("AppBeforeAuth",{attrs:{app:t.appInfo,info:t.beforeAuthInfo}})]:"ERROR"===t.stage?[e("AuthError",{attrs:{title:t.errText.title,content:t.errText.content,"btn-text":t.errText.btn},on:{confirm:t.errorConfirm}})]:[e("AppAuthHead",{attrs:{"promotion-case-info":t.promotionCaseInfo,apps:t.apps,"is-admin":t.isAdmin,"can-manage":t.canManage}},[e("template",{slot:"desc"},[e("PriceInfo",{attrs:{"install-mode":t.InstallMode.AuthMode_User,versions:t.displayVersions,"app-id":t.appId,"app-info":t.serviceCorpApp,"price-info":t.priceInfo,"paid-info":t.paidAppInfo,"can-purchase-app":t.settings.canPurchaseApp,"can-manage":t.canManage,"is-pay-open":t.settings.isPayOpen}})],1)],2),t._v(" "),e("AuthDesc",{attrs:{"text-list":t.authDescConfig}}),t._v(" "),t.isCommonCase||t.isPromotionCase?e("AppList",{attrs:{apps:t.apps}}):t._e(),t._v(" "),t.canInviteMember?e("AppRange",{attrs:{title:n(11974).nI().t("可见范围")},on:{headClick:t.selectContact}},[e("AuthRangeText",{attrs:{slot:"head_right",scope:t.range.scope,"user-count":t.range.count},slot:"head_right"})],1):t._e(),t._v(" "),e("PermissionInfo",{attrs:{config:t.config,apps:t.apps,"brand-name":t.brandName,"auth-mode":t.authMode,"oper-table":t.operTable}}),t._v(" "),t.showOauthPrivacy?e("AuthPrivacy",{attrs:{"contact-sensitive-flag":t.contactSensitiveFlag,"user-info":t.userInfo},model:{value:t.checkSenstivelFlag,callback:function(e){t.checkSenstivelFlag=e},expression:"checkSenstivelFlag"}}):t._e(),t._v(" "),e("PermissionCheck",{ref:"permissionCheck",attrs:{apps:t.apps,config:t.privilegeConfig,"brand-name":t.brandName,"auth-mode":t.authMode}}),t._v(" "),e("AuthFooter",{attrs:{agreements:t.agreements,submitting:t.btnDisabled,"btn-disabled":t.btnDisabled},on:{submit:t.authSubmit}})]],2)};i._withStripped=!0,n(3082);var r=n(55517),o=n(40048),s=n(53930),a=n(19796),u=n(87879),c=n(97161),p=n(19669),l=n(58092),h=n(40217),f=n(93646),d=n(79736),v=n(2271),m=n(9084),_=n(86055),g=n(38425),b=n(67545);function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function A(t,e,n,i,r,o,s){try{var a=t[o](s),u=a.value}catch(c){n(c);return}a.done?e(u):Promise.resolve(u).then(i,r)}var C=function(t,e){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=(r=s.trys).length>0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(a){o=[6,a],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};function I(){var t;return t=function(t){var e,i,r,s,a,u,p,l,h;return C(this,function(f){switch(f.label){case 0:if(!b.m$.gte("3.1.23"))return[2];return r=(null==t?void 0:null===(e=t.checked)||void 0===e?void 0:null===(i=e.members)||void 0===i?void 0:i.map(function(t){return t.vid}))||[],[4,(0,o.ewj)({selectedVids:r})];case 1:var d;if(a=(s=f.sent()).err_msg,u=s.selectedUserList,p=s.selectedUsers,"wwapp.selectInviteAppMemAuth:ok"!==a)return[2,{isSubmit:!1}];return h=(l=c.uniqBy(((function(t){if(Array.isArray(t))return y(t)})(d=u||p)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(d)||function(t,e){if(t){if("string"==typeof t)return y(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return y(t,e)}}(d)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat([function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),i.forEach(function(e){var i,r;i=t,r=n[e],e in i?Object.defineProperty(i,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):i[e]=r})}return t}({},null==t?void 0:t.authMember)]),"vid")).filter(function(e){var n;return e.vid!==(null==t?void 0:null===(n=t.authMember)||void 0===n?void 0:n.vid)}),[2,{isSubmit:!0,scopeStr:l.map(function(t){return t.name}).join(n(11974).nI().t("、")),scope:{members:l,parties:[],tags:[]},count:l.length,reportCount:h.length,vptids:{vids:l.map(function(t){return t.vid}),pids:[],tids:[]},app_perm:{vid_item:l.map(function(t){return t.vid})}}]}})},(I=function(){var e=this,n=arguments;return new Promise(function(i,r){var o=t.apply(e,n);function s(t){A(o,i,r,s,a,"next",t)}function a(t){A(o,i,r,s,a,"throw",t)}s(void 0)})}).apply(this,arguments)}var S=n(15057),w=n(39171),P=n(23768),k=function(){var t=this,e=t._self._c;return e("CntSection",{staticClass:"appList_stage"},[e("div",{staticClass:"auth_app_list"},t._l(t.apps,function(n,i){return e("div",{key:i,staticClass:"auth_app"},[e("Logo",{attrs:{src:n.logo,alt:""}}),t._v(" "),e("p",[t._v(t._s(n.app_name))])],1)}),0)])};k._withStripped=!0;var O=n(94944),T=n(82483),M={name:"AppList",components:{CntSection:T.Z,Logo:O.Z},props:{apps:{type:Array,default:function(){return[]}}}},F=n(6080),x=(0,F.Z)(M,k,[],!1,null,"aa480b50",null).exports,q=n(72945),D=n(2777),$=n(89536),j=n(48394),E=n(17272),B=n(15682),Z=function(){var t=this,e=t._self._c;return t.contactSensitive?e("CntSection",[e("div",{staticClass:"auth_section_cnt"},[e("div",{staticClass:"auth_section_head"},[e("div",{staticClass:"auth_section_title"},[t._v(n(11974).nI().t("应用申请获取"))])]),t._v(" "),e("div",{staticClass:"memberAuth_privacyInfo_content"},[e("label",[e("input",{staticClass:"ww_checkbox",attrs:{checked:"checked",type:"checkbox"},domProps:{value:t.value},on:{input:function(e){return t.$emit("input",e.target.checked)}}}),t._v(" "),t.contactSensitiveLogo?e("img",{attrs:{src:t.contactSensitiveLogo}}):t._e(),t._v(" "),e("span",[t._v(t._s(t.contactSensitiveText))])])])])]):t._e()};Z._withStripped=!0;var G={name:"AuthPrivacy",components:{CntSection:T.Z},props:{contactSensitiveFlag:{type:Number},value:{type:Boolean},userInfo:{type:Object,default:function(){}}},computed:{contactSensitive:function(){var t;return(0,c.filter)([{logo:null===(t=this.userInfo)||void 0===t?void 0:t.avatar,name:n(11974).nI().t("企业微信头像"),checked:!!(2&this.contactSensitiveFlag)},{logo:"https://wwcdn.weixin.qq.com/node/wework/images/IconGender.1058483067.svg",name:n(11974).nI().t("性别"),checked:!!(8192&this.contactSensitiveFlag)},{logo:"https://wwcdn.weixin.qq.com/node/wework/images/IconQrcode.28da0bae59.svg",name:n(11974).nI().t("企业微信二维码"),checked:!!(16&this.contactSensitiveFlag)}],{checked:!0})},contactSensitiveText:function(){if(this.contactSensitive.length)return n(11974).nI().t("你的{0}",[(0,c.map)(this.contactSensitive,function(t){return t.name}).join("、")])},contactSensitiveLogo:function(){if(1===this.contactSensitive.length)return this.contactSensitive[0].logo}}},L=(0,F.Z)(G,Z,[],!1,null,"54c6c956",null).exports,R=n(51786),H=n(6497),V=n(61899),U=n(62330),N=n(73848);function K(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function Q(t,e,n,i,r,o,s){try{var a=t[o](s),u=a.value}catch(c){n(c);return}a.done?e(u):Promise.resolve(u).then(i,r)}function W(t){return function(){var e=this,n=arguments;return new Promise(function(i,r){var o=t.apply(e,n);function s(t){Q(o,i,r,s,a,"next",t)}function a(t){Q(o,i,r,s,a,"throw",t)}s(void 0)})}}function X(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Y(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),i.forEach(function(e){X(t,e,n[e])})}return t}function z(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n,i,r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var o=[],s=!0,a=!1;try{for(r=r.call(t);!(s=(n=r.next()).done)&&(o.push(n.value),!e||o.length!==e);s=!0);}catch(u){a=!0,i=u}finally{try{s||null==r.return||r.return()}finally{if(a)throw i}}return o}}(t,e)||function(t,e){if(t){if("string"==typeof t)return K(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return K(t,e)}}(t,e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var J=function(t,e){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=(r=s.trys).length>0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(a){o=[6,a],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},tt={name:"AppAdminAuth",components:{AuthLayout:f.Z,AppAuthHead:w.Z,AuthInfoTip:B.Z,AuthError:j.Z,AppBatchSelect:P.Z,AuthBatchFail:D.Z,AuthDesc:$.Z,AppRange:q.Z,AppList:x,AuthPrivacy:L,PermissionInfo:V.Z,PermissionCheck:H.Z,AuthFooter:E.Z,PriceInfo:U.Z,AppBeforeAuth:S.Z,AuthRangeText:R.Z},mixins:[d.aC,d.BG],asyncData:function(t){return W(function(){var e,n,i,r,o,s,a,u,c;return J(this,function(p){switch(p.label){case 0:return[4,Promise.all([t.$ctrl.auth.getAppAuthInfo({appid:t.query.appid,scene_val:t.query.scene_val}),t.$request(l.Gi)])];case 1:if(i=(n=z.apply(void 0,[p.sent(),2]))[0],o={scope:{members:[r=n[1].authMember],parties:[],tags:[]},app_perm:{vid_item:[r.vid]},scopeStr:r.name,count:1},a=(s=(null===(e=i.promotionCaseData)||void 0===e?void 0:e.promotion_case_info)||{}).app_item||[],u={settings:i,promotionCaseInfo:s,caseApps:a,query:t.query,range:o,authMember:r,userInfo:{avatar:r.avatar}},0!==s.case_type)return[3,3];return c=[{},u],[4,(0,d.Gy)(t,a)];case 2:u=Y.apply(void 0,c.concat([p.sent()])),p.label=3;case 3:return[2,u]}})})()},data:function(){return{stage:"",settings:null,error:{},btnDisabled:!1,infoText:{},query:null,checkSenstivelFlag:!0}},head:function(){return{title:this.isPromotionCase?n(11974).nI().t("使用方案"):n(11974).nI().t("添加应用"),bodyAttrs:{class:["appStore_body_WhiteDesktop2"]}}},computed:{InstallMode:function(){return h.gm},canInviteMember:function(){return!this.isFromPCGroupToolBar&&(this.$userAgent.wecomVersion.gte("3.1.23")||!this.isPersonalApp)},ctrl:function(){return this.$ctrl.auth},authProductType:function(){return this.isCommonCase?this.ctrl.AuthProductType.CommonCase:this.isPromotionCase?this.ctrl.AuthProductType.IndustryCase:this.ctrl.AuthProductType.App},appInfo:function(){var t;return(null===(t=this.settings)||void 0===t?void 0:t.appInfo)||{}},appId:function(){return this.query.thirdapp_id},caseId:function(){return this.query.open_case_id},isPromotionCase:function(){var t;return!!(null===(t=this.settings)||void 0===t?void 0:t.promotionCaseData)},isCommonCase:function(){var t;return(null===(t=this.promotionCaseInfo)||void 0===t?void 0:t.case_type)===0},promotionCaseData:function(){return this.settings.promotionCaseData||{}},config:function(){var t,e,n;return(null===(t=this.appInfo.app_config_list)||void 0===t?void 0:t.config)||(null===(e=this.promotionCaseData)||void 0===e?void 0:null===(n=e.app_config_list)||void 0===n?void 0:n.config)},serviceCorpApp:function(){return this.appInfo.servicecorp_app||{}},servicecorpInfo:function(){return this.promotionCaseData.servicecorp_info||this.appInfo.servicecorp_info},apps:function(){if(this.isCommonCase)return this.batchSelectApps;if(this.isPromotionCase){var t;return null===(t=this.promotionCaseInfo)||void 0===t?void 0:t.app_item}return[this.serviceCorpApp]},brandName:function(){var t;return null===(t=this.servicecorpInfo)||void 0===t?void 0:t.brand_name},isAdmin:function(){return!!this.settings.isAdmin},errText:function(){var t,e;return{title:(null===(t=this.error)||void 0===t?void 0:t.title)||n(11974).nI().t("应用添加失败"),content:(null===(e=this.error)||void 0===e?void 0:e.humanMessage)||n(11974).nI().t("系统繁忙，请稍后再试"),btn:n(11974).nI().t("返回")}},successBtnText:function(){return this.isAdmin?n(11974).nI().t("确定"):""},isInstall:function(){var t;return null===(t=this.serviceCorpApp)||void 0===t?void 0:t.is_installed},from:function(){return this.settings.from},isFromOauth2:function(){return"oauth2"===this.from},isFromInviteCard:function(){return"invite_card"===this.from},showOauthPrivacy:function(){return this.isFromOauth2&&"1"===this.query.needContactSesitiveFlag},isAuthTest:function(){return"eSuiteOpTableTest"===this.appInfo.oper_table},memberHref:function(){return"https://work.weixin.qq.com"},authMode:function(){return _.vB.AuthMode_User},operTable:function(){return this.appInfo.oper_table},isFromMiniProgram:function(){return+this.query.login_source===h.VD.OAUTH2_LOGIN_XCX},canManage:function(){if(!this.isAdmin)return!1;if(this.settings.is_superadmin)return!0;var t=this.settings.role||{},e=!!((null==t?void 0:t.auth_flags)&32),n=(0,c.some)(this.apps,function(e){var n;return(0,c.some)(null===(n=t.app_auth_list)||void 0===n?void 0:n.item,function(t){return e.corp_app_id===t.app_id&&2&t.flags})});return e||n},contactSensitiveFlag:function(){var t,e;return null===(t=this.appInfo)||void 0===t?void 0:null===(e=t.servicecorp_app)||void 0===e?void 0:e.contact_sensitive_flag_new},privilegeConfig:function(){var t,e=(null===(t=(0,c.find)(this.settings.systemConfig.config_option,{key:"memberauth_add_customer_check"}))||void 0===t?void 0:t.value)==="1";return(0,c.map)(this.config,function(t){return t.is_default_checked=e,t})||{}},showPermissionCheck:function(){var t;switch(null===(t=(0,c.find)(this.settings.systemConfig.config_option,{key:"memberauth_show_add_customer_v2"}))||void 0===t?void 0:t.value){case"2":return!0;case"1":return!this.corpHadInstall;default:return!1}},corpHadInstall:function(){return!!(0,c.filter)(this.apps,function(t){return t.corp_app_id&&"0"!==t.corp_app_id}).length},versions:function(){var t,e,n;return(0,v.ko)((null===(t=this.settings)||void 0===t?void 0:null===(e=t.priceInfo)||void 0===e?void 0:null===(n=e.list)||void 0===n?void 0:n.standardpriceinfo)||[],{canManage:this.canManage,isPayOpen:this.settings.isPayOpen})},displayVersions:function(){return this.settings.isPayAccountRegisted?this.versions:this.versions.filter(function(t){return t.priceinfo_type===s.y})},paidAppInfo:function(){var t,e;return(null===(t=this.settings)||void 0===t?void 0:null===(e=t.paidInfo)||void 0===e?void 0:e.paid_app_info)||{}},priceInfo:function(){return this.ctrl.getPriceInfo({versions:this.versions,paidInfo:this.paidAppInfo})},authDescConfig:function(){var t,e,i=this.corpHadInstall&&this.isAdmin,r=null===(t=this.promotionCaseInfo)||void 0===t?void 0:t.title,o=(X(e={},this.ctrl.AuthProductType.App,this.isPersonalApp?[n(11974).nI().t("添加后，应用将出现在你的工作台。")]:i?[n(11974).nI().t("你正在通过员工授权的方式添加应用，后续可在企业管理后台 - 应用管理中修改应用授权方式；"),n(11974).nI().t("添加后，应用将出现在可见范围员工的工作台。")]:[n(11974).nI().t("添加后，应用将出现在可见范围员工的工作台。")]),X(e,this.ctrl.AuthProductType.IndustryCase,i?[n(11974).nI().t("你正在通过员工授权的方式添加行业方案“{0}”，后续可在 企业管理后台-应用管理 中修改方案的授权方式",[r]),n(11974).nI().t("添加后，方案中的全部应用将出现在可见范围员工的工作台。")]:[n(11974).nI().t("添加后， 同时会将行业方案“{0}”所包含的全部应用添加到应用可见范围的工作台。",[r])]),X(e,this.ctrl.AuthProductType.CommonCase,[n(11974).nI().t("添加后，以下应用将出现在可见范围员工的工作台")]),X(e,h.Pl.PCGroupToolBar,[n(11974).nI().t("添加后，应用将出现在你的班级群工具栏和工作台。")]),e);return this.isFromPCGroupToolBar?o[h.Pl.PCGroupToolBar]:o[this.authProductType]},installApps:function(){var t=this;return this.apps.map(function(e){var n,i;return{thirdapp_id:e.thirdapp_id,invited_vid:null===(n=t.range)||void 0===n?void 0:null===(i=n.app_perm)||void 0===i?void 0:i.vid_item}})},appAuthStatus:function(){return this.settings.appAuthStatus||{}},beforeAuthInfo:function(){return(0,m.$V)(this,{recommendApp:Y({app_logo:this.serviceCorpApp.logo,app_name:this.serviceCorpApp.name,is_forbidden:this.appAuthStatus.isAppForbidden},this.serviceCorpApp),hasLogin:!0,canMemberAuth:this.appAuthStatus.isMemberAuthOpen,installMode:h.gm[this.appAuthStatus.currentAuthMode],isInAppScope:this.appAuthStatus.isInPerm,hasAddAppPrivilege:this.appAuthStatus.canCreateApp,isSuperAdmin:this.settings.is_superadmin,isPersonalApp:this.isPersonalApp})},installScene:function(){var t=this.$route.query.install_scene;return t&&Object.values(a).includes(+t)?+t:this.isAuthTest&&h.IS.Test||h.IS[this.from||"Market"]},agreements:function(){return this.isPromotionCase?(0,c.map)(this.apps,function(t){return t.agreement_entry_control}):[this.appInfo.agreement_entry_control]},isPersonalApp:function(){return this.servicecorpInfo.servicecorp_type===_.jq.SERVICECORP_TYPE_PERSONAL_DEVELOPER},isFromPCGroupToolBar:function(){return this.from===h.Pl.PCGroupToolBar},isShowSuccess:function(){return this.isFromMiniProgram||this.isFromPCGroupToolBar},authSucConfig:function(){var t={Miniprogram:{title:n(11974).nI().t("已授权"),desc:n(11974).nI().t("请重新打开小程序进行使用")},PCGroupToolBar:{title:n(11974).nI().t("已添加"),desc:n(11974).nI().t("可以在班级群工具栏和工作台中使用")},default:{title:n(11974).nI().t("已添加")}};return this.isFromMiniProgram?t.Miniprogram:t[this.from||"default"]}},created:function(){var t;(null===(t=this.appAuthStatus)||void 0===t?void 0:t.canAuth)===!1&&(this.stage="INFO")},mounted:function(){this.$reportStat({key:this.$clientEnv.statKey,item:"staff_addapp_page_show"})},methods:{errorConfirm:function(){this.stage="",this.error.canRetry&&(this.stage="")},authSubmit:function(){return W(function(){var t,e,i,o,s,a,c,p,l;return J(this,function(h){switch(h.label){case 0:return t=this,this.btnDisabled=!0,s={scene:this.installScene,option_val:(null===(e=this.$refs.permissionCheck)||void 0===e?void 0:e.getOpt())||[],scene_val:null===(i=this.$route.query)||void 0===i?void 0:i.scene_val},this.isCommonCase?s.install_app_item=this.installApps:this.isPromotionCase?(s.open_case_id=this.promotionCaseData.promotion_case_info.open_case_id,s.invited_vid=null===(a=this.range)||void 0===a?void 0:null===(c=a.app_perm)||void 0===c?void 0:c.vid_item):s.install_app_item=this.installApps,[4,this.ctrl.addMemberAuth(s,{silent:!0}).catch(function(t){var e;return null==t?void 0:null===(e=t.data)||void 0===e?void 0:e.result}).finally(function(){t.btnDisabled=!1})];case 1:if(p=h.sent(),(null==(l=this.isPromotionCase||this.isCommonCase?(0,g.tr)(this,{caseInfo:null===(o=this.promotionCaseData)||void 0===o?void 0:o.promotion_case_info,installRes:p,isMemberAuth:!0}):(0,g.IH)(this,{appInfo:this.serviceCorpApp,installRes:p,isMemberAuth:!0}))?void 0:l.type)==="modal")return(0,N.a)({title:l.title,message:l.body}),[2,!1];if((null==l?void 0:l.type)==="toast")return(0,u.Z)({message:l.message,position:"middle"}),[2,!1];if(this.isFromInviteCard)return location.href="https://open.work.weixin.qq.com/wwopen/notification/action/app/startAppMemberAuth?".concat(r.stringify({thirdapp_id:this.query.thirdapp_id,open_case_id:this.query.open_case_id}),"#wxwork_redirect"),[2];if(this.afterAuthSuccess(p),this.isShowSuccess)return this.stage="SUCCESS",[2];if(this.isFromOauth2)return[2,this.authSubmitForOauth2()];return this.isPromotionCase||this.isCommonCase?this.navCaseDetail():this.$router.replace({name:"/app",query:{appId:this.serviceCorpApp.thirdapp_id}}),(0,u.Z)({message:n(11974).nI().t("已添加"),position:"middle"}),[2]}})}).apply(this)},authSubmitForOauth2:function(){return W(function(){var t;return J(this,function(e){switch(e.label){case 0:return[4,this.$request(p.cQ,{selected_contact_sensitive_flag:this.checkSenstivelFlag?this.contactSensitiveFlag:0})];case 1:return t=e.sent(),location.href=t,[2]}})}).apply(this)},navCaseDetail:function(){return W(function(){return J(this,function(t){switch(t.label){case 0:return this.$router.replace({name:"/industryCase",params:{case_id:this.promotionCaseInfo.open_case_id},query:{case_id:this.promotionCaseInfo.open_case_id}}),[4,this.$nextTick()];case 1:return t.sent(),this.batchErrInfo=void 0,[2]}})}).apply(this)},selectContact:function(){return W(function(){var t;return J(this,function(e){switch(e.label){case 0:if(this.isPersonalApp)return[2];return this.$reportStat({key:this.$clientEnv.statKey,item:"staff_addapp_visible_range_click"}),[4,function(t){return I.apply(this,arguments)}({checked:this.range.scope,authMember:this.authMember})];case 1:return(null==(t=e.sent())?void 0:t.isSubmit)&&(this.range=t,this.$reportStat({key:this.$clientEnv.statKey,item:"staff_addapp_colleague_select_complete",value:this.range.reportCount})),[2]}})}).apply(this)},successConfirm:function(){if(!this.isAdmin){location.replace(this.memberHref);return}},infoConfirm:function(){if(this.isAdmin){location.replace("https://work.weixin.qq.com/wework_admin/frame#apps");return}return location.replace(this.memberHref),!1},batchSelectSubmit:function(t){this.batchSelectApps=t,this.$router.push({query:{open_case_id:this.promotionCaseInfo.open_case_id,selected:"1"}})},afterAuthSuccess:function(t){return W(function(){var e,n,i;return J(this,function(r){switch(r.label){case 0:if(!(this.isFromPCGroupToolBar&&this.$userAgent.isWindows&&this.$userAgent.wecomVersion.gte("4.1.12")))return[3,4];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,(0,o.OVP)("wwapp2.toolbarInstalled3rdApp",{corpAppId:null==t?void 0:null===(e=t.succ_app_list)||void 0===e?void 0:null===(n=e[0])||void 0===n?void 0:n.appid})];case 2:return console.log(i=r.sent()),/fail/.test(i)&&Promise.reject(i),[3,4];case 3:return r.sent(),[3,4];case 4:return[2]}})}).apply(this)}}},te=(0,F.Z)(tt,i,[],!1,null,null,null).exports}}]);