text:
/*!
 * headroom.js v0.9.4 - Give your page some headroom. Hide your header until you need it
 * Copyright (c) 2017 Nick Williams - http://wicky.nillia.ms/headroom.js
 * License: MIT
 */

(function(root, factory) {
  'use strict';

  if (typeof define === 'function' && define.amd) {
    // AMD. Register as an anonymous module.
    define([], factory);
  }
  else if (typeof exports === 'object') {
    // COMMONJS
    module.exports = factory();
  }
  else {
    // BROWSER
    root.Headroom = factory();
  }
}(this, function() {
  'use strict';

  /* exported features */

  var features = {
    bind : !!(function(){}.bind),
    classList : 'classList' in document.documentElement,
    rAF : !!(window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame)
  };
  window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame;

  /**
   * Handles debouncing of events via requestAnimationFrame
   * @see http://www.html5rocks.com/en/tutorials/speed/animations/
   * @param {Function} callback The callback to handle whichever event
   */
  function Debouncer (callback) {
    this.callback = callback;
    this.ticking = false;
  }
  Debouncer.prototype = {
    constructor : Debouncer,

    /**
     * dispatches the event to the supplied callback
     * @private
     */
    update : function() {
      this.callback && this.callback();
      this.ticking = false;
    },

    /**
     * ensures events don't get stacked
     * @private
     */
    requestTick : function() {
      if(!this.ticking) {
        requestAnimationFrame(this.rafCallback || (this.rafCallback = this.update.bind(this)));
        this.ticking = true;
      }
    },

    /**
     * Attach this as the event listeners
     */
    handleEvent : function() {
      this.requestTick();
    }
  };
  /**
   * Check if object is part of the DOM
   * @constructor
   * @param {Object} obj element to check
   */
  function isDOMElement(obj) {
    return obj && typeof window !== 'undefined' && (obj === window || obj.nodeType);
  }

  /**
   * Helper function for extending objects
   */
  function extend (object /*, objectN ... */) {
    if(arguments.length <= 0) {
      throw new Error('Missing arguments in extend function');
    }

    var result = object || {},
        key,
        i;

    for (i = 1; i < arguments.length; i++) {
      var replacement = arguments[i] || {};

      for (key in replacement) {
        // Recurse into object except if the object is a DOM element
        if(typeof result[key] === 'object' && ! isDOMElement(result[key])) {
          result[key] = extend(result[key], replacement[key]);
        }
        else {
          result[key] = result[key] || replacement[key];
        }
      }
    }

    return result;
  }

  /**
   * Helper function for normalizing tolerance option to object format
   */
  function normalizeTolerance (t) {
    return t === Object(t) ? t : { down : t, up : t };
  }

  /**
   * UI enhancement for fixed headers.
   * Hides header when scrolling down
   * Shows header when scrolling up
   * @constructor
   * @param {DOMElement} elem the header element
   * @param {Object} options options for the widget
   */
  function Headroom (elem, options) {
    options = extend(options, Headroom.options);

    this.lastKnownScrollY = 0;
    this.elem             = elem;
    this.tolerance        = normalizeTolerance(options.tolerance);
    this.classes          = options.classes;
    this.offset           = options.offset;
    this.scroller         = options.scroller;
    this.initialised      = false;
    this.onPin            = options.onPin;
    this.onUnpin          = options.onUnpin;
    this.onTop            = options.onTop;
    this.onNotTop         = options.onNotTop;
    this.onBottom         = options.onBottom;
    this.onNotBottom      = options.onNotBottom;
  }
  Headroom.prototype = {
    constructor : Headroom,

    /**
     * Initialises the widget
     */
    init : function() {
      if(!Headroom.cutsTheMustard) {
        return;
      }

      this.debouncer = new Debouncer(this.update.bind(this));
      this.elem.classList.add(this.classes.initial);

      // defer event registration to handle browser
      // potentially restoring previous scroll position
      setTimeout(this.attachEvent.bind(this), 100);

      return this;
    },

    /**
     * Unattaches events and removes any classes that were added
     */
    destroy : function() {
      var classes = this.classes;

      this.initialised = false;

      for (var key in classes) {
        if(classes.hasOwnProperty(key)) {
          this.elem.classList.remove(classes[key]);
        }
      }

      this.scroller.removeEventListener('scroll', this.debouncer, false);
    },

    /**
     * Attaches the scroll event
     * @private
     */
    attachEvent : function() {
      if(!this.initialised){
        this.lastKnownScrollY = this.getScrollY();
        this.initialised = true;
        this.scroller.addEventListener('scroll', this.debouncer, false);

        this.debouncer.handleEvent();
      }
    },

    /**
     * Unpins the header if it's currently pinned
     */
    unpin : function() {
      var classList = this.elem.classList,
        classes = this.classes;

      if(classList.contains(classes.pinned) || !classList.contains(classes.unpinned)) {
        classList.add(classes.unpinned);
        classList.remove(classes.pinned);
        this.onUnpin && this.onUnpin.call(this);
      }
    },

    /**
     * Pins the header if it's currently unpinned
     */
    pin : function() {
      var classList = this.elem.classList,
        classes = this.classes;

      if(classList.contains(classes.unpinned)) {
        classList.remove(classes.unpinned);
        classList.add(classes.pinned);
        this.onPin && this.onPin.call(this);
      }
    },

    /**
     * Handles the top states
     */
    top : function() {
      var classList = this.elem.classList,
        classes = this.classes;

      if(!classList.contains(classes.top)) {
        classList.add(classes.top);
        classList.remove(classes.notTop);
        this.onTop && this.onTop.call(this);
      }
    },

    /**
     * Handles the not top state
     */
    notTop : function() {
      var classList = this.elem.classList,
        classes = this.classes;

      if(!classList.contains(classes.notTop)) {
        classList.add(classes.notTop);
        classList.remove(classes.top);
        this.onNotTop && this.onNotTop.call(this);
      }
    },

    bottom : function() {
      var classList = this.elem.classList,
        classes = this.classes;

      if(!classList.contains(classes.bottom)) {
        classList.add(classes.bottom);
        classList.remove(classes.notBottom);
        this.onBottom && this.onBottom.call(this);
      }
    },

    /**
     * Handles the not top state
     */
    notBottom : function() {
      var classList = this.elem.classList,
        classes = this.classes;

      if(!classList.contains(classes.notBottom)) {
        classList.add(classes.notBottom);
        classList.remove(classes.bottom);
        this.onNotBottom && this.onNotBottom.call(this);
      }
    },

    /**
     * Gets the Y scroll position
     * @see https://developer.mozilla.org/en-US/docs/Web/API/Window.scrollY
     * @return {Number} pixels the page has scrolled along the Y-axis
     */
    getScrollY : function() {
      return (this.scroller.pageYOffset !== undefined)
        ? this.scroller.pageYOffset
        : (this.scroller.scrollTop !== undefined)
          ? this.scroller.scrollTop
          : (document.documentElement || document.body.parentNode || document.body).scrollTop;
    },

    /**
     * Gets the height of the viewport
     * @see http://andylangton.co.uk/blog/development/get-viewport-size-width-and-height-javascript
     * @return {int} the height of the viewport in pixels
     */
    getViewportHeight : function () {
      return window.innerHeight
        || document.documentElement.clientHeight
        || document.body.clientHeight;
    },

    /**
     * Gets the physical height of the DOM element
     * @param  {Object}  elm the element to calculate the physical height of which
     * @return {int}     the physical height of the element in pixels
     */
    getElementPhysicalHeight : function (elm) {
      return Math.max(
        elm.offsetHeight,
        elm.clientHeight
      );
    },

    /**
     * Gets the physical height of the scroller element
     * @return {int} the physical height of the scroller element in pixels
     */
    getScrollerPhysicalHeight : function () {
      return (this.scroller === window || this.scroller === document.body)
        ? this.getViewportHeight()
        : this.getElementPhysicalHeight(this.scroller);
    },

    /**
     * Gets the height of the document
     * @see http://james.padolsey.com/javascript/get-document-height-cross-browser/
     * @return {int} the height of the document in pixels
     */
    getDocumentHeight : function () {
      var body = document.body,
        documentElement = document.documentElement;

      return Math.max(
        body.scrollHeight, documentElement.scrollHeight,
        body.offsetHeight, documentElement.offsetHeight,
        body.clientHeight, documentElement.clientHeight
      );
    },

    /**
     * Gets the height of the DOM element
     * @param  {Object}  elm the element to calculate the height of which
     * @return {int}     the height of the element in pixels
     */
    getElementHeight : function (elm) {
      return Math.max(
        elm.scrollHeight,
        elm.offsetHeight,
        elm.clientHeight
      );
    },

    /**
     * Gets the height of the scroller element
     * @return {int} the height of the scroller element in pixels
     */
    getScrollerHeight : function () {
      return (this.scroller === window || this.scroller === document.body)
        ? this.getDocumentHeight()
        : this.getElementHeight(this.scroller);
    },

    /**
     * determines if the scroll position is outside of document boundaries
     * @param  {int}  currentScrollY the current y scroll position
     * @return {bool} true if out of bounds, false otherwise
     */
    isOutOfBounds : function (currentScrollY) {
      var pastTop  = currentScrollY < 0,
        pastBottom = currentScrollY + this.getScrollerPhysicalHeight() > this.getScrollerHeight();

      return pastTop || pastBottom;
    },

    /**
     * determines if the tolerance has been exceeded
     * @param  {int} currentScrollY the current scroll y position
     * @return {bool} true if tolerance exceeded, false otherwise
     */
    toleranceExceeded : function (currentScrollY, direction) {
      return Math.abs(currentScrollY-this.lastKnownScrollY) >= this.tolerance[direction];
    },

    /**
     * determine if it is appropriate to unpin
     * @param  {int} currentScrollY the current y scroll position
     * @param  {bool} toleranceExceeded has the tolerance been exceeded?
     * @return {bool} true if should unpin, false otherwise
     */
    shouldUnpin : function (currentScrollY, toleranceExceeded) {
      var scrollingDown = currentScrollY > this.lastKnownScrollY,
        pastOffset = currentScrollY >= this.offset;

      return scrollingDown && pastOffset && toleranceExceeded;
    },

    /**
     * determine if it is appropriate to pin
     * @param  {int} currentScrollY the current y scroll position
     * @param  {bool} toleranceExceeded has the tolerance been exceeded?
     * @return {bool} true if should pin, false otherwise
     */
    shouldPin : function (currentScrollY, toleranceExceeded) {
      var scrollingUp  = currentScrollY < this.lastKnownScrollY,
        pastOffset = currentScrollY <= this.offset;

      return (scrollingUp && toleranceExceeded) || pastOffset;
    },

    /**
     * Handles updating the state of the widget
     */
    update : function() {
      var currentScrollY  = this.getScrollY(),
        scrollDirection = currentScrollY > this.lastKnownScrollY ? 'down' : 'up',
        toleranceExceeded = this.toleranceExceeded(currentScrollY, scrollDirection);

      if(this.isOutOfBounds(currentScrollY)) { // Ignore bouncy scrolling in OSX
        return;
      }

      if (currentScrollY <= this.offset ) {
        this.top();
      } else {
        this.notTop();
      }

      if(currentScrollY + this.getViewportHeight() >= this.getScrollerHeight()) {
        this.bottom();
      }
      else {
        this.notBottom();
      }

      if(this.shouldUnpin(currentScrollY, toleranceExceeded)) {
        this.unpin();
      }
      else if(this.shouldPin(currentScrollY, toleranceExceeded)) {
        this.pin();
      }

      this.lastKnownScrollY = currentScrollY;
    }
  };
  /**
   * Default options
   * @type {Object}
   */
  Headroom.options = {
    tolerance : {
      up : 0,
      down : 0
    },
    offset : 0,
    scroller: window,
    classes : {
      pinned : 'headroom--pinned',
      unpinned : 'headroom--unpinned',
      top : 'headroom--top',
      notTop : 'headroom--not-top',
      bottom : 'headroom--bottom',
      notBottom : 'headroom--not-bottom',
      initial : 'headroom'
    }
  };
  Headroom.cutsTheMustard = typeof features !== 'undefined' && features.rAF && features.bind && features.classList;

  return Headroom;
}));

       /* headroom */
        var myElement = document.querySelector(".headroom");
        var headroom  = new Headroom(myElement);
        headroom.init();


text:
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _sliceAnsi = _interopRequireDefault(require("slice-ansi"));

var _stringWidth = _interopRequireDefault(require("string-width"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/**
 * @param {string} input
 * @param {number} size
 * @returns {Array}
 */
const wrapWord = (input, size) => {
  let subject;
  subject = input;
  const chunks = []; // https://regex101.com/r/gY5kZ1/1

  const re = new RegExp('(^.{1,' + size + '}(\\s+|$))|(^.{1,' + (size - 1) + '}(\\\\|/|_|\\.|,|;|-))');

  do {
    let chunk;
    chunk = subject.match(re);

    if (chunk) {
      chunk = chunk[0];
      subject = (0, _sliceAnsi.default)(subject, (0, _stringWidth.default)(chunk));
      chunk = chunk.trim();
    } else {
      chunk = (0, _sliceAnsi.default)(subject, 0, size);
      subject = (0, _sliceAnsi.default)(subject, size);
    }

    chunks.push(chunk);
  } while ((0, _stringWidth.default)(subject));

  return chunks;
};

var _default = wrapWord;
exports.default = _default;
//# sourceMappingURL=wrapWord.js.map

domain: javascript


text: (window.webpackJsonp=window.webpackJsonp||[]).push([[315],{367:function(n,e,t){"use strict";t.r(e),t.d(e,"frontMatter",(function(){return i})),t.d(e,"metadata",(function(){return r})),t.d(e,"rightToc",(function(){return l})),t.d(e,"default",(function(){return S}));var o=t(2),a=t(6),s=(t(0),t(431)),i={id:"configuration",title:"Configuration"},r={unversionedId:"reference/configuration",id:"version-v0.5/reference/configuration",isDocsHomePage:!1,title:"Configuration",description:"\x3c!-- THIS FILE IS BEING AUTO-GENERATED. DO NOT MODIFY IT AS ALL CHANGES WILL BE OVERWRITTEN.",source:"@site/versioned_docs/version-v0.5/reference/configuration.md",slug:"/reference/configuration",permalink:"/kratos/docs/reference/configuration",editUrl:"https://github.com/ory/kratos/edit/master/docs/versioned_docs/version-v0.5/reference/configuration.md",version:"v0.5",lastUpdatedBy:"aeneasr",lastUpdatedAt:1603806907,sidebar:"version-v0.5/docs",previous:{title:"Setting up Password Hashing Parameters",permalink:"/kratos/docs/guides/setting-up-password-hashing-parameters"},next:{title:"JSON Schema and JSON Paths",permalink:"/kratos/docs/reference/json-schema-json-paths"}},l=[],u={rightToc:l};function S(n){var e=n.components,t=Object(a.a)(n,["components"]);return Object(s.b)("wrapper",Object(o.a)({},u,t,{components:e,mdxType:"MDXLayout"}),Object(s.b)("p",null,"If file ",Object(s.b)("inlineCode",{parentName:"p"},"$HOME/.kratos.yaml")," exists, it will be used as a configuration file which supports all\nconfiguration settings listed below."),Object(s.b)("p",null,"You can load the config file from another source using the ",Object(s.b)("inlineCode",{parentName:"p"},"-c path/to/config.yaml")," or ",Object(s.b)("inlineCode",{parentName:"p"},"--config path/to/config.yaml"),"\nflag: ",Object(s.b)("inlineCode",{parentName:"p"},"kratos --config path/to/config.yaml"),"."),Object(s.b)("p",null,"Config files can be formatted as JSON, YAML and TOML. Some configuration values support reloading without server restart.\nAll configuration values can be set using environment variables, as documented below."),Object(s.b)("p",null,"This reference configuration documents all keys, also deprecated ones!\nIt is a reference for all possible configuration values."),Object(s.b)("p",null,"If you are looking for an example configuration, it is better to try out the quickstart."),Object(s.b)("p",null,"To find out more about edge cases like setting string array values through environmental variables head to the\n",Object(s.b)("a",Object(o.a)({parentName:"p"},{href:"https://www.ory.sh/docs/ecosystem/configuring"}),"Configuring ORY services")," section."),Object(s.b)("pre",null,Object(s.b)("code",Object(o.a)({parentName:"pre"},{className:"language-yaml"}),"## ORY Kratos Configuration\n#\n\n\n## identity ##\n#\nidentity:\n  \n  ## JSON Schema URL for default identity traits ##\n  #\n  # Path to the JSON Schema which describes a default identity's traits.\n  #\n  # Examples:\n  # - file://path/to/identity.traits.schema.json\n  # - https://foo.bar.com/path/to/identity.traits.schema.json\n  # \n  # Set this value using environment variables on\n  # - Linux/macOS:\n  #    $ export IDENTITY_DEFAULT_SCHEMA_URL=<value>\n  # - Windows Command Line (CMD):\n  #    > set IDENTITY_DEFAULT_SCHEMA_URL=<value>\n  #\n  default_schema_url: https://foo.bar.com/path/to/identity.traits.schema.json\n\n  ## Additional JSON Schemas for Identity Traits ##\n  #\n  # Examples:\n  # - - id: customer\n  #     url: https://foo.bar.com/path/to/customer.traits.schema.json\n  #   - id: employee\n  #     url: https://foo.bar.com/path/to/employee.traits.schema.json\n  #   - id: employee-v2\n  #     url: https://foo.bar.com/path/to/employee.v2.traits.schema.json\n  # \n  # Set this value using environment variables on\n  # - Linux/macOS:\n  #    $ export IDENTITY_SCHEMAS=<value>\n  # - Windows Command Line (CMD):\n  #    > set IDENTITY_SCHEMAS=<value>\n  #\n  schemas:\n    - id: customer\n      url: https://foo.bar.com/path/to/customer.traits.schema.json\n    - id: employee\n      url: https://foo.bar.com/path/to/employee.traits.schema.json\n    - id: employee-v2\n      url: https://foo.bar.com/path/to/employee.v2.traits.schema.json\n\n## Data Source Name ##\n#\n# DSN is used to specify the database credentials as a connection URI.\n#\n# Examples:\n# - \"postgres://user:\n#   password@postgresd:5432/database?sslmode=disable&max_conns=20&max_idle_conns=\\\n#   4\"\n# - mysql://user:secret@tcp(mysqld:3306)/database?max_conns=20&max_idle_conns=4\n# - cockroach://user@cockroachdb:26257/database?sslmode=disable&max_conns=20&max_idle_conns=4\n# - sqlite:///var/lib/sqlite/db.sqlite?_fk=true&mode=rwc\n# \n# Set this value using environment variables on\n# - Linux/macOS:\n#    $ export DSN=<value>\n# - Windows Command Line (CMD):\n#    > set DSN=<value>\n#\ndsn: cockroach://user@cockroachdb:26257/database?sslmode=disable&max_conns=20&max_idle_conns=4\n\n## selfservice ##\n#\nselfservice:\n  \n  ## Redirect browsers to set URL per default ##\n  #\n  # ORY Kratos redirects to this URL per default on completion of self-service flows and other browser interaction. Read this [article for more information on browser redirects](https://www.ory.sh/kratos/docs/concepts/browser-redirect-flow-completion).\n  #\n  # Examples:\n  # - https://my-app.com/dashboard\n  # - /dashboard\n  # \n  # Set this value using environment variables on\n  # - Linux/macOS:\n  #    $ export SELFSERVICE_DEFAULT_BROWSER_RETURN_URL=<value>\n  # - Windows Command Line (CMD):\n  #    > set SELFSERVICE_DEFAULT_BROWSER_RETURN_URL=<value>\n  #\n  default_browser_return_url: https://my-app.com/dashboard\n\n  ## Whitelisted Return To URLs ##\n  #\n  # List of URLs that are allowed to be redirected to. A redirection request is made by appending `?return_to=...` to Login, Registration, and other self-service flows.\n  #\n  # Examples:\n  # - - https://app.my-app.com/dashboard\n  #   - /dashboard\n  #   - https://www.my-app.com/\n  # \n  # Set this value using environment variables on\n  # - Linux/macOS:\n  #    $ export SELFSERVICE_WHITELISTED_RETURN_URLS=<value>\n  # - Windows Command Line (CMD):\n  #    > set SELFSERVICE_WHITELISTED_RETURN_URLS=<value>\n  #\n  whitelisted_return_urls:\n    - https://app.my-app.com/dashboard\n    - /dashboard\n    - https://www.my-app.com/\n\n  ## flows ##\n  #\n  flows:\n    \n    ## settings ##\n    #\n    settings:\n      \n      ## URL of the Settings page. ##\n      #\n      # URL where the Settings UI is hosted. Check the [reference implementation](https://github.com/ory/kratos-selfservice-ui-node).\n      #\n      # Default value: https://www.ory.sh/kratos/docs/fallback/settings\n      #\n      # Examples:\n      # - https://my-app.com/user/settings\n      # \n      # Set this value using environment variables on\n      # - Linux/macOS:\n      #    $ export SELFSERVICE_FLOWS_SETTINGS_UI_URL=<value>\n      # - Windows Command Line (CMD):\n      #    > set SELFSERVICE_FLOWS_SETTINGS_UI_URL=<value>\n      #\n      ui_url: https://www.ory.sh/kratos/docs/fallback/settings\n\n      ## lifespan ##\n      #\n      # Default value: 1h\n      #\n      # Examples:\n      # - 1h\n      # - 1m\n      # - 1s\n      # \n      # Set this value using environment variables on\n      # - Linux/macOS:\n      #    $ export SELFSERVICE_FLOWS_SETTINGS_LIFESPAN=<value>\n      # - Windows Command Line (CMD):\n      #    > set SELFSERVICE_FLOWS_SETTINGS_LIFESPAN=<value>\n      #\n      lifespan: 1h\n\n      ## privileged_session_max_age ##\n      #\n      # Default value: 1h\n      #\n      # Examples:\n      # - 1h\n      # - 1m\n      # - 1s\n      # \n      # Set this value using environment variables on\n      # - Linux/macOS:\n      #    $ export SELFSERVICE_FLOWS_SETTINGS_PRIVILEGED_SESSION_MAX_AGE=<value>\n      # - Windows Command Line (CMD):\n      #    > set SELFSERVICE_FLOWS_SETTINGS_PRIVILEGED_SESSION_MAX_AGE=<value>\n      #\n      privileged_session_max_age: 1h\n\n      ## after ##\n      #\n      after:\n        \n        ## Redirect browsers to set URL per default ##\n        #\n        # ORY Kratos redirects to this URL per default on completion of self-service flows and other browser interaction. Read this [article for more information on browser redirects](https://www.ory.sh/kratos/docs/concepts/browser-redirect-flow-completion).\n        #\n        # Examples:\n        # - https://my-app.com/dashboard\n        # - /dashboard\n        # \n        # Set this value using environment variables on\n        # - Linux/macOS:\n        #    $ export SELFSERVICE_FLOWS_SETTINGS_AFTER_DEFAULT_BROWSER_RETURN_URL=<value>\n        # - Windows Command Line (CMD):\n        #    > set SELFSERVICE_FLOWS_SETTINGS_AFTER_DEFAULT_BROWSER_RETURN_URL=<value>\n        #\n        default_browser_return_url: https://my-app.com/dashboard\n\n        ## password ##\n        #\n        password:\n          \n          ## Redirect browsers to set URL per default ##\n          #\n          # ORY Kratos redirects to this URL per default on completion of self-service flows and other browser interaction. Read this [article for more information on browser redirects](https://www.ory.sh/kratos/docs/concepts/browser-redirect-flow-completion).\n          #\n          # Examples:\n          # - https://my-app.com/dashboard\n          # - /dashboard\n          # \n          # Set this value using environment variables on\n          # - Linux/macOS:\n          #    $ export SELFSERVICE_FLOWS_SETTINGS_AFTER_PASSWORD_DEFAULT_BROWSER_RETURN_URL=<value>\n          # - Windows Command Line (CMD):\n          #    > set SELFSERVICE_FLOWS_SETTINGS_AFTER_PASSWORD_DEFAULT_BROWSER_RETURN_URL=<value>\n          #\n          default_browser_return_url: https://my-app.com/dashboard\n\n          ## hooks ##\n          #\n          # Set this value using environment variables on\n          # - Linux/macOS:\n          #    $ export SELFSERVICE_FLOWS_SETTINGS_AFTER_PASSWORD_HOOKS=<value>\n          # - Windows Command Line (CMD):\n          #    > set SELFSERVICE_FLOWS_SETTINGS_AFTER_PASSWORD_HOOKS=<value>\n          #\n          hooks:\n            - hook: verify\n\n        ## profile ##\n        #\n        profile:\n          \n          ## Redirect browsers to set URL per default ##\n          #\n          # ORY Kratos redirects to this URL per default on completion of self-service flows and other browser interaction. Read this [article for more information on browser redirects](https://www.ory.sh/kratos/docs/concepts/browser-redirect-flow-completion).\n          #\n          # Examples:\n          # - https://my-app.com/dashboard\n          # - /dashboard\n          # \n          # Set this value using environment variables on\n          # - Linux/macOS:\n          #    $ export SELFSERVICE_FLOWS_SETTINGS_AFTER_PROFILE_DEFAULT_BROWSER_RETURN_URL=<value>\n          # - Windows Command Line (CMD):\n          #    > set SELFSERVICE_FLOWS_SETTINGS_AFTER_PROFILE_DEFAULT_BROWSER_RETURN_URL=<value>\n          #\n          default_browser_return_url: /dashboard\n\n          ## hooks ##\n          #\n          # Set this value using environment variables on\n          # - Linux/macOS:\n          #    $ export SELFSERVICE_FLOWS_SETTINGS_AFTER_PROFILE_HOOKS=<value>\n          # - Windows Command Line (CMD):\n          #    > set SELFSERVICE_FLOWS_SETTINGS_AFTER_PROFILE_HOOKS=<value>\n          #\n          hooks:\n            - hook: verify\n\n    ## logout ##\n    #\n    logout:\n      \n      ## after ##\n      #\n      after:\n        \n        ## Redirect browsers to set URL per default ##\n        #\n        # ORY Kratos redirects to this URL per default on completion of self-service flows and other browser interaction. Read this [article for more information on browser redirects](https://www.ory.sh/kratos/docs/concepts/browser-redirect-flow-completion).\n        #\n        # Examples:\n        # - https://my-app.com/dashboard\n        # - /dashboard\n        # \n        # Set this value using environment variables on\n        # - Linux/macOS:\n        #    $ export SELFSERVICE_FLOWS_LOGOUT_AFTER_DEFAULT_BROWSER_RETURN_URL=<value>\n        # - Windows Command Line (CMD):\n        #    > set SELFSERVICE_FLOWS_LOGOUT_AFTER_DEFAULT_BROWSER_RETURN_URL=<value>\n        #\n        default_browser_return_url: /dashboard\n\n    ## registration ##\n    #\n    registration:\n      \n      ## Registration UI URL ##\n      #\n      # URL where the Registration UI is hosted. Check the [reference implementation](https://github.com/ory/kratos-selfservice-ui-node).\n      #\n      # Default value: https://www.ory.sh/kratos/docs/fallback/registration\n      #\n      # Examples:\n      # - https://my-app.com/signup\n      # \n      # Set this value using environment variables on\n      # - Linux/macOS:\n      #    $ export SELFSERVICE_FLOWS_REGISTRATION_UI_URL=<value>\n      # - Windows Command Line (CMD):\n      #    > set SELFSERVICE_FLOWS_REGISTRATION_UI_URL=<value>\n      #\n      ui_url: https://www.ory.sh/kratos/docs/fallback/registration\n\n      ## lifespan ##\n      #\n      # Default value: 1h\n      #\n      # Examples:\n      # - 1h\n      # - 1m\n      # - 1s\n      # \n      # Set this value using environment variables on\n      # - Linux/macOS:\n      #    $ export SELFSERVICE_FLOWS_REGISTRATION_LIFESPAN=<value>\n      # - Windows Command Line (CMD):\n      #    > set SELFSERVICE_FLOWS_REGISTRATION_LIFESPAN=<value>\n      #\n      lifespan: 1s\n\n      ## after ##\n      #\n      after:\n        \n        ## Redirect browsers to set URL per default ##\n        #\n        # ORY Kratos redirects to this URL per default on completion of self-service flows and other browser interaction. Read this [article for more information on browser redirects](https://www.ory.sh/kratos/docs/concepts/browser-redirect-flow-completion).\n        #\n        # Examples:\n        # - https://my-app.com/dashboard\n        # - /dashboard\n        # \n        # Set this value using environment variables on\n        # - Linux/macOS:\n        #    $ export SELFSERVICE_FLOWS_REGISTRATION_AFTER_DEFAULT_BROWSER_RETURN_URL=<value>\n        # - Windows Command Line (CMD):\n        #    > set SELFSERVICE_FLOWS_REGISTRATION_AFTER_DEFAULT_BROWSER_RETURN_URL=<value>\n        #\n        default_browser_return_url: https://my-app.com/dashboard\n\n        ## password ##\n        #\n        password:\n          \n          ## Redirect browsers to set URL per default ##\n          #\n          # ORY Kratos redirects to this URL per default on completion of self-service flows and other browser interaction. Read this [article for more information on browser redirects](https://www.ory.sh/kratos/docs/concepts/browser-redirect-flow-completion).\n          #\n          # Examples:\n          # - https://my-app.com/dashboard\n          # - /dashboard\n          # \n          # Set this value using environment variables on\n          # - Linux/macOS:\n          #    $ export SELFSERVICE_FLOWS_REGISTRATION_AFTER_PASSWORD_DEFAULT_BROWSER_RETURN_URL=<value>\n          # - Windows Command Line (CMD):\n          #    > set SELFSERVICE_FLOWS_REGISTRATION_AFTER_PASSWORD_DEFAULT_BROWSER_RETURN_URL=<value>\n          #\n          default_browser_return_url: /dashboard\n\n          ## hooks ##\n          #\n          # Set this value using environment variables on\n          # - Linux/macOS:\n          #    $ export SELFSERVICE_FLOWS_REGISTRATION_AFTER_PASSWORD_HOOKS=<value>\n          # - Windows Command Line (CMD):\n          #    > set SELFSERVICE_FLOWS_REGISTRATION_AFTER_PASSWORD_HOOKS=<value>\n          #\n          hooks:\n            - hook: session\n\n        ## oidc ##\n        #\n        oidc:\n          \n          ## Redirect browsers to set URL per default ##\n          #\n          # ORY Kratos redirects to this URL per default on completion of self-service flows and other browser interaction. Read this [article for more information on browser redirects](https://www.ory.sh/kratos/docs/concepts/browser-redirect-flow-completion).\n          #\n          # Examples:\n          # - https://my-app.com/dashboard\n          # - /dashboard\n          # \n          # Set this value using environment variables on\n          # - Linux/macOS:\n          #    $ export SELFSERVICE_FLOWS_REGISTRATION_AFTER_OIDC_DEFAULT_BROWSER_RETURN_URL=<value>\n          # - Windows Command Line (CMD):\n          #    > set SELFSERVICE_FLOWS_REGISTRATION_AFTER_OIDC_DEFAULT_BROWSER_RETURN_URL=<value>\n          #\n          default_browser_return_url: https://my-app.com/dashboard\n\n          ## hooks ##\n          #\n          # Set this value using environment variables on\n          # - Linux/macOS:\n          #    $ export SELFSERVICE_FLOWS_REGISTRATION_AFTER_OIDC_HOOKS=<value>\n          # - Windows Command Line (CMD):\n          #    > set SELFSERVICE_FLOWS_REGISTRATION_AFTER_OIDC_HOOKS=<value>\n          #\n          hooks:\n            - hook: session\n\n    ## login ##\n    #\n    login:\n      \n      ## Login UI URL ##\n      #\n      # URL where the Login UI is hosted. Check the [reference implementation](https://github.com/ory/kratos-selfservice-ui-node).\n      #\n      # Default value: https://www.ory.sh/kratos/docs/fallback/login\n      #\n      # Examples:\n      # - https://my-app.com/login\n      # \n      # Set this value using environment variables on\n      # - Linux/macOS:\n      #    $ export SELFSERVICE_FLOWS_LOGIN_UI_URL=<value>\n      # - Windows Command Line (CMD):\n      #    > set SELFSERVICE_FLOWS_LOGIN_UI_URL=<value>\n      #\n      ui_url: https://www.ory.sh/kratos/docs/fallback/login\n\n      ## lifespan ##\n      #\n      # Default value: 1h\n      #\n      # Examples:\n      # - 1h\n      # - 1m\n      # - 1s\n      # \n      # Set this value using environment variables on\n      # - Linux/macOS:\n      #    $ export SELFSERVICE_FLOWS_LOGIN_LIFESPAN=<value>\n      # - Windows Command Line (CMD):\n      #    > set SELFSERVICE_FLOWS_LOGIN_LIFESPAN=<value>\n      #\n      lifespan: 1h\n\n      ## after ##\n      #\n      after:\n        \n        ## Redirect browsers to set URL per default ##\n        #\n        # ORY Kratos redirects to this URL per default on completion of self-service flows and other browser interaction. Read this [article for more information on browser redirects](https://www.ory.sh/kratos/docs/concepts/browser-redirect-flow-completion).\n        #\n        # Examples:\n        # - https://my-app.com/dashboard\n        # - /dashboard\n        # \n        # Set this value using environment variables on\n        # - Linux/macOS:\n        #    $ export SELFSERVICE_FLOWS_LOGIN_AFTER_DEFAULT_BROWSER_RETURN_URL=<value>\n        # - Windows Command Line (CMD):\n        #    > set SELFSERVICE_FLOWS_LOGIN_AFTER_DEFAULT_BROWSER_RETURN_URL=<value>\n        #\n        default_browser_return_url: /dashboard\n\n        ## password ##\n        #\n        password:\n          \n          ## Redirect browsers to set URL per default ##\n          #\n          # ORY Kratos redirects to this URL per default on completion of self-service flows and other browser interaction. Read this [article for more information on browser redirects](https://www.ory.sh/kratos/docs/concepts/browser-redirect-flow-completion).\n          #\n          # Examples:\n          # - https://my-app.com/dashboard\n          # - /dashboard\n          # \n          # Set this value using environment variables on\n          # - Linux/macOS:\n          #    $ export SELFSERVICE_FLOWS_LOGIN_AFTER_PASSWORD_DEFAULT_BROWSER_RETURN_URL=<value>\n          # - Windows Command Line (CMD):\n          #    > set SELFSERVICE_FLOWS_LOGIN_AFTER_PASSWORD_DEFAULT_BROWSER_RETURN_URL=<value>\n          #\n          default_browser_return_url: /dashboard\n\n          ## hooks ##\n          #\n          # Set this value using environment variables on\n          # - Linux/macOS:\n


text:
import React from 'react';
import { BrowserRouter as Router, Link, Match, Miss } from 'react-router';

import Home from './Home';
import Show from './show/Show';
//import KanbanApp from './kanban/KanbanApp';
import Kanban from './kanban2/Kanban';
import About from './About';

import NotFound from './NotFound';

import './App.css';

const App = () => {
  return (
    <Router>

<Link to='/myreact-demo'>Home</Link>

<Link to='/myreact-demo/show'>Show</Link>

<Link to='/myreact-demo/kanban'>Kanban</Link>

<Link to='/myreact-demo/about'>About</Link>

          <Match exactly pattern='/myreact-demo' component={Home}/>
          <Match pattern='/myreact-demo/show' component={Show}/>
          <Match pattern='/myreact-demo/kanban' component={Kanban}/>
          <Match pattern='/myreact-demo/about' component={About}/>
          <Miss component={NotFound}/>

    </Router>
  );
};

export default App;


text:
describe('$.fn.serviceStatus', function() {
  var subject,
      $serviceStatus;

  var serviceResponse = {
    'status': 'foo',
    'sub_state': 'bar',
    'active_state': 'baz',
    'load_state': 'buzz'
  };

  beforeEach(function() {
    jasmine.Ajax.useMock();
    spyOn(window, 'setTimeout');

    fixture.load('service-status.html');
    $serviceStatus = $('#teaspoon-fixtures').find('.service-status');

    subject = new $.PMX.ServiceStatus($serviceStatus);
  });

  describe('init', function() {

    it('queries the service endpoint', function() {
      subject.init();
      var request = mostRecentAjaxRequest();
      expect(request.url).toBe('/foo/bar');
    });

    it('displays the sub state', function() {
      subject.init();
      mockAjaxResponse();

      expect($('.sub-state').text()).toEqual(
        subject.formatPanamaxState(serviceResponse.sub_state));
    });

    it('displays the loading state', function() {
      subject.init();
      mockAjaxResponse();

      expect($('.load-state').text()).toEqual(
        subject.formatPanamaxState(serviceResponse.load_state));
    });

    it('displays the active state', function() {
      subject.init();
      mockAjaxResponse();

      expect($('.active-state').text()).toEqual(
        subject.formatPanamaxState(serviceResponse.active_state));
    });

    it('displays the Panamax state', function() {
      subject.init();
      mockAjaxResponse();

      expect($('.panamax-state').text()).toEqual(
        subject.formatPanamaxState(serviceResponse.status));
    });

    it('adds a CSS class matching the service status', function() {
      subject.init();
      mockAjaxResponse();

      expect($serviceStatus.attr('class')).toContain('service-status');
      expect($serviceStatus.attr('class')).toContain(serviceResponse.status);
    });

    it('calls window.setTimeout', function() {
      subject.init();
      mockAjaxResponse();

      expect(window.setTimeout).toHaveBeenCalledWith(
        subject.fetchStatus, subject.options.refreshInterval);
    });

    describe('hovering on the panamax-state element', function() {
      var mouseenter = $.Event('mouseenter');
      var mouseleave = $.Event('mouseleave');

      it('displays the tooltip on mouseenter', function() {
        subject.init();
        $('.panamax-state').trigger(mouseenter);
        expect($('.tooltip').css('display')).toBe('block');
      });

      it('hides the tooltip on mouseleave', function() {
        subject.init();
        $('.panamax-state').trigger(mouseleave);
        expect($('.tooltip').css('display')).toBe('none');
      });
    });

    describe('when a request is already in-progress', function() {

      var fakeAjax = {
        abort: function() {},
        done: function() { return fakeAjax; }
      };

      beforeEach(function() {
        subject.xhr = fakeAjax;
        spyOn(fakeAjax, 'abort');
      });

      it('aborts previous requests', function() {
        subject.init();
        expect(fakeAjax.abort.calls.length).toEqual(1);
      });
    });
  });

  var mockAjaxResponse = function() {
    mostRecentAjaxRequest().response({
      status: 200,
      responseText: JSON.stringify(serviceResponse)
    });
  };
});


text:
//////////////// mock database ////////////
 export default {
    parent:'projects/dialogflow-web-v2',
    displayName: 'MIMIC',
    defaultLanguageCode: 'en',
    supportedLanguageCodes: ['ru'],
    timeZone: 'Europe/Madrid',
    description: 'Strategic Machines delivers compelling feature-rich conversational experiences Choose your language and send \"Hello\" to get started',
    avatarUri: 'https://storage.googleapis.com/cloudprod-apiai/409650f9-9ecb-4ba7-af33-d95bd5190931_x.png',
    enableLogging: true,
    matchMode: 'MATCH_MODE_HYBRID',
    classificationThreshold: 0.3,
    apiVersion: 'API_VERSION_V2',
    tier: 'TIER_STANDARD'
}


text:
/*
 ** Util functions which are dependent on ApexCharts instance
 */

class CoreUtils {
  constructor(ctx) {
    this.ctx = ctx
    this.w = ctx.w
  }

  static checkComboSeries(series) {
    let comboCharts = false
    let comboBarCount = 0

    // if user specified a type in series too, turn on comboCharts flag
    if (series.length && typeof series[0].type !== 'undefined') {
      comboCharts = true
      series.forEach((s) => {
        if (
          s.type === 'bar' ||
          s.type === 'column' ||
          s.type === 'candlestick'
        ) {
          comboBarCount++
        }
      })
    }

    return {
      comboBarCount,
      comboCharts
    }
  }

  /**
   * @memberof CoreUtils
   * returns the sum of all individual values in a multiple stacked series
   * Eg. w.globals.series = [[32,33,43,12], [2,3,5,1]]
   *  @return [34,36,48,13]
   **/
  getStackedSeriesTotals() {
    const w = this.w
    let total = []

    if (w.globals.series.length === 0) return total

    for (
      let i = 0;
      i < w.globals.series[w.globals.maxValsInArrayIndex].length;
      i++
    ) {
      let t = 0
      for (let j = 0; j < w.globals.series.length; j++) {
        if (typeof w.globals.series[j][i] !== 'undefined') {
          t += w.globals.series[j][i]
        }
      }
      total.push(t)
    }
    w.globals.stackedSeriesTotals = total
    return total
  }

  // get total of the all values inside all series
  getSeriesTotalByIndex(index = null) {
    if (index === null) {
      // non-plot chart types - pie / donut / circle
      return this.w.config.series.reduce((acc, cur) => acc + cur, 0)
    } else {
      // axis charts - supporting multiple series
      return this.w.globals.series[index].reduce((acc, cur) => acc + cur, 0)
    }
  }

  isSeriesNull(index = null) {
    let r = []
    if (index === null) {
      // non-plot chart types - pie / donut / circle
      r = this.w.config.series.filter((d) => d !== null)
    } else {
      // axis charts - supporting multiple series
      r = this.w.config.series[index].data.filter((d) => d !== null)
    }

    return r.length === 0
  }

  seriesHaveSameValues(index) {
    console.log('coreUtils.js', this.w.globals.series)
    return (
      this.w.globals.series &&
      this.w.globals.series[index] &&
      this.w.globals.series[index].every((val, i, arr) => val === arr[0])
    )
  }

  getCategoryLabels(labels) {
    const w = this.w
    let catLabels = labels.slice()
    if (w.config.xaxis.convertedCatToNumeric) {
      catLabels = labels.map((i, li) => {
        return w.config.xaxis.labels.formatter(i - w.globals.minX + 1)
      })
    }
    return catLabels
  }
  // maxValsInArrayIndex is the index of series[] which has the largest number of items
  getLargestSeries() {
    const w = this.w
    w.globals.maxValsInArrayIndex = w.globals.series
      .map((a) => a.length)
      .indexOf(
        Math.max.apply(
          Math,
          w.globals.series.map((a) => a.length)
        )
      )
  }

  getLargestMarkerSize() {
    const w = this.w
    let size = 0

    w.globals.markers.size.forEach((m) => {
      size = Math.max(size, m)
    })

    w.globals.markers.largestSize = size

    return size
  }

  /**
   * @memberof Core
   * returns the sum of all values in a series
   * Eg. w.globals.series = [[32,33,43,12], [2,3,5,1]]
   *  @return [120, 11]
   **/
  getSeriesTotals() {
    const w = this.w

    w.globals.seriesTotals = w.globals.series.map((ser, index) => {
      let total = 0

      if (Array.isArray(ser)) {
        for (let j = 0; j < ser.length; j++) {
          total += ser[j]
        }
      } else {
        // for pie/donuts/gauges
        total += ser
      }

      return total
    })
  }

  getSeriesTotalsXRange(minX, maxX) {
    const w = this.w

    const seriesTotalsXRange = w.globals.series.map((ser, index) => {
      let total = 0

      for (let j = 0; j < ser.length; j++) {
        if (
          w.globals.seriesX[index][j] > minX &&
          w.globals.seriesX[index][j] < maxX
        ) {
          total += ser[j]
        }
      }

      return total
    })

    return seriesTotalsXRange
  }

  /**
   * @memberof CoreUtils
   * returns the percentage value of all individual values which can be used in a 100% stacked series
   * Eg. w.globals.series = [[32, 33, 43, 12], [2, 3, 5, 1]]
   *  @return [[94.11, 91.66, 89.58, 92.30], [5.88, 8.33, 10.41, 7.7]]
   **/
  getPercentSeries() {
    const w = this.w

    w.globals.seriesPercent = w.globals.series.map((ser, index) => {
      let seriesPercent = []
      if (Array.isArray(ser)) {
        for (let j = 0; j < ser.length; j++) {
          let total = w.globals.stackedSeriesTotals[j]
          let percent = 0
          if (total) {
            percent = (100 * ser[j]) / total
          }
          seriesPercent.push(percent)
        }
      } else {
        const total = w.globals.seriesTotals.reduce((acc, val) => acc + val, 0)
        let percent = (100 * ser) / total
        seriesPercent.push(percent)
      }

      return seriesPercent
    })
  }

  getCalculatedRatios() {
    let gl = this.w.globals

    let yRatio = []
    let invertedYRatio = 0
    let xRatio = 0
    let initialXRatio = 0
    let invertedXRatio = 0
    let zRatio = 0
    let baseLineY = []
    let baseLineInvertedY = 0.1
    let baseLineX = 0

    gl.yRange = []
    if (gl.isMultipleYAxis) {
      for (let i = 0; i < gl.minYArr.length; i++) {
        gl.yRange.push(Math.abs(gl.minYArr[i] - gl.maxYArr[i]))
        baseLineY.push(0)
      }
    } else {
      gl.yRange.push(Math.abs(gl.minY - gl.maxY))
    }
    gl.xRange = Math.abs(gl.maxX - gl.minX)
    gl.zRange = Math.abs(gl.maxZ - gl.minZ)

    // multiple y axis
    for (let i = 0; i < gl.yRange.length; i++) {
      yRatio.push(gl.yRange[i] / gl.gridHeight)
    }

    xRatio = gl.xRange / gl.gridWidth

    initialXRatio = Math.abs(gl.initialMaxX - gl.initialMinX) / gl.gridWidth

    invertedYRatio = gl.yRange / gl.gridWidth
    invertedXRatio = gl.xRange / gl.gridHeight
    zRatio = (gl.zRange / gl.gridHeight) * 16

    if (!zRatio) {
      zRatio = 1
    }

    if (gl.minY !== Number.MIN_VALUE && Math.abs(gl.minY) !== 0) {
      // Negative numbers present in series
      gl.hasNegs = true
    }

    if (gl.isMultipleYAxis) {
      baseLineY = []

      // baseline variables is the 0 of the yaxis which will be needed when there are negatives
      for (let i = 0; i < yRatio.length; i++) {
        baseLineY.push(-gl.minYArr[i] / yRatio[i])
      }
    } else {
      baseLineY.push(-gl.minY / yRatio[0])

      if (gl.minY !== Number.MIN_VALUE && Math.abs(gl.minY) !== 0) {
        baseLineInvertedY = -gl.minY / invertedYRatio // this is for bar chart
        baseLineX = gl.minX / xRatio
      }
    }

    return {
      yRatio,
      invertedYRatio,
      zRatio,
      xRatio,
      initialXRatio,
      invertedXRatio,
      baseLineInvertedY,
      baseLineY,
      baseLineX
    }
  }

  getLogSeries(series) {
    const w = this.w

    w.globals.seriesLog = series.map((s, i) => {
      if (w.config.yaxis[i] && w.config.yaxis[i].logarithmic) {
        return s.map((d) => {
          if (d === null) return null

          return this.getLogVal(d, i)
        })
      } else {
        return s
      }
    })

    return w.globals.invalidLogScale ? series : w.globals.seriesLog
  }

  getLogVal(d, yIndex) {
    const w = this.w
    return (
      (Math.log(d) - Math.log(w.globals.minYArr[yIndex])) /
      (Math.log(w.globals.maxYArr[yIndex]) -
        Math.log(w.globals.minYArr[yIndex]))
    )
  }

  getLogYRatios(yRatio) {
    const w = this.w
    const gl = this.w.globals

    gl.yLogRatio = yRatio.slice()

    gl.logYRange = gl.yRange.map((yRange, i) => {
      if (w.config.yaxis[i] && this.w.config.yaxis[i].logarithmic) {
        let maxY = -Number.MAX_VALUE
        let minY = Number.MIN_VALUE
        let range = 1
        gl.seriesLog.forEach((s, si) => {
          s.forEach((v) => {
            if (w.config.yaxis[si] && w.config.yaxis[si].logarithmic) {
              maxY = Math.max(v, maxY)
              minY = Math.min(v, minY)
            }
          })
        })

        range = Math.pow(gl.yRange[i], Math.abs(minY - maxY) / gl.yRange[i])

        gl.yLogRatio[i] = range / gl.gridHeight
        return range
      }
    })

    return gl.invalidLogScale ? yRatio.slice() : gl.yLogRatio
  }

  // Some config objects can be array - and we need to extend them correctly
  static extendArrayProps(configInstance, options, w) {
    if (options.yaxis) {
      options = configInstance.extendYAxis(options, w)
    }
    if (options.annotations) {
      if (options.annotations.yaxis) {
        options = configInstance.extendYAxisAnnotations(options)
      }
      if (options.annotations.xaxis) {
        options = configInstance.extendXAxisAnnotations(options)
      }
      if (options.annotations.points) {
        options = configInstance.extendPointAnnotations(options)
      }
    }

    return options
  }
}

export default CoreUtils