1import{a as ot}from"./chunk-FIGT3NEF.js";import{a as tt,b as et}from"./chunk-HXBGSEHQ.js";import{Ma as Z,i as j}from"./chunk-C53UORQN.js";import{c as w}from"./chunk-HRCH7YTL.js";import{d as X,e as Y}from"./chunk-QHZU4PST.js";import{b as J,c as K,i as Q,j as W}from"./chunk-HFX225X2.js";import{a as z}from"./chunk-CJEIUXWH.js";import{I as A,c as B,f as V,i as N,j as O,l as R,o as I,q as G,x as H,y as $}from"./chunk-3QAVFP5S.js";import{b as q}from"./chunk-LS74OHRZ.js";import{j as T,l as U}from"./chunk-NKUORADV.js";import{i as L}from"./chunk-224PXFJJ.js";import{$ as k,Ec as g,Fb as P,Gc as M,N as _,Sc as b,Vc as r,ca as F,dc as l,fa as v,fc as m,kc as h,lc as i,mc as n,nc as c,pb as a,qa as C,rc as p,rd as E,sc as f,sd as x,vc as D,xa as y,ya as S}from"./chunk-QXK5WLZZ.js";function it(t,s){t&1&&(i(0,"mat-error"),r(1,"Please enter a url"),n())}function nt(t,s){t&1&&(i(0,"mat-error"),r(1,"That url doesn't seem to be valid"),n())}function rt(t,s){t&1&&(i(0,"mat-error"),r(1,"That url doesn't seem to be valid"),n())}function at(t,s){t&1&&(i(0,"mat-error"),r(1,"Sorry, we weren't allowed to access that"),n())}function lt(t,s){t&1&&(i(0,"mat-error"),r(1,"Sorry, that url could not be found"),n())}function mt(t,s){if(t&1){let o=D();i(0,"mat-error"),r(1," Sorry, that url took too long to load, please "),i(2,"a",9),g("click",function(e){y(o);let d=M();return S(d.retry(e))}),r(3,"retry"),n()()}}function st(t,s){t&1&&(i(0,"mat-error"),r(1," Sorry that url seems to be having a problem "),n())}function ut(t,s){t&1&&c(0,"mat-progress-bar",4)}function dt(t,s){t&1&&c(0,"ih-unfurl-preview",5),t&2&&h("data",s)}var Vt=(()=>{class t{matDialogRef=C(q);unfurlService=C(Z);analytics=j("PostFromLinkDialogComponent");hostClass=!0;unfurled=!1;linkForm=new R({url:new I("",V.required,this.unfurlService.urlUnfurlValidator())});unfurl$=this.linkForm.controls.url.valueChanges.pipe(F(o=>this.unfurlService.getUnfurl$(o)),v(o=>{o&&(this.unfurled=!0)}),k(1));retry(o){o.preventDefault(),this.linkForm.controls.url.setValue(this.linkForm.controls.url.value)}next(){this.linkForm.valid&&(this.analytics.trackEvent({name:"post_link_import_started",properties:{sourceUrlDomain:this.getUrlHost(this.linkForm.controls.url.value)}}),this.unfurl$.pipe(_(1)).subscribe(o=>{o&&this.matDialogRef.close(o)}))}close(){this.matDialogRef.close()}getUrlHost(o){if(!o)return null;try{return new URL(o).hostname}catch{return null}}static \u0275fac=function(u){return new(u||t)};static \u0275cmp=P({type:t,selectors:[["ih-post-from-link-dialog"]],hostVars:4,hostBindings:function(u,e){u&2&&b("ih-post-from-link-dialog",e.hostClass)("unfurled",e.unfurled)},decls:24,vars:12,consts:[["ih-header",""],["ih-content",""],["id","linkForm",3,"ngSubmit","formGroup"],["cdkFocusInitial","","matInput","","name","url","formControlName","url","data-lpignore","true","autocomplete","off"],["mode","indeterminate"],[3,"data"],["ih-footer",""],["mat-button","","type","button","color","primary",3,"click"],["mat-button","","type","submit","form","linkForm","color","primary"],["href","",3,"click"]],template:function(u,e){if(u&1&&(i(0,"ih-basic-dialog"),p(1,0),r(2,"Post from link"),f(),p(3,1),i(4,"form",2),g("ngSubmit",function(){return e.next()}),i(5,"mat-form-field")(6,"mat-label"),r(7,"Type or paste your link"),n(),c(8,"input",3),l(9,it,2,0,"mat-error"),l(10,nt,2,0,"mat-error"),l(11,rt,2,0,"mat-error"),l(12,at,2,0,"mat-error"),l(13,lt,2,0,"mat-error"),l(14,mt,4,0,"mat-error"),l(15,st,2,0,"mat-error"),l(16,ut,1,0,"mat-progress-bar",4),n(),l(17,dt,1,1,"ih-unfurl-preview",5),E(18,"async"),n(),f(),p(19,6),i(20,"button",7),g("click",function(){return e.close()}),r(21,"Cancel"),n(),i(22,"button",8),r(23,"Next"),n(),f(),n()),u&2){let d;a(4),h("formGroup",e.linkForm),a(5),m(e.linkForm.get("url").hasError("required")?9:-1),a(),m(e.linkForm.get("url").hasError("urlInvalid")?10:-1),a(),m(e.linkForm.get("url").hasError("400")?11:-1),a(),m(e.linkForm.get("url").hasError("401")?12:-1),a(),m(e.linkForm.get("url").hasError("404")?13:-1),a(),m(e.linkForm.get("url").hasError("504")?14:-1),a(),m(e.linkForm.get("url").hasError("urlError")?15:-1),a(),m(e.linkForm.get("url").pending?16:-1),a(),m((d=x(18,10,e.unfurl$))?17:-1,d)}},dependencies:[U,T,W,Q,J,K,w,Y,X,et,tt,A,G,B,N,O,$,H,z,ot,L],styles:["[_nghost-%COMP%]{display:block;height:260px}.unfurled[_nghost-%COMP%]{height:auto} .cdk-overlay-pane.post-from-link-dialog{height:auto;width:60%}.mat-mdc-form-field[_ngcontent-%COMP%]{width:100%}.mat-toolbar[_ngcontent-%COMP%]{padding:0 8px}.close-btn[_ngcontent-%COMP%]{margin-right:8px}.dialog-content[_ngcontent-%COMP%]{padding:16px}.unfurl[_ngcontent-%COMP%]{margin-bottom:8px}"],changeDetection:0})}return t})();export{Vt as a}; 2/**i18n:c9e569e2ecdb3e0de183c72d8315eadfdcb9da9e09d5ac2d9fef9056c1853e21*/
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.