AIRA/src/frontend/libs/linkify.min.js

1 line
19 KiB
JavaScript
Raw Permalink Normal View History

2021-03-20 18:03:47 +01:00
!function(){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n};!function(e){function a(n,e){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},t=Object.create(n.prototype);for(var o in a)t[o]=a[o];return t.constructor=e,e.prototype=t,e}function t(n){n=n||{},this.defaultProtocol=n.hasOwnProperty("defaultProtocol")?n.defaultProtocol:h.defaultProtocol,this.events=n.hasOwnProperty("events")?n.events:h.events,this.format=n.hasOwnProperty("format")?n.format:h.format,this.formatHref=n.hasOwnProperty("formatHref")?n.formatHref:h.formatHref,this.nl2br=n.hasOwnProperty("nl2br")?n.nl2br:h.nl2br,this.tagName=n.hasOwnProperty("tagName")?n.tagName:h.tagName,this.target=n.hasOwnProperty("target")?n.target:h.target,this.validate=n.hasOwnProperty("validate")?n.validate:h.validate,this.ignoreTags=[],this.attributes=n.attributes||n.linkAttributes||h.attributes,this.className=n.hasOwnProperty("className")?n.className:n.linkClass||h.className;for(var e=n.hasOwnProperty("ignoreTags")?n.ignoreTags:h.ignoreTags,a=0;a<e.length;a++)this.ignoreTags.push(e[a].toUpperCase())}function o(n,e){for(var a=0;a<n.length;a++)if(n[a]===e)return!0;return!1}function r(n){return n}function i(n,e){return"url"===e?"_blank":null}function s(){return function(n){this.j=[],this.T=n||null}}function c(n,e,a,t){for(var o=0,r=n.length,i=e,s=[],c=void 0;o<r&&(c=i.next(n[o]));)i=c,o++;if(o>=r)return[];for(;o<r-1;)c=new m(t),s.push(c),i.on(n[o],c),i=c,o++;return c=new m(a),s.push(c),i.on(n[r-1],c),s}function l(){return function(n){n&&(this.v=n)}}function u(n){var e=n?{v:n}:{};return a(d,l(),e)}function g(n){return n instanceof x||n instanceof C}var h={defaultProtocol:"http",events:null,format:r,formatHref:r,nl2br:!1,tagName:"a",target:i,validate:!0,ignoreTags:[],attributes:null,className:"linkified"};t.prototype={resolve:function(n){var e=n.toHref(this.defaultProtocol);return{formatted:this.get("format",n.toString(),n),formattedHref:this.get("formatHref",e,n),tagName:this.get("tagName",e,n),className:this.get("className",e,n),target:this.get("target",e,n),events:this.getObject("events",e,n),attributes:this.getObject("attributes",e,n)}},check:function(n){return this.get("validate",n.toString(),n)},get:function(e,a,t){var o=void 0,r=this[e];if(!r)return r;switch("undefined"==typeof r?"undefined":n(r)){case"function":return r(a,t.type);case"object":return o=r.hasOwnProperty(t.type)?r[t.type]:h[e],"function"==typeof o?o(a,t.type):o}return r},getObject:function(n,e,a){var t=this[n];return"function"==typeof t?t(e,a.type):t}};var b=Object.freeze({defaults:h,Options:t,contains:o}),p=s();p.prototype={defaultTransition:!1,on:function(n,e){if(n instanceof Array){for(var a=0;a<n.length;a++)this.j.push([n[a],e]);return this}return this.j.push([n,e]),this},next:function(n){for(var e=0;e<this.j.length;e++){var a=this.j[e],t=a[0],o=a[1];if(this.test(n,t))return o}return this.defaultTransition},accepts:function(){return!!this.T},test:function(n,e){return n===e},emit:function(){return this.T}};var m=a(p,s(),{test:function(n,e){return n===e||e instanceof RegExp&&e.test(n)}}),f=a(p,s(),{jump:function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=this.next(new n(""));return a===this.defaultTransition?(a=new this.constructor(e),this.on(n,a)):e&&(a.T=e),a},test:function(n,e){return n instanceof e}}),d=l();d.prototype={toString:function(){return this.v+""}};var x=u(),y=u("@"),v=u(":"),k=u("."),w=u(),j=u(),z=u("\n"),O=u(),q=u("+"),N=u("#"),S=u(),T=u("mailto:"),A=u("?"),L=u("/"),P=u("_"),E=u(),C=u(),R=u(),H=u("{"),B=u("["),U=u("<"),M=u("("),D=u("}"),I=u("]"),K=u(">"),_=u(")"),G=u("&"),Y=Object.freeze({Base:d,DOMAIN:x,AT:y,COLON:v,DOT:k,PUNCTUATION:w,LOCALHOST:j,NL:z,NUM:O,PLUS:q,POUND:N,QUERY:A,PROTOCOL:S,MAILTO:T,SLASH:L,UNDERSCORE:P,SYM:E,TLD:C,WS:R,OPENBRACE:H,OPENBRACKET:B,OPENANGLEBRACKET:U,OPENPAREN:M,CLOSEBRACE:D,CLOSEBRACKET:I,CLOSEANGLEBRACKET:K,CLOSEPAREN:_,AMPERSAND:G}),Q="aaa|aarp|a