PageSourceSearch

https://app.dapta.ai/chunk-I2Q4WQXL.js

js dapta.ai collected 2026-09-29 00:05:26 UTC 51,995 bytes, 1 lines download raw bytes

1import{a as De,b as H,d as $}from"./chunk-RK33CO4L.js";import{a as K,b as G}from"./chunk-AP4RQKWS.js";import{a as Oe,b as Pe}from"./chunk-UXCZQ35S.js";import{a as Ie}from"./chunk-NU5RVLAA.js";import{c as be,d as Ne}from"./chunk-4ZVJIHHJ.js";import"./chunk-FQIDAGIB.js";import{a as Se,b as we}from"./chunk-CZWE744E.js";import{a as ye,b as Le}from"./chunk-QDRIPFVV.js";import{a as Me,b as Ae}from"./chunk-HH446EG3.js";import"./chunk-X4XHRKJK.js";import"./chunk-WWYUABQM.js";import"./chunk-DGOHN5MI.js";import"./chunk-P6TIZVOU.js";import"./chunk-DRMZ367D.js";import"./chunk-UVNRP7DL.js";import"./chunk-MPKK35XZ.js";import"./chunk-4HVR5UFO.js";import"./chunk-CLSAFS5Q.js";import"./chunk-CJXEOJFV.js";import"./chunk-DGJ3RKEZ.js";import"./chunk-4WAUMBH6.js";import"./chunk-DAYZHUJE.js";import"./chunk-KH7K5DGA.js";import"./chunk-VO63BEYI.js";import{a as Te}from"./chunk-5QZ3NKAH.js";import"./chunk-6KLVNBIT.js";import{E as ve,g as fe,l as xe}from"./chunk-3G75FYOC.js";import{d as Ce,f as ge,g as Ee}from"./chunk-MIJHCTDG.js";import{U as me,b as U,e as de,n as _e}from"./chunk-PZHDZNOO.js";import{a as he}from"./chunk-GGODJQRR.js";import"./chunk-4ZHAVEY3.js";import"./chunk-EVJHW347.js";import"./chunk-ERNNOIEA.js";import"./chunk-BFJOYHTI.js";import"./chunk-SRQR6N6L.js";import"./chunk-7QCXACDV.js";import{la as ue}from"./chunk-PQEV5SKX.js";import{C as Q,Db as b,Dc as O,Fb as f,Hb as _,La as o,Na as ie,Nd as ce,Rb as se,Ub as W,Wa as ne,Wb as p,Xb as m,Yb as A,aa as ee,ab as ae,ea as S,fd as pe,kb as C,la as T,lc as L,ma as M,mb as g,mc as R,n as J,nb as z,nc as re,ob as oe,oc as le,pb as B,qb as V,ra as te,rb as E,s as X,sb as r,t as Z,tb as l,ua as I,ub as y,vc as c,wc as d,xc as w}from"./chunk-NMIDHYRA.js";import{k as N}from"./chunk-ZOCHBAGS.js";var Ge="https://connect.facebook.net/en_US/sdk.js",Re=(()=>{let s=class s{constructor(){this.zone=S(ie),this.direct=S(G),this.prepared=!1}prepare(){return N(this,null,function*(){if(yield this.loadSdk(),!this.config?.config_id)throw new Error("META_DIRECT_CONFIG_MISSING");this.prepared=!0})}launch(){return N(this,null,function*(){if(!this.prepared||!this.config?.config_id)throw new Error("META_SDK_NOT_READY");let e=this.config.config_id;return new Promise((i,a)=>{let u,h,x=!1,v=setTimeout(()=>F("META_SIGNUP_TIMEOUT"),12e4),k=()=>{x=!0,clearTimeout(v),window.removeEventListener("message",q)},F=P=>{x||(k(),a(new Error(P)))},j=()=>{x||!u||!h||(k(),i({code:u,session:{waba_id:h.data.waba_id,phone_number_id:h.data.phone_number_id,completion_event:h.event}}))},q=P=>{if(!He(P.origin))return;let D=ze(P.data);D&&this.zone.run(()=>{if(D.event==="CANCEL"||D.event==="ERROR"){F(D.event==="CANCEL"?"META_SIGNUP_CANCELLED":"META_SIGNUP_FAILED");return}h={event:D.event,data:D.data},j()})};window.addEventListener("message",q);try{window.FB.login(P=>this.zone.run(()=>{if(u=P.authResponse?.code,!u){F("META_SIGNUP_CANCELLED");return}j()}),{config_id:e,response_type:"code",override_default_response_type:!0,auth_type:"rerequest",extras:{featureType:"whatsapp_business_app_onboarding",sessionInfoVersion:3}})}catch{F("META_SIGNUP_FAILED")}})})}loadSdk(){return this.sdkPromise?this.sdkPromise:(this.sdkPromise=X(J(this.direct.getPublicConfig()).pipe(Z(2e4))).then(({data:e})=>{if(!e.config_id)throw new Error("META_DIRECT_CONFIG_MISSING");return this.config=e,new Promise((i,a)=>{let u=setTimeout(()=>a(new Error("META_SDK_LOAD_TIMEOUT")),2e4),h=()=>{if(clearTimeout(u),!this.config?.app_id){a(new Error("META_DIRECT_APP_MISSING"));return}window.FB.init({appId:this.config.app_id,cookie:!0,xfbml:!1,version:this.config.graph_api_version}),i()};if(window.FB){h();return}window.fbAsyncInit=h;let x=document.createElement("script");x.src=Ge,x.async=!0,x.defer=!0,x.crossOrigin="anonymous",x.onerror=()=>{clearTimeout(u),a(new Error("META_SDK_LOAD_FAILED"))},document.head.appendChild(x)})}).catch(e=>{throw this.sdkPromise=void 0,e}),this.sdkPromise)}};s.\u0275fac=function(i){return new(i||s)},s.\u0275prov=ee({token:s,factory:s.\u0275fac,providedIn:"root"});let t=s;return t})();function ze(t){try{let s=typeof t=="string"?JSON.parse(t):t;if(s?.type!=="WA_EMBEDDED_SIGNUP"||!new Set(["FINISH","FINISH_ONLY_WABA","FINISH_WHATSAPP_BUSINESS_APP_ONBOARDING","CANCEL","ERROR"]).has(s.event))return null;if(s.event!=="CANCEL"&&s.event!=="ERROR"){let e=s.data;if(!e||typeof e!="object"||Array.isArray(e)||e.waba_id!==void 0&&typeof e.waba_id!="string"||e.phone_number_id!==void 0&&typeof e.phone_number_id!="string")return null}return s}catch{return null}}function He(t){if(!t)return!1;let s=new URL(t).hostname;return s==="facebook.com"||s.endsWith(".facebook.com")}var Ke=()=>({width:"min(520px, 100vw)"}),ke=()=>({width:"min(500px, 95vw)"}),$e=()=>({width:"min(520px, 95vw)"}),Ye=()=>["search_index"],je=t=>
1({label:"META_LINE.META_ID",value:t}),qe=t=>({label:"META_WHATSAPP.WABA",value:t}),Je=t=>({label:"META_LINE.CHANNEL_ID",value:t}),Xe=(t,s,n)=>[t,s,n],Ze=()=>[],Qe=t=>({count:t}),et=t=>({phone:t}),tt=(t,s)=>({phone:t,identity:s}),it=(t,s)=>s.label;function nt(t,s){if(t&1){let n=b();r(0,"p",8),p(1),c(2,"translate"),r(3,"dui-button",17),f("onClick",function(){T(n);let i=_();return M(i.prepareSignup())}),p(4),c(5,"translate"),l()()}t&2&&(o(),A(" ",d(2,2,"META_LINE.SIGNUP_PREPARATION_ERROR")," "),o(3),m(d(5,4,"META_LINE.RETRY")))}function at(t,s){if(t&1&&(r(0,"p",9),y(1,"i",18),p(2),c(3,"translate"),l()),t&2){let n=_();o(2),A(" ",d(3,1,n.signupStage())," ")}}function ot(t,s){if(t&1&&(r(0,"p",10),y(1,"i",19),p(2),c(3,"translate"),l()),t&2){let n=_();o(2),A(" ",d(3,1,n.actionError())," ")}}function st(t,s){t&1&&(r(0,"div",11)(1,"p"),p(2),c(3,"translate"),l()()),t&2&&(o(2),m(d(3,1,"META_LINE.SCOPE_MISSING")))}function rt(t,s){t&1&&(r(0,"div",12),y(1,"dapta-spinner",20),l())}function lt(t,s){if(t&1){let n=b();r(0,"div",13),y(1,"i",21),r(2,"p"),p(3),c(4,"translate"),l(),r(5,"dui-button",22),c(6,"translate"),f("onClick",function(){T(n);let i=_();return M(i.loadData())}),l()()}if(t&2){let n=_();o(3),m(d(4,3,"META_LINE.LOAD_ERROR")),o(2),E("label",d(6,5,"META_LINE.RELOAD"))("loading",n.loading())}}function pt(t,s){if(t&1){let n=b();r(0,"div",11)(1,"h2"),p(2),c(3,"translate"),l(),r(4,"p"),p(5),c(6,"translate"),l(),r(7,"dui-button",7),c(8,"translate"),f("onClick",function(){T(n);let i=_();return M(i.connectLine())}),l()()}if(t&2){let n=_();o(2),m(d(3,5,"META_WHATSAPP.EMPTY_TITLE")),o(3),m(d(6,7,"META_WHATSAPP.EMPTY_DESCRIPTION")),o(2),E("label",d(8,9,"META_WHATSAPP.CONNECT_LINE"))("loading",n.connecting()||n.signupPreparing())("disabled",!n.signupReady())}}function ct(t,s){if(t&1&&(r(0,"p",10),y(1,"i",19),p(2),c(3,"translate"),l()),t&2){let n=_(2);o(2),A(" ",d(3,1,n.error())," ")}}function dt(t,s){if(t&1&&(r(0,"div",35),p(1),l()),t&2){let n=_().$implicit;o(),m(n.row.business)}}function _t(t,s){if(t&1){let n=b();r(0,"div",31)(1,"span",32),p(2),l(),r(3,"span",33),f("click",function(i){return T(n),M(i.stopPropagation())}),r(4,"dui-button",34),c(5,"translate"),f("onClick",function(){let i=T(n).$implicit,a=_(2);return M(a.copy(i.row.line.display_phone_number))}),l()()(),C(6,dt,2,1,"div",35)}if(t&2){let n=s.$implicit,e=_(2);o(2),m(n.row.phone),o(2),E("icon",e.copied()===n.row.line.display_phone_number?"pi pi-check":"pi pi-copy")("ariaLabel",d(5,5,"META_LINE.COPY_NUMBER"))("disabled",!n.row.line.display_phone_number),o(2),g(n.row.business?6:-1)}}function mt(t,s){if(t&1){let n=b();r(0,"a",37),f("click",function(i){return T(n),M(i.stopPropagation())}),p(1),l()}if(t&2){let n=_().$implicit;E("routerLink",s),o(),A(" ",n.row.agent_label," ")}}function ut(t,s){if(t&1&&p(0),t&2){let n=_().$implicit;A(" ",n.row.agent_label," ")}}function ht(t,s){if(t&1&&C(0,mt,2,2,"a",36)(1,ut,1,1),t&2){let n,e=s.$implicit,i=_(2);g((n=i.agentLink(e.row.line))?0:1,n)}}function Ct(t,s){t&1&&(r(0,"div",35),p(1),c(2,"translate"),l()),t&2&&(o(),m(d(2,1,"META_LINE.PENDING_VERIFICATION")))}function gt(t,s){if(t&1&&(y(0,"p-tag",38),C(1,Ct,3,3,"div",35)),t&2){let n=s.$implicit,e=_(2);E("severity",e.stateSeverity(n.row.line))("value",n.row.state_label),o(),g(e.pendingVerification(n.row.line)?1:-1)}}function Et(t,s){if(t&1&&(r(0,"span",39),p(1),l()),t&2){let n=s.$implicit;E("title",n.row.line.messaging_limit||""),o(),m(n.row.messaging_limit)}}function ft(t,s){t&1&&(r(0,"div",35),p(1),c(2,"translate"),l()),t&2&&(o(),m(d(2,1,"META_LINE.CHECK_FAILED")))}function xt(t,s){if(t&1&&(r(0,"span",39),c(1,"date"),p(2),l(),C(3,ft,3,3,"div",35)),t&2){let n=s.$implicit,e=_(2);E("title",w(1,3,n.row.verified_at,"medium")||""),o(2),m(e.age(n.row.verified_at)),o(),g(n.row.line.last_check_error?3:-1)}}function vt(t,s){if(t&1){let n=b();r(0,"dui-button",45),f("onClick",function(){T(n);let i=_().$implicit,a=_(2);return M(a.connectLine(i.row.line))}),p(1),c(2,"translate"),l()}if(t&2){let n=_(3);E("disabled",n.connecting()||!n.signupReady()),o(),A(" ",d(2,2,"META_LINE.RECONNECT")," ")}}function Tt(t,s){if(t&1){let n=b();r(0,"dui-button",46),f("onClick",function(){T(n);let i=_().$implicit,a=_(2);return M(a.openAssignment(i.row.line))}),p(1),c(2,"translate"),l()}t&2&&(o(),A(" ",d(2,1,"META_LINE.ASSIGN")," "))}function Mt(t,s){if(t&1){let n=b();r(0,"dui-button",46),f("onClick",function(){T(n);let i=_().$implicit,a=_(2);return M(a.openDetail(i.row.line))}),p(1),c(2,"translate"),l()}t&2&&(o(),A(" ",d(2,1,"META_LINE.DETAILS")," "))}function At(t,s){if(t&1){let n=b();r(0,"div",40),f("click",function(i){return T(n),M(i.stopPropagation())}),C(1,vt,3,4,"dui-button",41)(2,Tt,3,3,"dui-button",42)(3,Mt,3,3,"dui-button",42),y(4,"p-menu",43,0),r(6,"dui-button",44),c(7,"translate"),f("onClick",function(i){T(n);let a=se(5);return M(a.toggle(i))}),l()()}if(t&2){let n=s.$implicit,e=_(2);o(),g(e.showReconnect(n.row.line)?1:n.row.state==="UNASSIGNED"||n.row.state==="AGENT_UNAVAILABLE"?2:3),o(3),E("model",e.rowActions(n.row.line))("popup",!0),o(2),E("ariaLabel",d(7,4,"META_LINE.MORE_ACTIONS"))}}function It(t,s){if(t&1){let n=b();C(0,ct,4,3,"p",10),r(1,"div",23)(2,"app-dapta-table-prime",24),c(3,"translate"),c(4,"translate"),f("rowClicked",function(i){T(n);let a=_();return M(a.openDetail(i.data.line))}),ae(5,_t,7,7,"ng-template",25)(6,ht,2,1,"ng-template",26)(7,gt,2,3,"ng-template",27)(8,Et,2,2,"ng-template",28)(9,xt,4,6,"ng-template",29)(10,At,8,6,"ng-template",3
10),l()()}if(t&2){let n=_();g(n.error()?0:-1),o(2),E("columns",n.columns())("data",n.rows())("rows",10)("totalRecords",n.rows().length)("lazy",!1)("paginator",n.rows().length>10)("captionSearchLabel",d(3,14,"META_LINE.SEARCH"))("currentPageReportTemplate",d(4,16,"showing-x-to-y-of-z-entries"))("globalFilterTransform",n.normalizeSearch)("globalFilterFields",L(18,Ye))("showClearFilters",!0)("preservePageOnDataChange",!0)("loading",n.loading()&&!n.rows().length)}}function bt(t,s){if(t&1&&(r(0,"p",10),y(1,"i",19),p(2),c(3,"translate"),l()),t&2){let n=_(2);o(2),A(" ",d(3,1,n.actionError())," ")}}function Nt(t,s){if(t&1&&(r(0,"div")(1,"dt"),p(2),c(3,"translate"),l(),r(4,"dd"),p(5),l()()),t&2){let n=_();o(2),m(d(3,2,"META_LINE.BUSINESS")),o(3),m(n.business_name||n.verified_name)}}function St(t,s){if(t&1&&(r(0,"a",50),p(1),l()),t&2){let n=_(),e=_();E("routerLink",s),o(),m(e.agentLabel(n))}}function wt(t,s){if(t&1&&p(0),t&2){let n=_(),e=_();A(" ",e.agentLabel(n)," ")}}function yt(t,s){t&1&&(p(0),c(1,"translate")),t&2&&A(" \xB7 ",d(1,1,"META_LINE.CHECK_FAILED")," ")}function Lt(t,s){if(t&1&&(r(0,"div")(1,"dt"),p(2),c(3,"translate"),l(),r(4,"dd"),p(5),c(6,"date"),C(7,yt,2,3),l()()),t&2){let n=_();o(2),m(d(3,3,"META_LINE.LAST_ATTEMPT")),o(3),A(" ",w(6,5,n.last_check_at,"medium")," "),o(2),g(n.last_check_error?7:-1)}}function Ot(t,s){t&1&&(r(0,"div")(1,"dt"),p(2),c(3,"translate"),l(),r(4,"dd"),p(5),c(6,"translate"),l()()),t&2&&(o(2),m(d(3,2,"META_LINE.BUSINESS_VERIFICATION")),o(3),m(d(6,4,"META_LINE.PENDING_VERIFICATION")))}function Pt(t,s){t&1&&(r(0,"small"),p(1),l()),t&2&&(o(),m(s))}function Dt(t,s){if(t&1&&(r(0,"li")(1,"span"),p(2),l(),C(3,Pt,2,1,"small"),l()),t&2){let n,e=s.$implicit,i=_(4);o(2),m(i.issueLabel(e)),o(),g((n=i.remediationFor(e))?3:-1,n)}}function Rt(t,s){if(t&1&&(r(0,"p",61),p(1),c(2,"translate"),l()),t&2){let n=_(3),e=_();o(),m(w(2,1,"META_LINE.WABA_SHARED",R(4,Qe,e.wabaPeerCount(n))))}}function kt(t,s){if(t&1&&(r(0,"section",51)(1,"h3"),p(2),c(3,"translate"),l(),r(4,"ul",60),B(5,Dt,4,2,"li",null,oe),l(),C(7,Rt,3,6,"p",61),l()),t&2){let n=_(),e=_(),i=_();o(2),m(d(3,2,"META_LINE.ISSUES")),o(3),V(n),o(2),g(i.wabaPeerCount(e)>1?7:-1)}}function Bt(t,s){t&1&&C(0,kt,8,4,"section",51),t&2&&g(s.length?0:-1)}function Vt(t,s){if(t&1&&(r(0,"li")(1,"span",62),p(2),c(3,"date"),l(),r(4,"span"),p(5),l(),r(6,"small"),p(7),l()()),t&2){let n=s.$implicit,e=_(3);o(2),m(w(3,3,n.occurred_at,"MMM d, y HH:mm")),o(3),m(e.historyLabel(n.action)),o(2),m(n.actor||n.source)}}function Wt(t,s){if(t&1&&(r(0,"ul",52),B(1,Vt,8,6,"li",null,z),l()),t&2){let n=_();o(),V(n.history)}}function Ft(t,s){if(t&1){let n=b();r(0,"div")(1,"dt"),p(2),c(3,"translate"),l(),r(4,"dd",63)(5,"span"),p(6),l(),r(7,"dui-button",34),c(8,"translate"),c(9,"translate"),f("onClick",function(){let i=T(n).$implicit,a=_(2);return M(a.copy(i.value))}),l()()()}if(t&2){let n=s.$implicit,e=_(2);o(2),m(d(3,5,n.label)),o(4),m(n.value),o(),E("icon",e.copied()===n.value?"pi pi-check":"pi pi-copy")("ariaLabel",d(8,7,"META_LINE.COPY")+" "+d(9,9,n.label))("disabled",!n.value)}}function Ut(t,s){if(t&1&&(r(0,"div")(1,"dt"),p(2),l(),r(3,"dd"),p(4),l()()),t&2){let n=s.$implicit;o(2),m(n.code),o(2),m(n.capability||n.severity)}}function Gt(t,s){if(t&1){let n=b();r(0,"dui-button",56),f("onClick",function(){T(n);let i=_(),a=_();return M(a.connectLine(i))}),p(1),c(2,"translate"),l()}if(t&2){let n=_(2);E("loading",n.connecting())("disabled",!n.signupReady()),o(),A(" ",d(2,3,"META_LINE.RECONNECT")," ")}}function zt(t,s){t&1&&(r(0,"p",61),p(1),c(2,"translate"),l()),t&2&&(o(),m(d(2,1,"META_LINE.VERIFY_BEFORE_RESUME")))}function Ht(t,s){if(t&1){let n=b();r(0,"dui-button",57),f("onClick",function(){T(n);let i=_(),a=_();return M(a.activate(i,a.needsActivation(i)))}),p(1),c(2,"translate"),l(),C(3,zt,3,3,"p",61)}if(t&2){let n=_(),e=_();E("disabled",e.connecting()||!!e.busy()||e.needsActivation(n)&&!e.canResume(n)),o(),A(" ",d(2,3,n.operator_paused?"META_LINE.RESUME":e.needsActivation(n)?"META_LINE.ACTIVATE":"META_LINE.PAUSE")," "),o(2),g(e.needsActivation(n)&&!e.canResume(n)?3:-1)}}function Kt(t,s){if(t&1){let n=b();r(0,"div",15)(1,"div",47),y(2,"p-tag",38),r(3,"p",48),p(4),l()(),C(5,bt,4,3,"p",10),r(6,"dl",49),C(7,Nt,6,4,"div"),r(8,"div")(9,"dt"),p(10),c(11,"translate"),l(),r(12,"dd"),C(13,St,2,2,"a",50)(14,wt,1,1),l()(),r(15,"div")(16,"dt"),p(17),c(18,"translate"),l(),r(19,"dd"),p(20),c(21,"date"),c(22,"translate"),l()(),C(23,Lt,8,8,"div"),r(24,"div")(25,"dt"),p(26),c(27,"translate"),l(),r(28,"dd"),p(29),c(30,"translate"),l()(),r(31,"div")(32,"dt"),p(33),c(34,"translate"),l(),r(35,"dd"),p(36),c(37,"translate"),l()(),C(38,Ot,7,6,"div"),r(39,"div")(40,"dt"),p(41),c(42,"translate"),l(),r(43,"dd"),p(44),l()()(),C(45,Bt,1,1),r(46,"section",51)(47,"h3"),p(48),c(49,"translate"),l(),r(50,"dl",49)(51,"div")(52,"dt"),p(53),c(54,"translate"),l(),r(55,"dd"),p(56),c(57,"date"),c(58,"translate"),l()(),r(59,"div")(60,"dt"),p(61),c(62,"translate"),l(),r(63,"dd"),p(64),c(65,"date"),c(66,"translate"),l()()(),C(67,Wt,3,0,"ul",52),l(),r(68,"details",53)(69,"summary"),p(70),c(71,"translate"),l(),r(72,"p"),p(73),c(74,"translate"),l(),r(75,"p"),p(76),c(77,"translate"),l(),r(78,"a",54),p(79),c(80,"translate"),l()(),r(81,"details",53)(82,"summary"),p(83),c(84,"translate"),l(),r(85,"dl",49),B(86,Ft,10,11,"div",null,it),r(88,"div")(89,"dt"),p(90),c(91,"translate"),l(),r(92,"dd"),p(93),c(94,"translate"),l()(),r(95,"div")(96,"dt"),p(97),c(98,"translate"),l(),r(99,"dd"),p(100),c(101,"date"),l()(),B(102,Ut,5,2,"div",null,z),l()(),r(104,"div",55)(105,"dui-button",56),f("onClick",function(){let i=T(n),a=_();return M(a.check(i))}),p(106),c(107,"translate"),l(),r(108,"dui-button",57),f("onClick",function(){let i=T(n),a=_();return M(a.openAssignment(i))}),p(109),c(110,"translate"),l(),C(111,Gt,3,5,"dui-button",58),C(112,Ht,4,5),r(113,"dui-button",59),f("onClick",function(){let i=T(n),a=_();return M(a.beginDelete(i))}),p(114),c(115,"translate"),l()()()}if(t&2){let n,e,i=s,a=_();o(2),E("severity",a.stateSeverity(i))("value",a.stateLabel(i)),o(2),m(a.stateHint(i)),o(),g(a.actionError()?5:-1),o(2),g(i.business_name||i.verified_name?7:-1),o(3),m(d(11,42,"META_LINE.AGENT")),o(3),g((n=a.agentLink(i))?13:14,n),o(4),m(d(18,44,"META_LINE.VERIFIED")),o(3),m(w(21,46,i.last_verified_at,"medium")||d(22,49,"META_LINE.NEVER_VERIFIED")),o(3),g(i.last_check_at?23:-1),o(3),m(d(27,51,"META_LINE.EFFECT_REPLIES")),o(3),m(d(30,53,"META_LINE.EFFECT_"+a.effect(i,"reply"))),o(4),m(d(34,55,"META_LINE.EFFECT_OUTBOUND")),o(3),m(d(37,57,"META_LINE.EFFECT_"+a.effect(i,"start"))),o(2),g(a.pendingVerification(i)?38:-1),o(3),m(d(42,59,"META_LINE.MESSAGING_TIER")),o(3),m(a.messagingTier(i)),o(),g((e=a.issueC
1odes(i))?45:-1,e),o(3),m(d(49,61,"META_LINE.ACTIVITY")),o(5),m(d(54,63,"META_LINE.LAST_INBOUND")),o(3),m(w(57,65,i.last_inbound_at,"medium")||d(58,68,"META_LINE.NOT_OBSERVED")),o(5),m(d(62,70,"META_LINE.LAST_DELIVERED")),o(3),m(w(65,72,i.last_delivered_reply_at,"medium")||d(66,75,"META_LINE.NOT_OBSERVED")),o(3),g(i.history!=null&&i.history.length?67:-1),o(3),m(d(71,77,"META_LINE.VERIFY_HOW")),o(3),m(d(74,79,"META_LINE.GUIDED_TEST")),o(3),m(d(77,81,"META_LINE.BILLING_EVIDENCE")),o(3),A(" ",d(80,83,"META_LINE.META_MANAGEMENT")," "),o(4),m(d(84,85,"META_LINE.TECHNICAL")),o(3),V(le(108,Xe,R(102,je,i.meta_phone_number_id),R(104,qe,i.waba_id),R(106,Je,i.agent_channel_id))),o(4),m(d(91,87,"META_WHATSAPP.ONBOARDING_MODE")),o(3),m(d(94,89,i.onboarding_mode==="business_app_coexistence"?"META_WHATSAPP.MODE_COEXISTENCE":"META_WHATSAPP.MODE_CLOUD_API")),o(4),m(d(98,91,"META_WHATSAPP.CONNECTED_AT")),o(3),m(w(101,93,i.connected_at,"medium")),o(2),V(i.issues||L(112,Ze)),o(3),E("loading",a.busy()==="check")("disabled",a.connecting()||!!a.busy()),o(),A(" ",d(107,96,"META_LINE.CHECK_META")," "),o(2),E("disabled",a.connecting()||!!a.busy()),o(),A(" ",d(110,98,"META_LINE.ASSIGN")," "),o(2),g(a.showReconnect(i)?111:-1),o(),g(a.isDisconnected(i)?-1:112),o(),E("disabled",a.connecting()||!!a.busy()),o(),A(" ",d(115,100,"META_LINE.DELETE")," ")}}function $t(t,s){if(t&1&&(r(0,"p",64),p(1),c(2,"translate"),l()),t&2){let n=_(2);o(),m(d(2,1,n.actionError()))}}function Yt(t,s){if(t&1){let n=b();r(0,"p"),p(1),c(2,"translate"),l(),r(3,"p"),p(4),c(5,"translate"),l(),C(6,$t,3,3,"p",64),r(7,"div",55)(8,"dui-button",57),f("onClick",function(){T(n);let i=_();return M(i.closeDelete())}),p(9),c(10,"translate"),l(),r(11,"dui-button",65),f("onClick",function(){T(n);let i=_();return M(i.deleteLine())}),p(12),c(13,"translate"),l()()}if(t&2){let n=_();o(),m(w(2,8,"META_LINE.DELETE_CONFIRM",R(17,et,n.phone(s)))),o(3),m(d(5,11,"META_LINE.DELETE_EFFECT")),o(2),g(n.actionError()?6:-1),o(2),E("disabled",n.connecting()||!!n.busy()),o(),A(" ",d(10,13,"cancel")," "),o(2),E("loading",n.busy()==="delete")("disabled",n.connecting()||!!n.busy()),o(),A(" ",d(13,15,"META_LINE.DELETE")," ")}}function jt(t,s){if(t&1){let n=b();r(0,"p",64),p(1),c(2,"translate"),l(),r(3,"dui-button",69),f("onClick",function(){T(n);let i=_(2);return M(i.loadAgents())}),p(4),c(5,"translate"),l()}t&2&&(o(),m(d(2,2,"META_LINE.AGENTS_ERROR")),o(3),m(d(5,4,"META_LINE.RETRY")))}function qt(t,s){if(t&1){let n=b();r(0,"dui-select",70),c(1,"translate"),c(2,"translate"),f("onChange",function(i){T(n);let a=_(2);return M(a.draftAgent.set(i.value))}),l()}if(t&2){let n=_(2);E("options",n.agents())("loading",n.agentsLoading())("disabled",n.agentsLoading()||!!n.busy())("filter",!0)("ngModel",n.draftAgent())("label",d(1,7,"META_LINE.AGENT"))("emptyMessage",d(2,9,"META_LINE.NO_ELIGIBLE_AGENTS"))}}function Jt(t,s){t&1&&(r(0,"p"),p(1),c(2,"translate"),l()),t&2&&(o(),m(d(2,1,"META_LINE.CLEAR_EFFECT")))}function Xt(t,s){if(t&1&&(r(0,"p",64),p(1),c(2,"translate"),l()),t&2){let n=_(2);o(),m(d(2,1,n.actionError()))}}function Zt(t,s){if(t&1){let n=b();r(0,"p"),p(1),l(),r(2,"p"),p(3),c(4,"translate"),l(),C(5,jt,6,6)(6,qt,3,11,"dui-select",66),r(7,"dui-button",67),f("onClick",function(){T(n);let i=_();return M(i.draftAgent.set(null))}),p(8),c(9,"translate"),l(),C(10,Jt,3,3,"p"),C(11,Xt,3,3,"p",64),r(12,"div",55)(13,"dui-button",57),f("onClick",function(){T(n);let i=_();return M(i.closeAssignment())}),p(14),c(15,"translate"),l(),r(16,"dui-button",68),f("onClick",function(){T(n);let i=_();return M(i.saveAssignment())}),p(17),c(18,"translate"),l()()}if(t&2){let n=s,e=_();o(),m(e.phone(n)),o(2),m(d(4,12,"META_LINE.ASSIGN_EFFECT")),o(2),g(e.agentsError()?5:6),o(2),E("disabled",e.connecting()||!!e.busy()),o(),A(" ",d(9,14,"META_LINE.CLEAR_ASSIGNMENT")," "),o(2),g(e.draftAgent()?-1:10),o(),g(e.actionError()?11:-1),o(2),E("disabled",e.connecting()||!!e.busy()),o(),A(" ",d(15,16,"cancel")," "),o(2),E("loading",e.busy()==="assignment")("disabled",e.connecting()||!!e.busy()||e.agentsLoading()||e.agentsError()||e.draftAgent()===n.agent_id),o(),A(" ",d(18,18,"META_WHATSAPP.SAVE_ASSIGNMENT")," ")}}function Qt(t,s){if(t&1&&(r(0,"p",64),p(1),c(2,"translate"),l()),t&2){let n=_(2);o(),m(d(2,1,n.actionError()))}}function ei(t,s){if(t&1){let n=b();r(0,"p"),p(1),c(2,"translate"),l(),r(3,"p"),p(4),c(5,"translate"),l(),C(6,Qt,3,3,"p",64),r(7,"div",55)(8,"dui-button",57),f("onClick",function(){T(n);let i=_();return M(i.cancelRestoreArchived())}),p(9),c(10,"translate"),l(),r(11,"dui-button",68),f("onClick",function(){T(n);let i=_();return M(i.confirmRestoreArchived())}),p(12),c(13,"translate"),l()()}if(t&2){let n=s,e=_();o(),m(w(2,8,"META_LINE.RESTORE_CONFIRM",re(17,tt,n.phone,n.identity))),o(3),m(d(5,11,"META_LINE.RESTORE_EFFECT")),o(2),g(e.actionError()?6:-1),o(2),E("disabled",e.connecting()),o(),A(" ",d(10,13,"cancel")," "),o(2),E("loading",e.connecting())("disabled",e.connecting()),o(),A(" ",d(13,15,"META_LINE.RESTORE_ACTION")," ")}}var ti=20,Be="__no_issue__",ii="metaLineIssues";function ni(t){return t.map(s=>({label:s.name,value:s.id}))}function Ve(t){let s=t.trim(),n=s.replace(/\D/g,"");return n&&/^[+\d\s().-]+$/.test(s)?n:s.toLocaleLowerCase()}function We(t){let s=t.display_phone_number??"";return[t.business_name,t.verified_name,t.waba_name,t.agent_name,s,s.replace(/\D/g,"")].filter(
1Boolean).join(" ").toLocaleLowerCase()}function $i(t,s){let n=Ve(s);return!n||We(t).includes(n)}function ai(t,s){if(!Array.isArray(s)||!s.length)return!0;let n=Array.isArray(t)?t:[];return s.some(e=>e===Be?!n.length:n.includes(e))}function Fe(t,s){return!t.last_check_error&&!!t.last_verified_at&&Number.isFinite(Date.parse(t.last_verified_at))&&s-Date.parse(t.last_verified_at)<=K}function oi(t,s=Date.now()){return $(t.authorization_status)?"ACCESS":t.provider_status?.toUpperCase()==="DISCONNECTED"||t.connection_status==="disconnected"?"DISCONNECTED":t.operator_paused?"PAUSED":t.connection_status==="pending"?"PENDING":t.connection_status==="action_required"?"ACCESS":t.channel_status&&t.channel_status!=="active"?"INACTIVE":t.agent_id?t.agent_status&&t.agent_status!=="active"?"AGENT_UNAVAILABLE":Fe(t,s)?t.issues?.some(n=>n.code!=="141010")?"LIMITED":t.connection_status==="connected"?"CONNECTED":"UNKNOWN":"UNKNOWN":"UNASSIGNED"}function si(t){let s=t.toUpperCase();return s.includes("PAYMENT")?"META_LINE.REMEDIATION_PAYMENT":$(t)||s.includes("ACCESS")?"META_LINE.REMEDIATION_RECONNECT":null}function ri(t){return t.scopeMissing?"scope-missing":t.lineCount?"list":t.loading||!t.settled?"loading":t.failed?"load-failed":"empty"}function Y(t){let s=new Map;for(let n of t){let e=s.get(n.value);e?e.count++:s.set(n.value,{label:n.label,count:1})}return[...s].map(([n,{label:e,count:i}])=>({value:n,label:`${e} (${i})`}))}var Yi=(()=>{let s=class s{constructor(){this.iam=S(me),this.direct=S(G),this.embeddedSignup=S(Re),this.i18n=S(Ce),this.filterService=S(ue),this.store=S(de),this.destroyRef=S(te),this.lines=I([]),this.loading=I(!1),this.settled=I(!1),this.error=I(""),this.scopeMissing=I(!1),this.observationTime=I(Date.now()),this.language=I(this.i18n.currentLang),this.selected=I(null),this.deleting=I(null),this.assigning=I(null),this.draftAgent=I(null),this.agents=I([]),this.agentsLoading=I(!1),this.agentsError=I(!1),this.busy=I(""),this.actionError=I(""),this.copied=I(""),this.connecting=I(!1),this.signupStage=I(""),this.restorePrompt=I(null),this.view=O(()=>ri({scopeMissing:this.scopeMissing(),lineCount:this.lines().length,loading:this.loading(),settled:this.settled(),failed:!!this.error()})),this.cachedRows=[],this.cachedSignature=null,this.rows=O(()=>{this.language();let e=this.lines().map(a=>this.toRow(a)),i=JSON.stringify([this.language(),e]);return i===this.cachedSignature?this.cachedRows:(this.cachedSignature=i,this.cachedRows=e,e)}),this.stateFilterOptions=O(()=>Y(this.rows().map(e=>({value:e.state,label:e.state_label})))),this.assignmentFilterOptions=O(()=>Y(this.rows().map(e=>({value:e.agent_key,label:e.agent_label})))),this.issueFilterOptions=O(()=>{let e=this.rows(),i=e.flatMap(u=>u.issue_codes.map((h,x)=>({value:h,label:u.issue_labels[x]}))),a=e.filter(u=>!u.issue_codes.length).length;return[...Y(i),...a?[{value:Be,label:`${this.i18n.instant("META_LINE.NO_ISSUES")} (${a})`}]:[]]}),this.columns=O(()=>(this.language(),[{field:"phone",header:this.i18n.instant("META_LINE.LINE"),type:"text",sortable:!0,columnTemplateName:"phone",minWidth:"180px"},{field:"agent_key",header:this.i18n.instant("META_LINE.AGENT"),type:"multiselect",filter:!0,filterShowMatchModes:!1,filterMatchMode:"in",filterOptions:this.assignmentFilterOptions(),filterOptionsSearchable:!0,columnTemplateName:"agent",minWidth:"120px"},{field:"state",header:this.i18n.instant("META_LINE.STATUS_COLUMN"),type:"multiselect",filter:!0,filterShowMatchModes:!1,filterMatchMode:"in",filterOptions:this.stateFilterOptions(),columnTemplateName:"state",minWidth:"140px"},{field:"messaging_limit",header:this.i18n.instant("META_LINE.MESSAGING_TIER"),type:"text",columnTemplateName:"messaging_limit",minWidth:"120px"},{field:"verified_at",header:this.i18n.instant("META_LINE.VERIFIED"),type:"text",sortable:!0,columnTemplateName:"verified",minWidth:"100px"},{field:"actions",header:this.i18n.instant("META_LINE.ACTION"),type:"text",align:"right",columnTemplateName:"actions",minWidth:"100px"}])),this.normalizeSearch=e=>Ve(e),this.scopeKey="",this.rowMenus=new Map,this.generation=0,this.listVersion=0,this.detailVersion=0,this.removedLineIds=new Set,this.focusOrigins=new Map,this.copiedTimer=null,this.signupReady=I(!1),this.signupPreparing=I(!1),this.signupPreparationError=I(!1)}prepareSignup(){return N(this,null,function*(){if(!this.signupPreparing()){this.signupPreparing.set(!0),this.signupPreparationError.
1set(!1);try{yield this.embeddedSignup.prepare(),this.signupReady.set(!0)}catch{this.signupReady.set(!1),this.signupPreparationError.set(!0)}finally{this.signupPreparing.set(!1)}}})}ngOnInit(){this.prepareSignup(),this.filterService.register(ii,ai),Q(6e4).pipe(U(this.destroyRef)).subscribe(()=>this.observationTime.set(Date.now())),this.i18n.onLangChange.pipe(U(this.destroyRef)).subscribe(e=>this.language.set(e.lang)),this.store.select(_e.getAuth).pipe(U(this.destroyRef)).subscribe(()=>{let e=this.scope(),i=H(this.iam);i===this.scopeKey&&this.generation||(this.scopeKey=i,this.generation++,this.resetInteractiveState(),this.scopeMissing.set(!e),this.removedLineIds.clear(),this.loadData())}),this.destroyRef.onDestroy(()=>{this.generation++,this.copiedTimer&&clearTimeout(this.copiedTimer)})}toRow(e){let i=this.issueCodes(e);return{id:e.id,line:e,phone:this.phone(e),business:e.business_name||e.verified_name||"",agent_key:e.agent_id??"",agent_label:this.agentLabel(e),state:this.state(e),state_label:this.stateLabel(e),messaging_limit:this.messagingTier(e),issue_codes:i,issue_labels:i.map(a=>this.issueLabel(a)),verified_at:e.last_verified_at??null,search_index:We(e)}}pendingVerification(e){return!!e.issues?.some(i=>i.code==="141010")}messagingTier(e){let i=e.messaging_limit;return i?i==="UNLIMITED"||i==="TIER_UNLIMITED"?this.i18n.instant("META_LINE.TIER_UNLIMITED"):i.replace(/^TIER_/,""):this.i18n.instant("META_LINE.TIER_UNKNOWN")}phone(e){return e.display_phone_number||this.i18n.instant("META_LINE.PHONE_UNAVAILABLE")}agentLabel(e){return e.agent_name||this.i18n.instant(e.agent_id?"META_LINE.AGENT_UNAVAILABLE":"META_LINE.NO_AGENT")}agentLink(e){return e.agent_id&&e.agent_name?`/agents-studio/text-agents/${e.agent_id}`:null}state(e){return oi(e,this.observationTime())}rowActions(e){let i=this.i18n.instant("META_LINE.DELETE"),a=!!this.busy()||this.connecting(),u=this.rowMenus.get(e.id);if(u?.line===e&&u.label===i&&u.disabled===a)return u.items;let h=[{label:i,icon:"pi pi-trash",disabled:a,command:()=>this.beginDelete(e)}];return this.rowMenus.set(e.id,{line:e,label:i,disabled:a,items:h}),h}stateLabel(e){return this.i18n.instant("META_LINE."+this.state(e))}stateHint(e){return this.i18n.instant("META_LINE.HINT_"+this.state(e))}stateSeverity(e){let i=this.state(e);return i==="CONNECTED"?"success":i==="ACCESS"||i==="DISCONNECTED"?"danger":i==="PAUSED"||i==="UNKNOWN"?"secondary":"warn"}historyLabel(e){let i={deleted:"DELETED",restored:"RESTORED",operator_resumed:"RESUMED",operator_paused:"PAUSED",agent_assigned:"ASSIGNED",authorization_revoked:"ACCESS_REVOKED",provider_check:"CHECKED",provider_checked:"CHECKED"};return this.i18n.instant(`META_LINE.HISTORY_${i[e]??"UPDATED"}`)}issueLabel(e){let i="META_LINE.ISSUE_"+e.toUpperCase(),a=this.i18n.instant(i);return a===i?this.i18n.instant("META_LINE.LIMITATION"):a}issueCodes(e){let i=new Set([this.stateLabel(e)]),a=[],u=[...e.issues??[]];Fe(e,this.observationTime())||u.push({code:e.last_check_error?"check_failed":"observation_stale",severity:"warning"});for(let h of u){if(h.code==="141010")continue;let x=this.issueLabel(h.code);i.has(x)||(i.add(x),a.push(h.code))}return a}remediationFor(e){let i=si(e);return i?this.i18n.instant(i):null}hasPaymentIssue(e){return(e.issues??[]).some(i=>i.code.toUpperCase().includes("PAYMENT"))}effect(e,i){let a=this.state(e);if(a==="UNKNOWN")return"UNKNOWN";if(["PAUSED","ACCESS","DISCONNECTED","PENDING","INACTIVE","UNASSIGNED","AGENT_UNAVAILABLE"].includes(a))return"STOPPED";let u=e.capabilities;return u?(i==="reply"?u.can_reply:u.can_start_conversation)?"ACTIVE":"STOPPED":a==="CONNECTED"||a==="LIMITED"?"UNKNOWN":"STOPPED"}wabaPeerCount(e){return this.lines().filter(i=>i.waba_id===e.waba_id).length}isDisconnected(e){return this.state(e)==="DISCONNECTED"}needsActivation(e){return!!e.operator_paused||e.channel_status==="inactive"}canResume(e){return e.authorization_status==="connected"&&e.provider_status==="CONNECTED"&&e.connection_status==="connected"&&!e.last_check_error&&!!e.last_verified_at&&Number.isFinite(Date.parse(e.last_verified_at))&&this.observationTime()-Date.parse(e.last_verified_at)<=K}showReconnect(e){let i=this.state(e);return i==="ACCESS"||i==="DISCONNECTED"||i==="PENDING"}age(e){if(!e||!Number.isFinite(Date.parse(e)))return this.i18n.instant("META_L
1INE.NEVER_VERIFIED");let i=Math.max(0,Math.floor((this.observationTime()-Date.parse(e))/6e4));return this.i18n.instant(i<60?"META_LINE.MINUTES_AGO":"META_LINE.HOURS_AGO",{count:i<60?i:Math.floor(i/60)})}copy(e){return N(this,null,function*(){if(e)try{navigator.clipboard&&window.isSecureContext?yield navigator.clipboard.writeText(e):this.copyBySelection(e),this.copied.set(e),this.copiedTimer&&clearTimeout(this.copiedTimer),this.copiedTimer=setTimeout(()=>this.copied.set(""),1500)}catch{this.actionError.set("META_LINE.COPY_ERROR")}})}copyBySelection(e){let i=document.activeElement,a=document.createElement("textarea");a.value=e,a.setAttribute("readonly",""),a.style.position="fixed",a.style.opacity="0",a.style.left="-9999px",document.body.appendChild(a);try{if(a.select(),!document.execCommand("copy"))throw new Error("META_LINE.COPY_ERROR")}finally{a.remove(),i?.focus?.()}}captureFocus(e){let i=document.activeElement;i instanceof HTMLElement&&i!==document.body&&this.focusOrigins.set(e,i)}returnFocus(e){let i=this.focusOrigins.get(e);this.focusOrigins.delete(e),i?.isConnected&&setTimeout(()=>i.focus())}closeDetail(){this.selected.set(null),this.returnFocus("detail")}loadData(){return N(this,null,function*(){let e=this.scope();if(!e||this.busy())return;let i=this.generation,a=++this.listVersion;this.loading.set(!0);try{let u=yield this.direct.listLines(e.workspaceId,e.accountId);if(!this.current(i)||a!==this.listVersion)return;let h=new Set(u.data.map(v=>v.id));for(let v of this.removedLineIds)h.has(v)||this.removedLineIds.delete(v);this.lines.set(u.data.filter(v=>!this.removedLineIds.has(v.id))),this.error.set("");let x=this.selected();x&&this.selected.set(this.lines().find(v=>v.id===x.id)??null)}catch{this.current(i)&&a===this.listVersion&&this.error.set("META_LINE.LOAD_ERROR")}finally{this.current(i)&&a===this.listVersion&&(this.settled.set(!0),this.loading.set(!1))}})}openDetail(e){return N(this,null,function*(){let i=this.scope();if(!i)return;let a=this.generation,u=++this.detailVersion;this.captureFocus("detail"),this.selected.set(e),this.actionError.set("");try{let h=yield this.direct.getLine(i.workspaceId,i.accountId,e.id);this.current(a)&&u===this.detailVersion&&this.selected()?.id===e.id&&this.selected.set(h.data)}catch{this.current(a)&&u===this.detailVersion&&this.actionError.set("META_LINE.DETAIL_ERROR")}})}check(e){return N(this,null,function*(){yield this.mutate(e,()=>this.direct.checkLine(this.scope().workspaceId,this.scope().accountId,e.id),"check")})}activate(e,i){return N(this,null,function*(){i&&!this.canResume(e)||(yield this.mutate(e,()=>this.direct.activateLine(this.scope().workspaceId,this.scope().accountId,e.id,i),"activation"))})}beginDelete(e){!this.busy()&&!this.connecting()&&(this.captureFocus("dialog"),this.actionError.set(""),this.deleting.set(e))}closeDelete(){this.deleting.set(null),this.returnFocus("dialog")}deleteLine(){return N(this,null,function*(){let e=this.deleting(),i=this.scope();if(!e||!i||this.busy()||this.connecting())return;let a=this.generation;this.invalidateListRead(),this.busy.set("delete"),this.actionError.set("");try{if(yield this.direct.deleteLine(i.workspaceId,i.accountId,e.id),!this.current(a))return;++this.listVersion,++this.detailVersion,this.removedLineIds.add(e.id),this.lines.update(u=>u.filter(h=>h.id!==e.id)),this.deleting.set(null),this.selected()?.id===e.id&&this.selected.set(null),this.returnFocus("dialog")}catch(u){this.current(a)&&this.actionError.set(u?.status===409?"META_LINE.DELETE_CONFLICT":"META_LINE.DELETE_ERROR")}finally{this.current(a)&&this.busy.set("")}})}openAssignment(e){return N(this,null,function*(){this.busy()||this.connecting()||(this.captureFocus("dialog"),this.assigning.set(e),this.draftAgent.set(e.agent_id),this.actionError.set(""),yield this.loadAgents())})}closeAssignment(){this.assigning.set(null),this.returnFocus("dialog")}loadAgents(){return N(this,null,function*(){let e=this.scope(),i=this.assigning();if(!e||!i)return;let a=this.generation;this.agentsLoading.set(!0),this.agentsError.set(!1),this.agents.set(i.agent_id?[{value:i.agent_id,label:i.agent_name||this.i18n.instant("META_L
1INE.CURRENT_ASSIGNMENT")}]:[]);try{let u=1,h=!1,x=[];do{let v=yield this.direct.eligibleAgents(e.workspaceId,e.accountId,u++);if(!this.current(a)||this.assigning()?.id!==i.id)return;if(x.push(...ni(v.data.items)),h=v.data.has_more,!v.data.items.length)break}while(h&&u<=ti);i.agent_id&&!x.some(v=>v.value===i.agent_id)&&x.unshift({value:i.agent_id,label:i.agent_name||this.i18n.instant("META_LINE.CURRENT_ASSIGNMENT")}),this.agents.set(x)}catch{this.current(a)&&this.agentsError.set(!0)}finally{this.current(a)&&this.agentsLoading.set(!1)}})}saveAssignment(){return N(this,null,function*(){let e=this.assigning();if(!e||this.draftAgent()===e.agent_id||this.agentsLoading()||this.agentsError())return;let i=this.scope();if(!i)return;(yield this.mutate(e,()=>this.direct.assignAgent(i.workspaceId,i.accountId,e.id,this.draftAgent()),"assignment"))&&this.closeAssignment()})}connectLine(e){return N(this,null,function*(){let i=this.scope();if(!i||!this.signupReady()||this.connecting()||this.busy())return;let a=this.generation;this.connecting.set(!0),this.signupStage.set("META_LINE.AUTHORIZING"),this.actionError.set(""),this.restorePrompt.set(null);let u;try{if(u=yield this.embeddedSignup.launch(),!this.current(a))return;yield this.finishSignup(i,a,u,e)}catch(h){if(!this.current(a)||(this.signupStage.set(""),h instanceof Error&&h.message==="META_SIGNUP_CANCELLED"))return;if(this.isArchivedConflict(h)&&e&&u){this.restorePrompt.set({lineId:e.id,phone:this.phone(e),identity:e.business_name||e.verified_name||e.display_phone_number||this.phone(e),signup:u});return}this.actionError.set(this.signupErrorKey(h))}finally{this.current(a)&&this.connecting.set(!1)}})}confirmRestoreArchived(){return N(this,null,function*(){let e=this.restorePrompt(),i=this.scope();if(!e||!i||this.connecting()||this.busy())return;let a=this.generation;this.connecting.set(!0),this.signupStage.set("META_LINE.VERIFYING"),this.actionError.set("");try{yield this.finishSignup(i,a,e.signup,{id:e.lineId},!0),this.restorePrompt.set(null)}catch(u){this.current(a)&&this.actionError.set(this.signupErrorKey(u))}finally{this.current(a)&&(this.connecting.set(!1),this.signupStage.set(""))}})}cancelRestoreArchived(){this.restorePrompt.set(null)}finishSignup(e,i,a,u,h=!1){return N(this,null,function*(){this.signupStage.set("META_LINE.VERIFYING");let x=yield this.direct.completeSignup(e.workspaceId,e.accountId,a.code,a.session,{expectedLineId:u?.id,restoreDeleted:h});if(!this.current(i))return;if(h&&this.removedLineIds.delete(x.data.id),x.data.connection_status==="pending")throw yield this.loadData(),new Error("META_LINE.CONNECT_PENDING");let v;try{v=yield this.direct.checkLine(e.workspaceId,e.accountId,x.data.id)}finally{this.current(i)&&(yield this.loadData())}if(this.current(i)){if(v.data.connection_status!=="connected"||v.data.authorization_status!=="connected"||v.data.provider_status!=="CONNECTED"||v.data.last_check_error)throw new Error("META_LINE.CONNECT_ERROR");this.current(i)&&(this.selected.set(v.data),this.signupStage.set(""))}})}signupErrorKey(e){return e instanceof Error&&e.message==="META_LINE.CONNECT_PENDING"?"META_LINE.CONNECT_PENDING":"META_L
1INE.CONNECT_ERROR"}isArchivedConflict(e){return e?.status===409}resetInteractiveState(){this.rowMenus.clear(),this.lines.set([]),this.settled.set(!1),this.loading.set(!1),this.selected.set(null),this.deleting.set(null),this.assigning.set(null),this.draftAgent.set(null),this.agents.set([]),this.agentsLoading.set(!1),this.agentsError.set(!1),this.restorePrompt.set(null),this.busy.set(""),this.actionError.set(""),this.error.set(""),this.copied.set(""),this.connecting.set(!1),this.signupStage.set(""),this.focusOrigins.clear()}invalidateListRead(){++this.listVersion,this.loading.set(!1)}mutate(e,i,a){return N(this,null,function*(){if(!this.scope()||this.busy()||this.connecting())return!1;let u=this.generation;this.invalidateListRead(),this.busy.set(a),this.actionError.set(""),++this.detailVersion;try{let h=yield i();return this.current(u)?(this.lines.update(x=>x.map(v=>v.id===e.id?h.data:v)),this.selected()?.id===e.id&&this.selected.set(h.data),!0):!1}catch{return this.current(u)&&this.actionError.set("META_LINE.ACTION_ERROR"),!1}finally{this.current(u)&&this.busy.set("")}})}current(e){let i=this.scope();return e===this.generation&&!!i&&H(this.iam)===this.scopeKey}scope(){return De(this.iam)}};s.\u0275fac=function(i){return new(i||s)},s.\u0275cmp=ne({type:s,selectors:[["app-meta-whatsapp-channels"]],decls:30,vars:53,consts:[["actions",""],[1,"meta-channels"],[1,"meta-channels__header"],[1,"meta-channels__heading"],[1,"text--title"],[1,"meta-channels__header-actions"],["variant","text","icon","pi pi-refresh",3,"onClick","label","loading","disabled"],["icon","pi pi-plus",3,"onClick","label","loading","disabled"],["role","alert",1,"meta-channels__notice"],["role","status",1,"meta-channels__notice"],["role","alert",1,"meta-channels__notice","meta-channels__notice--error"],[1,"meta-channels__state"],["role","status",1,"meta-channels__state"],["role","alert",1,"meta-channels__state","meta-channels__state--error"],["position","right",3,"visibleChange","visible","header"],[1,"meta-detail"],[3,"visibleChange","visible","modal","closable","header"],["variant","text",3,"onClick"],["aria-hidden","true",1,"pi","pi-spin","pi-spinner"],["aria-hidden","true",1,"pi","pi-exclamation-circle"],["size","28px","weight","2px"],["aria-hidden","true",1,"pi","pi-exclamation-triangle"],["variant","outlined","icon","pi pi-refresh",3,"onClick","label","loading"],[1,"meta-channels__table"],["dataKey","id",3,"rowClicked","columns","data","rows","totalRecords","lazy","paginator","captionSearchLabel","currentPageReportTemplate","globalFilterTransform","globalFilterFields","showClearFilters","preservePageOnDataChange","loading"],["daptaPrimeCellTemplate","phone"],["daptaPrimeCellTemplate","agent"],["daptaPrimeCellTemplate","state"],["daptaPrimeCellTemplate","messaging_limit"],["daptaPrimeCellTemplate","verified"],["daptaPrimeCellTemplate","actions"],[1,"meta-channels__phone"],[1,"meta-channels__phone-number"],[3,"click"],["variant","text","size","small",3,"onClick","icon","ariaLabel","disabled"],[1,"meta-channels__secondary"],[1,"meta-channels__agent-link",3,"routerLink"],[1,"meta-channels__agent-link",3,"click","routerLink"],[3,"severity","value"],[3,"title"],[1,"meta-channels__actions",3,"click"],["variant","text","size","small",3,"disabled"],["variant","text","size","small"],["appendTo","body",3,"model","popup"],["variant","text","size","small","icon","pi pi-ellipsis-v",3,"onClick","ariaLabel"],["variant","text","size","small",3,"onClick","disabled"],["variant","text","size","small",3,"onClick"],[1,"meta-detail__status"],[1,"meta-detail__hint"],[1,"meta-detail__facts"],[3,"routerLink"],[1,"meta-detail__section"],[1,"meta-detail__timeline"],[1,"meta-detail__details"],["href","https://business.facebook.com/settings/whatsapp-business-accounts","target","_blank","rel","noopener noreferrer"],[1,"meta-detail__actions"],["variant","outlined",3,"onClick","loading","disabled"],["variant","outlined",3,"onClick","disabled"],["variant","outlined",3,"loading","disabled"],["variant","text","buttonColor","danger",3,"onClick","disabled"],[1,"meta-detail__issues"],[1,"meta-detail__note"],[1,"meta-detail__timeline-when"],[1,"meta-detail__c
1opyable"],["role","alert"],["buttonColor","danger",3,"onClick","loading","disabled"],["optionLabel","label","optionValue","value",3,"options","loading","disabled","filter","ngModel","label","emptyMessage"],["variant","text",3,"onClick","disabled"],[3,"onClick","loading","disabled"],[3,"onClick"],["optionLabel","label","optionValue","value",3,"onChange","options","loading","disabled","filter","ngModel","label","emptyMessage"]],template:function(i,a){if(i&1&&(r(0,"section",1)(1,"header",2)(2,"div",3)(3,"h1",4),p(4),c(5,"translate"),l()(),r(6,"div",5)(7,"dui-button",6),c(8,"translate"),f("onClick",function(){return a.loadData()}),l(),r(9,"dui-button",7),c(10,"translate"),f("onClick",function(){return a.connectLine()}),l()()(),C(11,nt,6,6,"p",8),C(12,at,4,3,"p",9),C(13,ot,4,3,"p",10),C(14,st,4,3,"div",11)(15,rt,2,0,"div",12)(16,lt,7,7,"div",13)(17,pt,9,11,"div",11)(18,It,11,19),l(),r(19,"p-drawer",14),f("visibleChange",function(h){return!h&&a.closeDetail()}),C(20,Kt,116,113,"div",15),l(),r(21,"p-dialog",16),c(22,"translate"),f("visibleChange",function(h){return!h&&!a.busy()&&a.closeDelete()}),C(23,Yt,14,19),l(),r(24,"p-dialog",16),c(25,"translate"),f("visibleChange",function(h){return!h&&!a.busy()&&a.closeAssignment()}),C(26,Zt,19,20),l(),r(27,"p-dialog",16),c(28,"translate"),f("visibleChange",function(h){return!h&&a.cancelRestoreArchived()}),C(29,ei,14,20),l()),i&2){let u,h,x,v,k;o(4),m(d(5,37,"META_WHATSAPP.TITLE")),o(3),E("label",d(8,39,"META_LINE.RELOAD"))("loading",a.loading())("disabled",a.scopeMissing()||!!a.busy()),o(2),E("label",d(10,41,"META_WHATSAPP.CONNECT_LINE"))("loading",a.connecting()||a.signupPreparing())("disabled",a.scopeMissing()||!a.signupReady()),o(2),g(a.signupPreparationError()?11:-1),o(),g(a.signupStage()?12:-1),o(),g(a.actionError()?13:-1),o(),g((u=a.view())==="scope-missing"?14:u==="loading"?15:u==="load-failed"?16:u==="empty"?17:18),o(5),W(L(49,Ke)),E("visible",!!a.selected())("header",a.selected()?a.phone(a.selected()):""),o(),g((h=a.selected())?20:-1,h),o(),W(L(50,ke)),E("visible",!!a.deleting())("modal",!0)("closable",!a.busy())("header",d(22,43,"META_LINE.DELETE")),o(2),g((x=a.deleting())?23:-1,x),o(),W(L(51,ke)),E("visible",!!a.assigning())("modal",!0)("closable",!a.busy())("header",d(25,45,"META_WHATSAPP.ASSIGN_TITLE")),o(2),g((v=a.assigning())?26:-1,v),o(),W(L(52,$e)),E("visible",!!a.restorePrompt())("modal",!0)("closable",!a.connecting())("header",d(28,47,"META_LINE.RESTORE_TITLE")),o(2),g((k=a.restorePrompt())?29:-1,k)}},dependencies:[ve,fe,xe,ce,Ee,Pe,Oe,Ae,Me,we,Se,Le,ye,Te,Ne,be,he,Ie,pe,ge],styles:['@charset "UTF-8";[_nghost-%COMP%]{display:block;height:100%;overflow:auto}.meta-channels[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px;min-height:100%;padding:var(--page-padding)}.meta-channels__header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:16px}.meta-channels__heading[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;min-width:0}.meta-channels__heading[_ngcontent-%COMP%]   h1[_ngcontent-%COMP%]{margin:0;min-width:0}.meta-channels__header-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;flex-shrink:0}.meta-channels__notice[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:8px;margin:0;padding:10px 12px;border:1px solid var(--space-300);border-radius:8px;background:var(--space-500);color:var(--contrast-200);font-size:var(--font-size-body)}.meta-channels__notice[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{margin-top:2px;font-size:14px}.meta-channels__notice--error[_ngcontent-%COMP%]{border-color:var(--tag-background-danger, var(--space-300));color:var(--contrast-100)}.meta-channels__notice--error[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{color:var(--tag-color-danger, var(--contrast-100))}.meta-channels__state[_ngcontent-%COMP%]{display:flex;flex:1;flex-direction:column;align-items:center;justify-content:center;gap:12px;min-height:280px;text-align:center;color:var(--contrast-200)}.meta-channels__state[_ngcontent-%COMP%]   h2[_ngcontent-%COMP%]{margin:0;color:var(--contrast-100);font-size:var(--font-size-h6, 16px)}.meta-channels__state[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{max-width:460px;margin:0}.meta-channels__state--error[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:22px;color:var(--tag-color-danger, var(--contrast-100))}.meta-channels__phone[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px}.meta-channels__phone-number[_ngcontent-%COMP%]{font-weight:var(--font-weight-medium, 500)}.meta-channels__agent-link[_ngcontent-%COMP%]{color:inherit;text-decoration:underline;text-underline-offset:2px}.meta-channels__issue[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px}.meta-channels__issue-text[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis}.meta-channels__secondary[_ngcontent-%COMP%]{color:var(--contrast-200);font-size:var(--font-size-caption)}.meta-channels__actions[_ngcontent-%COMP%]{display:flex;flex-wrap:nowrap;align-items:center;justify-content:flex-end;
1gap:4px}.meta-detail[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px;overflow-wrap:anywhere}.meta-detail__status[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;gap:6px}.meta-detail__hint[_ngcontent-%COMP%]{margin:0;color:var(--contrast-200);font-size:var(--font-size-body)}.meta-detail__section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px}.meta-detail__section[_ngcontent-%COMP%]   h3[_ngcontent-%COMP%]{margin:0;font-size:var(--font-size-body);font-weight:var(--font-weight-medium, 500);color:var(--contrast-100)}.meta-detail__facts[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(120px,40%) 1fr;gap:6px 12px;margin:0}.meta-detail__facts[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{display:contents}.meta-detail__facts[_ngcontent-%COMP%]   dt[_ngcontent-%COMP%]{color:var(--contrast-200);font-size:var(--font-size-caption)}.meta-detail__facts[_ngcontent-%COMP%]   dd[_ngcontent-%COMP%]{margin:0;font-size:var(--font-size-caption)}.meta-detail__copyable[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px}.meta-detail__issues[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px;margin:0;padding:0;list-style:none}.meta-detail__issues[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px;padding-left:10px;border-left:2px solid var(--space-300)}.meta-detail__issues[_ngcontent-%COMP%]   small[_ngcontent-%COMP%]{color:var(--contrast-200)}.meta-detail__timeline[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:6px;margin:0;padding:0;list-style:none}.meta-detail__timeline[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:baseline;gap:6px;font-size:var(--font-size-caption)}.meta-detail__timeline[_ngcontent-%COMP%]   small[_ngcontent-%COMP%], .meta-detail__timeline-when[_ngcontent-%COMP%]{color:var(--contrast-200)}.meta-detail__note[_ngcontent-%COMP%]{margin:0;color:var(--contrast-200);font-size:var(--font-size-caption)}.meta-detail__details[_ngcontent-%COMP%]{border:1px solid var(--space-300);border-radius:8px;padding:8px 12px}.meta-detail__details[_ngcontent-%COMP%]   summary[_ngcontent-%COMP%]{cursor:pointer;color:var(--contrast-100)}.meta-detail__details[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{margin:8px 0 0;color:var(--contrast-200);font-size:var(--font-size-caption)}.meta-detail__details[_ngcontent-%COMP%]   dl[_ngcontent-%COMP%]{margin-top:8px}.meta-detail__actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.meta-channels__table[_ngcontent-%COMP%]     .table-header{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.meta-channels__table[_ngcontent-%COMP%]     .table-header p-iconfield{width:min(360px,100%)}.meta-channels__table[_ngcontent-%COMP%]     .table-header input{width:100%}.meta-channels__table[_ngcontent-%COMP%]     .p-datatable .p-datatable-table th:first-child{width:200px}.meta-channels__table[_ngcontent-%COMP%]     .meta-channels__phone-number{white-space:nowrap;flex-shrink:0}.meta-channels__table[_ngcontent-%COMP%]     .p-datatable .p-datatable-table{table-layout:fixed;min-width:850px}.meta-channels__table[_ngcontent-%COMP%]     .p-datatable .p-datatable-table th .column-header>span{white-space:normal;overflow:visible;text-overflow:clip}.meta-channels__table[_ngcontent-%COMP%]     .p-datatable .p-datatable-table td{white-space:normal;overflow:visible;vertical-align:top}.meta-channels__table[_ngcontent-%COMP%]     .p-datatable .p-datatable-table td .cell-content{white-space:normal;overflow:visible;text-overflow:clip}.meta-channels__table[_ngcontent-%COMP%]     .meta-channels__issue{flex-direction:column;align-items:flex-start;gap:2px}.meta-channels__table[_ngcontent-%COMP%]     .meta-channels__issue-text{white-space:normal;overflow:visible;text-overflow:clip}.meta-channels__table[_ngcontent-%COMP%]     .meta-channels__issue-more{padding:0 4px;white-space:nowrap}@media(max-width:800px){.meta-channels[_ngcontent-%COMP%]{padding:16px}.meta-channels__header[_ngcontent-%COMP%]{flex-wrap:wrap}}@media(max-width:480px){.meta-channels__phone[_ngcontent-%COMP%]{flex-wrap:wrap}.meta-channels__phone-number[_ngcontent-%COMP%]{overflow-wrap:anywhere}}'],changeDetection:0});let t=s;return t})();export{ii as META_ISSUE_MATCH_MODE,Be as META_ISSUE_NONE,K as META_LINE_FRESHNESS_MS,Yi as MetaWhatsAppChannelsComponent,si as issueRemediationKey,ai as matchesMetaIssueFilter,$i as matchesMetaLine,oi as metaLineState,ri as metaLinesView,We as metaSearchIndex,Ve as normalizeMetaSearch,ni as toMetaAgentOptions};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.