f_0001a4 27.3 KB
Newer Older
Luca Braun's avatar
Luca Braun committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482
define(['dart_sdk', 'packages/flutter/src/services/text_input.dart', 'packages/flutter/src/foundation/_platform_web.dart', 'packages/characters/src/characters_impl.dart', 'packages/characters/src/extensions.dart', 'packages/flutter/src/services/text_editing.dart'], (function load__packages__flutter__src__services__text_formatter_dart(dart_sdk, packages__flutter__src__services__text_input$46dart, packages__flutter__src__foundation___platform_web$46dart, packages__characters__src__characters_impl$46dart, packages__characters__src__extensions$46dart, packages__flutter__src__services__text_editing$46dart) {
  'use strict';
  const core = dart_sdk.core;
  const _internal = dart_sdk._internal;
  const math = dart_sdk.math;
  const ui = dart_sdk.ui;
  const dart = dart_sdk.dart;
  const dartx = dart_sdk.dartx;
  const text_input = packages__flutter__src__services__text_input$46dart.src__services__text_input;
  const platform$ = packages__flutter__src__foundation___platform_web$46dart.src__foundation__platform;
  const characters_impl = packages__characters__src__characters_impl$46dart.src__characters_impl;
  const extensions = packages__characters__src__extensions$46dart.src__extensions;
  const text_editing = packages__flutter__src__services__text_editing$46dart.src__services__text_editing;
  var text_formatter = Object.create(dart.library);
  var $isNotEmpty = dartx.isNotEmpty;
  var $splitMapJoin = dartx.splitMapJoin;
  var $length = dartx.length;
  var $substring = dartx.substring;
  dart._checkModuleNullSafetyMode(false);
  var T = {
    MaxLengthEnforcementL: () => (T.MaxLengthEnforcementL = dart.constFn(dart.legacy(text_formatter.MaxLengthEnforcement)))(),
    MatchToString: () => (T.MatchToString = dart.constFn(dart.fnType(core.String, [core.Match])))(),
    StringToString: () => (T.StringToString = dart.constFn(dart.fnType(core.String, [core.String])))()
  };
  var T$Eval = Object.assign({
    _: () => T$Eval
  }, T);
  var S = {
    _: () => S
  };
  var S$Eval = Object.assign({
    _: () => S$Eval
  }, S);
  const CT = Object.create({
    _: () => (C, CT)
  });
  dart.defineLazy(CT, {
    get C0() {
      return C[0] = dart.const({
        __proto__: text_formatter.MaxLengthEnforcement.prototype,
        [_name$]: "MaxLengthEnforcement.none",
        index: 0
      });
    },
    get C1() {
      return C[1] = dart.const({
        __proto__: text_formatter.MaxLengthEnforcement.prototype,
        [_name$]: "MaxLengthEnforcement.enforced",
        index: 1
      });
    },
    get C2() {
      return C[2] = dart.const({
        __proto__: text_formatter.MaxLengthEnforcement.prototype,
        [_name$]: "MaxLengthEnforcement.truncateAfterCompositionEnds",
        index: 2
      });
    },
    get C3() {
      return C[3] = dart.constList([C[0] || CT.C0, C[1] || CT.C1, C[2] || CT.C2], T.MaxLengthEnforcementL());
    },
    get C4() {
      return C[4] = dart.const({
        __proto__: platform$.TargetPlatform.prototype,
        [_name]: "TargetPlatform.android",
        index: 0
      });
    },
    get C5() {
      return C[5] = dart.const({
        __proto__: platform$.TargetPlatform.prototype,
        [_name]: "TargetPlatform.windows",
        index: 5
      });
    },
    get C6() {
      return C[6] = dart.const({
        __proto__: platform$.TargetPlatform.prototype,
        [_name]: "TargetPlatform.iOS",
        index: 2
      });
    },
    get C7() {
      return C[7] = dart.const({
        __proto__: platform$.TargetPlatform.prototype,
        [_name]: "TargetPlatform.macOS",
        index: 4
      });
    },
    get C8() {
      return C[8] = dart.const({
        __proto__: platform$.TargetPlatform.prototype,
        [_name]: "TargetPlatform.linux",
        index: 3
      });
    },
    get C9() {
      return C[9] = dart.const({
        __proto__: platform$.TargetPlatform.prototype,
        [_name]: "TargetPlatform.fuchsia",
        index: 1
      });
    },
    get C11() {
      return C[11] = dart.const({
        __proto__: ui.TextAffinity.prototype,
        [_name$0]: "TextAffinity.downstream",
        index: 1
      });
    },
    get C10() {
      return C[10] = dart.const({
        __proto__: text_editing.TextSelection.prototype,
        [TextRange_end]: -1,
        [TextRange_start]: -1,
        [TextSelection_isDirectional]: false,
        [TextSelection_affinity]: C[11] || CT.C11,
        [TextSelection_extentOffset]: -1,
        [TextSelection_baseOffset]: -1
      });
    }
  }, false);
  var C = Array(12).fill(void 0);
  var I = [
    "file:///C:/Users/Luca/Documents/flutter/flutter_windows_1.22.5-stable/flutter/packages/flutter/lib/src/services/text_formatter.dart",
    "package:flutter/src/services/text_formatter.dart"
  ];
  var _name$ = dart.privateName(text_formatter, "_name");
  text_formatter.MaxLengthEnforcement = class MaxLengthEnforcement extends core.Object {
    toString() {
      return this[_name$];
    }
  };
  (text_formatter.MaxLengthEnforcement.new = function(index, _name) {
    if (index == null) dart.nullFailed(I[0], 42, 6, "index");
    if (_name == null) dart.nullFailed(I[0], 42, 6, "_name");
    this.index = index;
    this[_name$] = _name;
    ;
  }).prototype = text_formatter.MaxLengthEnforcement.prototype;
  dart.addTypeTests(text_formatter.MaxLengthEnforcement);
  dart.addTypeCaches(text_formatter.MaxLengthEnforcement);
  dart.setLibraryUri(text_formatter.MaxLengthEnforcement, I[1]);
  dart.setFieldSignature(text_formatter.MaxLengthEnforcement, () => ({
    __proto__: dart.getFields(text_formatter.MaxLengthEnforcement.__proto__),
    index: dart.finalFieldType(core.int),
    [_name$]: dart.finalFieldType(core.String)
  }));
  dart.defineExtensionMethods(text_formatter.MaxLengthEnforcement, ['toString']);
  text_formatter.MaxLengthEnforcement.none = C[0] || CT.C0;
  text_formatter.MaxLengthEnforcement.enforced = C[1] || CT.C1;
  text_formatter.MaxLengthEnforcement.truncateAfterCompositionEnds = C[2] || CT.C2;
  text_formatter.MaxLengthEnforcement.values = C[3] || CT.C3;
  text_formatter.TextInputFormatter = class TextInputFormatter extends core.Object {
    static withFunction(formatFunction) {
      if (formatFunction == null) dart.nullFailed(I[0], 95, 29, "formatFunction");
      return new text_formatter._SimpleTextInputFormatter.new(formatFunction);
    }
  };
  (text_formatter.TextInputFormatter.new = function() {
    ;
  }).prototype = text_formatter.TextInputFormatter.prototype;
  dart.addTypeTests(text_formatter.TextInputFormatter);
  dart.addTypeCaches(text_formatter.TextInputFormatter);
  dart.setLibraryUri(text_formatter.TextInputFormatter, I[1]);
  text_formatter._SimpleTextInputFormatter = class _SimpleTextInputFormatter extends text_formatter.TextInputFormatter {
    formatEditUpdate(oldValue, newValue) {
      let t1, t0;
      if (oldValue == null) dart.nullFailed(I[0], 117, 22, "oldValue");
      if (newValue == null) dart.nullFailed(I[0], 118, 22, "newValue");
      t0 = oldValue;
      t1 = newValue;
      return this.formatFunction(t0, t1);
    }
  };
  (text_formatter._SimpleTextInputFormatter.new = function(formatFunction) {
    if (formatFunction == null) dart.nullFailed(I[0], 110, 34, "formatFunction");
    this.formatFunction = formatFunction;
    if (!(formatFunction != null)) dart.assertFailed(null, I[0], 111, 14, "formatFunction != null");
    ;
  }).prototype = text_formatter._SimpleTextInputFormatter.prototype;
  dart.addTypeTests(text_formatter._SimpleTextInputFormatter);
  dart.addTypeCaches(text_formatter._SimpleTextInputFormatter);
  dart.setMethodSignature(text_formatter._SimpleTextInputFormatter, () => ({
    __proto__: dart.getMethods(text_formatter._SimpleTextInputFormatter.__proto__),
    formatEditUpdate: dart.fnType(text_input.TextEditingValue, [text_input.TextEditingValue, text_input.TextEditingValue])
  }));
  dart.setLibraryUri(text_formatter._SimpleTextInputFormatter, I[1]);
  dart.setFieldSignature(text_formatter._SimpleTextInputFormatter, () => ({
    __proto__: dart.getFields(text_formatter._SimpleTextInputFormatter.__proto__),
    formatFunction: dart.finalFieldType(dart.fnType(text_input.TextEditingValue, [text_input.TextEditingValue, text_input.TextEditingValue]))
  }));
  var filterPattern$ = dart.privateName(text_formatter, "FilteringTextInputFormatter.filterPattern");
  var allow$ = dart.privateName(text_formatter, "FilteringTextInputFormatter.allow");
  var replacementString$ = dart.privateName(text_formatter, "FilteringTextInputFormatter.replacementString");
  text_formatter.FilteringTextInputFormatter = class FilteringTextInputFormatter extends text_formatter.TextInputFormatter {
    get filterPattern() {
      return this[filterPattern$];
    }
    set filterPattern(value) {
      super.filterPattern = value;
    }
    get allow() {
      return this[allow$];
    }
    set allow(value) {
      super.allow = value;
    }
    get replacementString() {
      return this[replacementString$];
    }
    set replacementString(value) {
      super.replacementString = value;
    }
    formatEditUpdate(oldValue, newValue) {
      if (oldValue == null) dart.nullFailed(I[0], 263, 22, "oldValue");
      if (newValue == null) dart.nullFailed(I[0], 264, 22, "newValue");
      return text_formatter._selectionAwareTextManipulation(newValue, dart.fn(substring => {
        if (substring == null) dart.nullFailed(I[0], 268, 15, "substring");
        return substring[$splitMapJoin](this.filterPattern, {onMatch: !dart.test(this.allow) ? dart.fn(match => {
            if (match == null) dart.nullFailed(I[0], 271, 36, "match");
            return this.replacementString;
          }, T.MatchToString()) : null, onNonMatch: dart.test(this.allow) ? dart.fn(nonMatch => {
            if (nonMatch == null) dart.nullFailed(I[0], 272, 39, "nonMatch");
            return nonMatch[$isNotEmpty] ? this.replacementString : "";
          }, T.StringToString()) : null});
      }, T.StringToString()));
    }
  };
  (text_formatter.FilteringTextInputFormatter.new = function(filterPattern, opts) {
    if (filterPattern == null) dart.nullFailed(I[0], 150, 10, "filterPattern");
    let allow = opts && 'allow' in opts ? opts.allow : null;
    if (allow == null) dart.nullFailed(I[0], 151, 19, "allow");
    let replacementString = opts && 'replacementString' in opts ? opts.replacementString : "";
    if (replacementString == null) dart.nullFailed(I[0], 152, 10, "replacementString");
    this[filterPattern$] = filterPattern;
    this[allow$] = allow;
    this[replacementString$] = replacementString;
    if (!(filterPattern != null)) dart.assertFailed(null, I[0], 153, 15, "filterPattern != null");
    if (!(allow != null)) dart.assertFailed(null, I[0], 154, 15, "allow != null");
    if (!(replacementString != null)) dart.assertFailed(null, I[0], 155, 15, "replacementString != null");
    ;
  }).prototype = text_formatter.FilteringTextInputFormatter.prototype;
  (text_formatter.FilteringTextInputFormatter.allow = function(filterPattern, opts) {
    if (filterPattern == null) dart.nullFailed(I[0], 162, 10, "filterPattern");
    let replacementString = opts && 'replacementString' in opts ? opts.replacementString : "";
    if (replacementString == null) dart.nullFailed(I[0], 163, 10, "replacementString");
    this[filterPattern$] = filterPattern;
    this[replacementString$] = replacementString;
    if (!(filterPattern != null)) dart.assertFailed(null, I[0], 164, 15, "filterPattern != null");
    if (!(replacementString != null)) dart.assertFailed(null, I[0], 165, 15, "replacementString != null");
    this[allow$] = true;
    ;
  }).prototype = text_formatter.FilteringTextInputFormatter.prototype;
  (text_formatter.FilteringTextInputFormatter.deny = function(filterPattern, opts) {
    if (filterPattern == null) dart.nullFailed(I[0], 173, 10, "filterPattern");
    let replacementString = opts && 'replacementString' in opts ? opts.replacementString : "";
    if (replacementString == null) dart.nullFailed(I[0], 174, 10, "replacementString");
    this[filterPattern$] = filterPattern;
    this[replacementString$] = replacementString;
    if (!(filterPattern != null)) dart.assertFailed(null, I[0], 175, 15, "filterPattern != null");
    if (!(replacementString != null)) dart.assertFailed(null, I[0], 176, 15, "replacementString != null");
    this[allow$] = false;
    ;
  }).prototype = text_formatter.FilteringTextInputFormatter.prototype;
  dart.addTypeTests(text_formatter.FilteringTextInputFormatter);
  dart.addTypeCaches(text_formatter.FilteringTextInputFormatter);
  dart.setMethodSignature(text_formatter.FilteringTextInputFormatter, () => ({
    __proto__: dart.getMethods(text_formatter.FilteringTextInputFormatter.__proto__),
    formatEditUpdate: dart.fnType(text_input.TextEditingValue, [text_input.TextEditingValue, text_input.TextEditingValue])
  }));
  dart.setLibraryUri(text_formatter.FilteringTextInputFormatter, I[1]);
  dart.setFieldSignature(text_formatter.FilteringTextInputFormatter, () => ({
    __proto__: dart.getFields(text_formatter.FilteringTextInputFormatter.__proto__),
    filterPattern: dart.finalFieldType(core.Pattern),
    allow: dart.finalFieldType(core.bool),
    replacementString: dart.finalFieldType(core.String)
  }));
  dart.defineLazy(text_formatter.FilteringTextInputFormatter, {
    /*text_formatter.FilteringTextInputFormatter.singleLineFormatter*/get singleLineFormatter() {
      return new text_formatter.FilteringTextInputFormatter.deny("\n");
    },
    /*text_formatter.FilteringTextInputFormatter.digitsOnly*/get digitsOnly() {
      return new text_formatter.FilteringTextInputFormatter.allow(core.RegExp.new("[0-9]"));
    }
  }, false);
  text_formatter.BlacklistingTextInputFormatter = class BlacklistingTextInputFormatter extends text_formatter.FilteringTextInputFormatter {
    get blacklistedPattern() {
      return this.filterPattern;
    }
  };
  (text_formatter.BlacklistingTextInputFormatter.new = function(blacklistedPattern, opts) {
    if (blacklistedPattern == null) dart.nullFailed(I[0], 297, 13, "blacklistedPattern");
    let replacementString = opts && 'replacementString' in opts ? opts.replacementString : "";
    if (replacementString == null) dart.nullFailed(I[0], 298, 12, "replacementString");
    text_formatter.BlacklistingTextInputFormatter.__proto__.deny.call(this, blacklistedPattern, {replacementString: replacementString});
    ;
  }).prototype = text_formatter.BlacklistingTextInputFormatter.prototype;
  dart.addTypeTests(text_formatter.BlacklistingTextInputFormatter);
  dart.addTypeCaches(text_formatter.BlacklistingTextInputFormatter);
  dart.setGetterSignature(text_formatter.BlacklistingTextInputFormatter, () => ({
    __proto__: dart.getGetters(text_formatter.BlacklistingTextInputFormatter.__proto__),
    blacklistedPattern: core.Pattern
  }));
  dart.setLibraryUri(text_formatter.BlacklistingTextInputFormatter, I[1]);
  dart.defineLazy(text_formatter.BlacklistingTextInputFormatter, {
    /*text_formatter.BlacklistingTextInputFormatter.singleLineFormatter*/get singleLineFormatter() {
      return new text_formatter.BlacklistingTextInputFormatter.new(core.RegExp.new("\\n"));
    }
  }, false);
  text_formatter.WhitelistingTextInputFormatter = class WhitelistingTextInputFormatter extends text_formatter.FilteringTextInputFormatter {
    get whitelistedPattern() {
      return this.filterPattern;
    }
  };
  (text_formatter.WhitelistingTextInputFormatter.new = function(whitelistedPattern) {
    if (whitelistedPattern == null) dart.nullFailed(I[0], 328, 42, "whitelistedPattern");
    if (!(whitelistedPattern != null)) dart.assertFailed(null, I[0], 329, 14, "whitelistedPattern != null");
    text_formatter.WhitelistingTextInputFormatter.__proto__.allow.call(this, whitelistedPattern);
    ;
  }).prototype = text_formatter.WhitelistingTextInputFormatter.prototype;
  dart.addTypeTests(text_formatter.WhitelistingTextInputFormatter);
  dart.addTypeCaches(text_formatter.WhitelistingTextInputFormatter);
  dart.setGetterSignature(text_formatter.WhitelistingTextInputFormatter, () => ({
    __proto__: dart.getGetters(text_formatter.WhitelistingTextInputFormatter.__proto__),
    whitelistedPattern: core.Pattern
  }));
  dart.setLibraryUri(text_formatter.WhitelistingTextInputFormatter, I[1]);
  dart.defineLazy(text_formatter.WhitelistingTextInputFormatter, {
    /*text_formatter.WhitelistingTextInputFormatter.digitsOnly*/get digitsOnly() {
      return new text_formatter.WhitelistingTextInputFormatter.new(core.RegExp.new("\\d+"));
    }
  }, false);
  var maxLength$ = dart.privateName(text_formatter, "LengthLimitingTextInputFormatter.maxLength");
  var maxLengthEnforcement$ = dart.privateName(text_formatter, "LengthLimitingTextInputFormatter.maxLengthEnforcement");
  var _name = dart.privateName(platform$, "_name");
  text_formatter.LengthLimitingTextInputFormatter = class LengthLimitingTextInputFormatter extends text_formatter.TextInputFormatter {
    get maxLength() {
      return this[maxLength$];
    }
    set maxLength(value) {
      super.maxLength = value;
    }
    get maxLengthEnforcement() {
      return this[maxLengthEnforcement$];
    }
    set maxLengthEnforcement(value) {
      super.maxLengthEnforcement = value;
    }
    static getDefaultMaxLengthEnforcement(platform = null) {
      let t0;
      if (true) {
        return text_formatter.MaxLengthEnforcement.truncateAfterCompositionEnds;
      } else {
        switch (t0 = platform, t0 == null ? platform$.defaultTargetPlatform : t0) {
          case C[4] || CT.C4:
          case C[5] || CT.C5:
          {
            return text_formatter.MaxLengthEnforcement.enforced;
          }
          case C[6] || CT.C6:
          case C[7] || CT.C7:
          case C[8] || CT.C8:
          case C[9] || CT.C9:
          {
            return text_formatter.MaxLengthEnforcement.truncateAfterCompositionEnds;
          }
          default:
          {
            dart.throw(new _internal.ReachabilityError.new("`null` encountered as case in a switch expression with a non-nullable enum type."));
          }
        }
      }
    }
    static truncate(value, maxLength) {
      if (value == null) dart.nullFailed(I[0], 462, 53, "value");
      if (maxLength == null) dart.nullFailed(I[0], 462, 64, "maxLength");
      let iterator = new characters_impl.StringCharacterRange.new(value.text);
      if (dart.notNull(extensions['StringCharacters|get#characters'](value.text)[$length]) > dart.notNull(maxLength)) {
        iterator.expandNext(maxLength);
      }
      let truncated = iterator.current;
      return new text_input.TextEditingValue.new({text: truncated, selection: value.selection.copyWith({baseOffset: math.min(core.int, value.selection.start, truncated.length), extentOffset: math.min(core.int, value.selection.end, truncated.length)}), composing: !dart.test(value.composing.isCollapsed) && truncated.length > dart.notNull(value.composing.start) ? new ui.TextRange.new({start: value.composing.start, end: math.min(core.int, value.composing.end, truncated.length)}) : ui.TextRange.empty});
    }
    formatEditUpdate(oldValue, newValue) {
      let t0;
      if (oldValue == null) dart.nullFailed(I[0], 486, 22, "oldValue");
      if (newValue == null) dart.nullFailed(I[0], 487, 22, "newValue");
      let maxLength = this.maxLength;
      if (maxLength == null || maxLength === -1 || dart.notNull(extensions['StringCharacters|get#characters'](newValue.text)[$length]) <= dart.notNull(maxLength)) {
        return newValue;
      }
      if (!(dart.notNull(maxLength) > 0)) dart.assertFailed(null, I[0], 497, 12, "maxLength > 0");
      switch (t0 = this.maxLengthEnforcement, t0 == null ? text_formatter.LengthLimitingTextInputFormatter.getDefaultMaxLengthEnforcement() : t0) {
        case C[0] || CT.C0:
        {
          return newValue;
        }
        case C[1] || CT.C1:
        {
          if (extensions['StringCharacters|get#characters'](oldValue.text)[$length] == maxLength && !dart.test(oldValue.selection.isValid)) {
            return oldValue;
          }
          return text_formatter.LengthLimitingTextInputFormatter.truncate(newValue, maxLength);
        }
        case C[2] || CT.C2:
        {
          if (extensions['StringCharacters|get#characters'](oldValue.text)[$length] == maxLength && !dart.test(oldValue.composing.isValid)) {
            return oldValue;
          }
          if (dart.test(newValue.composing.isValid)) {
            return newValue;
          }
          return text_formatter.LengthLimitingTextInputFormatter.truncate(newValue, maxLength);
        }
        default:
        {
          dart.throw(new _internal.ReachabilityError.new("`null` encountered as case in a switch expression with a non-nullable enum type."));
        }
      }
    }
  };
  (text_formatter.LengthLimitingTextInputFormatter.new = function(maxLength, opts) {
    let maxLengthEnforcement = opts && 'maxLengthEnforcement' in opts ? opts.maxLengthEnforcement : null;
    this[maxLength$] = maxLength;
    this[maxLengthEnforcement$] = maxLengthEnforcement;
    if (!(maxLength == null || maxLength === -1 || dart.notNull(maxLength) > 0)) dart.assertFailed(null, I[0], 371, 15, "maxLength == null || maxLength == -1 || maxLength > 0");
    ;
  }).prototype = text_formatter.LengthLimitingTextInputFormatter.prototype;
  dart.addTypeTests(text_formatter.LengthLimitingTextInputFormatter);
  dart.addTypeCaches(text_formatter.LengthLimitingTextInputFormatter);
  dart.setMethodSignature(text_formatter.LengthLimitingTextInputFormatter, () => ({
    __proto__: dart.getMethods(text_formatter.LengthLimitingTextInputFormatter.__proto__),
    formatEditUpdate: dart.fnType(text_input.TextEditingValue, [text_input.TextEditingValue, text_input.TextEditingValue])
  }));
  dart.setLibraryUri(text_formatter.LengthLimitingTextInputFormatter, I[1]);
  dart.setFieldSignature(text_formatter.LengthLimitingTextInputFormatter, () => ({
    __proto__: dart.getFields(text_formatter.LengthLimitingTextInputFormatter.__proto__),
    maxLength: dart.finalFieldType(dart.nullable(core.int)),
    maxLengthEnforcement: dart.finalFieldType(dart.nullable(text_formatter.MaxLengthEnforcement))
  }));
  var TextRange_end = dart.privateName(ui, "TextRange.end");
  var TextRange_start = dart.privateName(ui, "TextRange.start");
  var TextSelection_isDirectional = dart.privateName(text_editing, "TextSelection.isDirectional");
  var _name$0 = dart.privateName(ui, "_name");
  var TextSelection_affinity = dart.privateName(text_editing, "TextSelection.affinity");
  var TextSelection_extentOffset = dart.privateName(text_editing, "TextSelection.extentOffset");
  var TextSelection_baseOffset = dart.privateName(text_editing, "TextSelection.baseOffset");
  text_formatter._selectionAwareTextManipulation = function _selectionAwareTextManipulation(value, substringManipulation) {
    let t0;
    if (value == null) dart.nullFailed(I[0], 532, 20, "value");
    if (substringManipulation == null) dart.nullFailed(I[0], 533, 10, "substringManipulation");
    let selectionStartIndex = value.selection.start;
    let selectionEndIndex = value.selection.end;
    let manipulatedText = null;
    let manipulatedSelection = null;
    if (dart.notNull(selectionStartIndex) < 0 || dart.notNull(selectionEndIndex) < 0) {
      manipulatedText = substringManipulation(value.text);
    } else {
      let beforeSelection = substringManipulation(value.text[$substring](0, selectionStartIndex));
      let inSelection = substringManipulation(value.text[$substring](selectionStartIndex, selectionEndIndex));
      let afterSelection = substringManipulation(value.text[$substring](selectionEndIndex));
      manipulatedText = dart.notNull(beforeSelection) + dart.notNull(inSelection) + dart.notNull(afterSelection);
      if (dart.notNull(value.selection.baseOffset) > dart.notNull(value.selection.extentOffset)) {
        manipulatedSelection = value.selection.copyWith({baseOffset: beforeSelection.length + inSelection.length, extentOffset: beforeSelection.length});
      } else {
        manipulatedSelection = value.selection.copyWith({baseOffset: beforeSelection.length, extentOffset: beforeSelection.length + inSelection.length});
      }
    }
    return new text_input.TextEditingValue.new({text: manipulatedText, selection: (t0 = manipulatedSelection, t0 == null ? C[10] || CT.C10 : t0), composing: manipulatedText == value.text ? value.composing : ui.TextRange.empty});
  };
  dart.trackLibraries("packages/flutter/src/services/text_formatter.dart", {
    "package:flutter/src/services/text_formatter.dart": text_formatter
  }, {
  }, '{"version":3,"sourceRoot":"","sources":["text_formatter.dart"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAsDA;;;QAbK;;;;;EAaL;;;;;;;;;;;;;;;;UAwC4B;AAExB,YAAO,kDAA0B,cAAc;IACjD;;;;EACF;;;;;qBAkBqB,UACA;;UADA;UACA;AAEjB,WAAsB,QAAQ;WAAE,QAAQ;YAAjC,AAAc;IACvB;;;QAX+B;;UACpB,AAAe,cAAD;;EAAS;;;;;;;;;;;;;;;;IA8FpB;;;;;;IASH;;;;;;IA6CE;;;;;;qBAIM,UACA;UADA;UACA;AAEjB,YAAO,gDACL,QAAQ,EACR;YAAQ;AACN,cAAO,AAAU,UAAD,gBACd,8BACS,WAAC,cAAQ;gBAAO;AAAU;kCAAoB,4BAC3C,cAAQ;gBAAQ;AAAa,kBAAA,AAAS,SAAD,gBAAc,yBAAoB;mCAAK;;IAIhG;;;QA9HO;Q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AgB,iBAAiB;AAEwB,MAAhE,kBAAkC,AAAc,aAA9B,eAAe,iBAAG,WAAW,iBAAG,cAAc;AAChE,UAA+B,aAA3B,AAAM,AAAU,KAAX,sCAAwB,AAAM,AAAU,KAAX;AAInC,QAHD,uBAAuB,AAAM,AAAU,KAAX,iCACd,AAAgB,AAAO,eAAR,UAAU,AAAY,WAAD,uBAClC,AAAgB,eAAD;;AAM9B,QAHD,uBAAuB,AAAM,AAAU,KAAX,iCACd,AAAgB,eAAD,uBACb,AAAgB,AAAO,eAAR,UAAU,AAAY,WAAD;;;AAIxD,UAAO,4CACC,eAAe,cACW,KAArB,oBAAoB,EAApB,+CACA,AAAgB,eAAD,IAAI,AAAM,KAAD,QAC7B,AAAM,KAAD,aACK;EAEpB","file":"../../../../../../../../../../../packages/flutter/src/services/text_formatter.dart.lib.js"}');
  // Exports:
  return {
    src__services__text_formatter: text_formatter
  };
}));

//# sourceMappingURL=text_formatter.dart.lib.js.map